diff --git a/package.json b/package.json index 8360001eeb..9c583beb75 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "scripts": { "build": "npm run build:bundle && npm run build:dts", "build:bundle": "webpack --mode production --display-modules", - "build:dts": "node scripts/build-dts", + "build:dts": "node scripts/build-dts && tsc --noEmit tests/dts/index", "clean": "node scripts/clean", "check": "npm run check:config && npm run check:compiler", "check:config": "tsc --noEmit -p src --diagnostics --listFiles", diff --git a/scripts/build-dts.js b/scripts/build-dts.js index d301245153..7f9de26678 100644 --- a/scripts/build-dts.js +++ b/scripts/build-dts.js @@ -448,3 +448,14 @@ module.exports.default({ sendMessage: console.log, stdout: stdout }); + +stdout.write("\n"); + +module.exports.default({ + project: path.resolve(__dirname, "..", "std/assembly/shared"), + prefix: "assemblyscript/std/assembly/shared", + exclude: [], + verbose: true, + sendMessage: console.log, + stdout: stdout +}); diff --git a/src/index.ts b/src/index.ts index d35b2b2126..097418cbb1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -208,4 +208,4 @@ export * from "./program"; export * from "./resolver"; export * from "./tokenizer"; export * from "./types"; -export * from "./util"; +export * from "./util/index"; diff --git a/std/assembly/shared/tsconfig.json b/std/assembly/shared/tsconfig.json new file mode 100644 index 0000000000..6dafbedf83 --- /dev/null +++ b/std/assembly/shared/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../portable.json", + "compilerOptions": { + "outDir": "../../../out", + "allowJs": false, + "sourceMap": true + }, + "include": [ + "./**/*.ts" + ] +} diff --git a/tests/dts/index.ts b/tests/dts/index.ts new file mode 100644 index 0000000000..1c698f6831 --- /dev/null +++ b/tests/dts/index.ts @@ -0,0 +1,5 @@ +// used to check dist/assemblyscript.d.ts +import * as as from "../.."; + +var parser: as.Parser = as.parseFile("", "empty"); +parser.finish();