create-sia-app 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -167,9 +167,21 @@ async function scaffold(options) {
167
167
  p2.outro(pc2.green("Happy building!"));
168
168
  }
169
169
 
170
+ // src/defaults.ts
171
+ import crypto2 from "crypto";
172
+ function getDefaultOptions(projectName) {
173
+ return {
174
+ projectName,
175
+ appKey: crypto2.randomBytes(32).toString("hex"),
176
+ indexerUrl: "https://app.sia.storage",
177
+ appDescription: "A Sia storage app"
178
+ };
179
+ }
180
+
170
181
  // src/index.ts
171
182
  async function main() {
172
- const options = await runPrompts();
183
+ const name = process.argv[2];
184
+ const options = name ? getDefaultOptions(name) : await runPrompts();
173
185
  if (!options) process.exit(0);
174
186
  await scaffold(options);
175
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sia-app",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-sia-app": "./dist/index.js"
@@ -12,9 +12,9 @@
12
12
  "scripts": {
13
13
  "build": "tsup src/index.ts --format esm --dts --clean && rm -rf ./template && cp -r ../../template ./template && rm -rf ./template/node_modules",
14
14
  "dev": "tsup src/index.ts --format esm --watch",
15
- "release:patch": "npm version --no-git-tag-version patch && bun run release:push",
16
- "release:minor": "npm version --no-git-tag-version minor && bun run release:push",
17
- "release:major": "npm version --no-git-tag-version major && bun run release:push",
15
+ "release:patch": "node -e \"const p=require('./package.json');const v=p.version.split('.');v[2]++;p.version=v.join('.');require('fs').writeFileSync('./package.json',JSON.stringify(p,null,2)+'\\n')\" && bun run release:push",
16
+ "release:minor": "node -e \"const p=require('./package.json');const v=p.version.split('.');v[1]++;v[2]=0;p.version=v.join('.');require('fs').writeFileSync('./package.json',JSON.stringify(p,null,2)+'\\n')\" && bun run release:push",
17
+ "release:major": "node -e \"const p=require('./package.json');const v=p.version.split('.');v[0]++;v[1]=0;v[2]=0;p.version=v.join('.');require('fs').writeFileSync('./package.json',JSON.stringify(p,null,2)+'\\n')\" && bun run release:push",
18
18
  "release:push": "git add package.json && git commit -m \"v$(node -p 'require(\"./package.json\").version')\" && git tag v$(node -p 'require(\"./package.json\").version') && git push && git push --tags"
19
19
  },
20
20
  "dependencies": {