Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ module.exports = {
"es6": true
},
files: [
"**/*.js"
"**/*.js",
"bin/*"
],
rules: {
// Node's support for ESM is still not great, but this rule is likely
Expand Down
8 changes: 6 additions & 2 deletions bin/asinit
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ const compilerDir = path.join(__dirname, "..");
const compilerVersion = require(path.join(compilerDir, "package.json")).version;
const assemblyDir = path.join(projectDir, "assembly");
const tsconfigFile = path.join(assemblyDir, "tsconfig.json");
const tsconfigBase = path.relative(assemblyDir, path.join(compilerDir, "std", "assembly.json"));
let tsconfigBase = path.relative(assemblyDir, path.join(compilerDir, "std", "assembly.json"));
if (/^(\.\.[/\\])*node_modules[/\\]assemblyscript[/\\]/.test(tsconfigBase)) {
// Use node resolution if the compiler is a normal dependency
tsconfigBase = "assemblyscript/std/assembly.json";
}
const entryFile = path.join(assemblyDir, "index.ts");
const buildDir = path.join(projectDir, "build");
const testsDir = path.join(projectDir, "tests");
Expand Down Expand Up @@ -247,7 +251,7 @@ function ensureGitignore() {
}

function ensurePackageJson() {
console.log("- Making sure that 'package.json' contains the build commands...")
console.log("- Making sure that 'package.json' contains the build commands...");
const entryPath = path.relative(projectDir, entryFile).replace(/\\/g, "/");
const buildUntouched = "asc " + entryPath + " -b build/untouched.wasm -t build/untouched.wat --sourceMap --debug";
const buildOptimized = "asc " + entryPath + " -b build/optimized.wasm -t build/optimized.wat --sourceMap --optimize";
Expand Down