From 3d544c2fe5898b13c6c0efa0fc172f321424adf5 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Tue, 12 Dec 2017 16:08:54 +0100 Subject: [PATCH] Slight restructure --- README.md | 4 ++-- package.json | 13 +++++-------- src/glue/js.js | 2 +- src/tsconfig.json | 2 +- assembly.d.ts => std/assembly.d.ts | 2 -- assembly.json => std/assembly.json | 8 ++++---- std/assembly/tsconfig.json | 2 +- portable.d.ts => std/portable.d.ts | 0 portable.js => std/portable.js | 0 portable.json => std/portable.json | 9 ++++----- std/portable/tsconfig.json | 2 +- 11 files changed, 19 insertions(+), 25 deletions(-) rename assembly.d.ts => std/assembly.d.ts (99%) rename assembly.json => std/assembly.json (62%) rename portable.d.ts => std/portable.d.ts (100%) rename portable.js => std/portable.js (100%) rename portable.json => std/portable.json (66%) diff --git a/README.md b/README.md index ae999eb9..5f96ff79 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ $> cd next $> npm install ``` -Author your module in AssemblyScript ([definitions](./assembly.d.ts), [base config](./assembly.json)) or portable AssemblyScript ([definitions](./portable.d.ts), [base config](./portable.json)) and run: +Author your module in AssemblyScript ([definitions](./std/assembly.d.ts), [base config](./std/assembly.json)) or portable AssemblyScript ([definitions](./std/portable.d.ts), [base config](./std/portable.json)) and run: ``` -$> node bin\asc yourModule.ts +$> node bin/asc yourModule.ts ``` Using the CLI diff --git a/package.json b/package.json index acd25312..1981aa98 100644 --- a/package.json +++ b/package.json @@ -48,20 +48,17 @@ "test": "npm run test:config --scripts-prepend-node-path && npm run test:parser --scripts-prepend-node-path && npm run test:compiler --scripts-prepend-node-path" }, "files": [ - "assembly.d.ts", - "bin/asc.js", - "bin/asc.json", - "dist/assemblyscript.js", - "dist/assemblyscript.js.map", + "bin/", + "dist/", "index.d.ts", "index.js", "LICENSE", "NOTICE", "package.json", "package-lock.json", - "portable-assembly.d.ts", - "portable-assembly.js", "README.md", - "src" + "src/", + "std/", + "tsconfig-base.json" ] } diff --git a/src/glue/js.js b/src/glue/js.js index 024d4895..0a54c792 100644 --- a/src/glue/js.js +++ b/src/glue/js.js @@ -1,4 +1,4 @@ -require("../../portable"); +require("../../std/portable"); // Copy Binaryen exports to global scope var globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self; diff --git a/src/tsconfig.json b/src/tsconfig.json index 66846e47..f44161e6 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../portable.json", + "extends": "../std/portable.json", "compilerOptions": { "outDir": "../out", "sourceMap": true diff --git a/assembly.d.ts b/std/assembly.d.ts similarity index 99% rename from assembly.d.ts rename to std/assembly.d.ts index a31a6652..73910164 100644 --- a/assembly.d.ts +++ b/std/assembly.d.ts @@ -106,8 +106,6 @@ declare function struct(): any; // Standard library (not yet implemented) -/// - interface Array {} interface Boolean {} interface Function {} diff --git a/assembly.json b/std/assembly.json similarity index 62% rename from assembly.json rename to std/assembly.json index ad58b722..1472a2cc 100644 --- a/assembly.json +++ b/std/assembly.json @@ -1,13 +1,13 @@ { - "extends": "./tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "target": "esnext", "noLib": true, "types": [], "rootDirs": [ - "./std/assembly", - "./node_modules" - ] + "./assembly" + ], + "allowJs": false }, "files": [ "./assembly.d.ts" diff --git a/std/assembly/tsconfig.json b/std/assembly/tsconfig.json index 11e71a59..7fd4ee69 100644 --- a/std/assembly/tsconfig.json +++ b/std/assembly/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../assembly.json", + "extends": "../assembly.json", "compilerOptions": { "diagnostics": true }, diff --git a/portable.d.ts b/std/portable.d.ts similarity index 100% rename from portable.d.ts rename to std/portable.d.ts diff --git a/portable.js b/std/portable.js similarity index 100% rename from portable.js rename to std/portable.js diff --git a/portable.json b/std/portable.json similarity index 66% rename from portable.json rename to std/portable.json index de0add81..b5f0f807 100644 --- a/portable.json +++ b/std/portable.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig-base.json", + "extends": "../tsconfig-base.json", "compilerOptions": { "target": "es5", "module": "commonjs", @@ -8,15 +8,14 @@ "noLib": true, "types": [], "rootDirs": [ - "./std/portable", - "./node_modules" + "./portable" ], "allowJs": true }, "files": [ "./portable.d.ts", "./portable.js", - "./std/portable/heap.d.ts", - "./std/portable/heap.js" + "./portable/heap.d.ts", + "./portable/heap.js" ] } diff --git a/std/portable/tsconfig.json b/std/portable/tsconfig.json index 9e06b840..502aa57d 100644 --- a/std/portable/tsconfig.json +++ b/std/portable/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../portable.json", + "extends": "../portable.json", "compilerOptions": { "diagnostics": true },