From 75c4c20d6639cf3659109c9eef38e571678bdfb8 Mon Sep 17 00:00:00 2001 From: FineArchs <133759614+FineArchs@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:31:37 +0900 Subject: [PATCH 1/3] add pkg-json translater (#493) --- .gitignore | 1 + etc/aiscript.api.md | 3 +++ package.json | 2 +- playground/src/App.vue | 4 ++-- scripts/gen-pkg-ts.mjs | 15 +++++++++++++++ src/constants.ts | 2 ++ src/index.ts | 2 ++ src/interpreter/lib/std.ts | 3 ++- 8 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 scripts/gen-pkg-ts.mjs create mode 100644 src/constants.ts diff --git a/.gitignore b/.gitignore index 7c3b17f0..6452090c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /.vscode /coverage /temp +/src/pkg.ts /src/parser/parser.js /src/parser/parser.mjs npm-debug.log diff --git a/etc/aiscript.api.md b/etc/aiscript.api.md index c430eb08..bcdd0042 100644 --- a/etc/aiscript.api.md +++ b/etc/aiscript.api.md @@ -22,6 +22,9 @@ type AddAssign_2 = NodeBase_2 & { expr: Expression_2; }; +// @public (undocumented) +export const AISCRIPT_VERSION: "0.17.0"; + // @public (undocumented) abstract class AiScriptError extends Error { constructor(message: string, info?: any); diff --git a/package.json b/package.json index 8f4965ed..1e0c0422 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "ts": "npm run ts-esm && npm run ts-dts", "ts-esm": "tsc --outDir built/esm", "ts-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", - "build": "npm run peg && npm run ts", + "build": "node scripts/gen-pkg-ts.mjs && npm run peg && npm run ts", "build-debug": "npm run peg-debug && tsc", "api": "npx api-extractor run --local --verbose", "api-prod": "npx api-extractor run --verbose", diff --git a/playground/src/App.vue b/playground/src/App.vue index f1d3df1f..cfbe6b5e 100644 --- a/playground/src/App.vue +++ b/playground/src/App.vue @@ -1,6 +1,6 @@