From f98e5e33bd59b04551ffe1b05f5dde1ed5fd8f41 Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 11 Oct 2023 09:55:22 +0200 Subject: [PATCH 1/2] Adding `index.ts` for scalefunc and log packages in typescript Signed-off-by: Shivansh Vij --- integration/integration.test.ts | 2 +- log/index.ts | 17 +++++++++++++++++ log/log.ts | 2 +- module.ts | 2 +- scalefunc/index.ts | 17 +++++++++++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 log/index.ts create mode 100644 scalefunc/index.ts diff --git a/integration/integration.test.ts b/integration/integration.test.ts index be146903..d2573cf8 100644 --- a/integration/integration.test.ts +++ b/integration/integration.test.ts @@ -14,7 +14,7 @@ limitations under the License. */ -import { ScaleFunc } from "../scalefunc/scalefunc"; +import { ScaleFunc } from "../scalefunc"; import { New as NewScale } from "../scale"; import fs from "fs"; diff --git a/log/index.ts b/log/index.ts new file mode 100644 index 00000000..df193aa6 --- /dev/null +++ b/log/index.ts @@ -0,0 +1,17 @@ +/* + Copyright 2022 Loophole Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +export * from "./log"; diff --git a/log/log.ts b/log/log.ts index 4db88e36..fd027166 100644 --- a/log/log.ts +++ b/log/log.ts @@ -14,7 +14,7 @@ limitations under the License. */ -import {Writer} from "../config"; +import {Writer} from "scale"; export function NamedLogger(name: string, writer: Writer): Writer { return (message: string) => { diff --git a/module.ts b/module.ts index 813fb88e..b32f71f2 100644 --- a/module.ts +++ b/module.ts @@ -21,7 +21,7 @@ import {UnpackUint32} from "./utils"; import {Decoder} from "@loopholelabs/polyglot"; import {DisabledWASI} from "./wasi"; import {v4 as uuid} from "uuid"; -import {NamedLogger} from "./log/log"; +import {NamedLogger} from "./log"; import {Tracing} from "./tracing"; export async function NewModule(template: Template): Promise> { diff --git a/scalefunc/index.ts b/scalefunc/index.ts new file mode 100644 index 00000000..c21b87f7 --- /dev/null +++ b/scalefunc/index.ts @@ -0,0 +1,17 @@ +/* + Copyright 2022 Loophole Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +export * from "./scalefunc"; From dfb83630e69de4a91d2c70fe7196ea763262e0e8 Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 11 Oct 2023 10:00:04 +0200 Subject: [PATCH 2/2] Updating CHANGELOG.md Signed-off-by: Shivansh Vij --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a6dd68..f2247542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixes + +- Added an `index.ts` file to the `scalefunc` and `log` packages in TypeScript to make importing them more ergonomic + ## [v0.4.5] - 2023-10-09 ### Features