mirror of
https://github.com/fluencelabs/fl-init
synced 2025-04-24 22:32:19 +00:00
add simple readme, edit package.json, change license
This commit is contained in:
parent
0ce4bd8fd9
commit
39ad430d20
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
Script to initialize Fluence project on AssemblyScript.
|
||||
|
||||
Run `npx fluencelabs/fl-init` in new project directory.
|
17
bin/fl-init
17
bin/fl-init
@ -8,6 +8,23 @@ npx asinit .
|
||||
rm index.js
|
||||
rm assembly/index.ts
|
||||
|
||||
echo | node <<EOL
|
||||
const fs = require('fs');
|
||||
|
||||
let rawdata = fs.readFileSync('package.json');
|
||||
let packageJson = JSON.parse(rawdata);
|
||||
delete packageJson.scripts;
|
||||
|
||||
let scripts = {
|
||||
flbuild: "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat --sourceMap --validate --optimize --use abort=''"
|
||||
};
|
||||
|
||||
packageJson.scripts = scripts;
|
||||
|
||||
let data = JSON.stringify(packageJson, null, 4);
|
||||
fs.writeFileSync('package.json', data);
|
||||
EOL
|
||||
|
||||
cat >assembly/index.ts <<EOL
|
||||
// you can use other allocators like 'buddy' or 'tlsf', but only this can be fully reset
|
||||
import "allocator/arena";
|
||||
|
@ -10,7 +10,7 @@
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/fluencelabs/as-init/issues"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user