create-blocklet 0.4.48 → 0.4.50

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 (61) hide show
  1. package/index.js +269 -229
  2. package/lib/utils.js +30 -1
  3. package/package.json +7 -7
  4. package/templates/{blocklet-page-static → blocklet-page}/.blocklet-pages/config.yml +0 -0
  5. package/templates/{blocklet-page-static → blocklet-page}/.blocklet-pages/layouts/MyLayout.mdx +0 -0
  6. package/templates/{blocklet-page-static → blocklet-page}/.blocklet-pages/layouts/images/logo.png +0 -0
  7. package/templates/{blocklet-page-static → blocklet-page}/README.md +0 -0
  8. package/templates/{blocklet-page-static → blocklet-page}/blocklet.md +0 -0
  9. package/templates/{blocklet-page-static → blocklet-page}/blocklet.yml +0 -0
  10. package/templates/{blocklet-page-static → blocklet-page}/package.json +6 -3
  11. package/templates/{blocklet-page-static → blocklet-page}/pages/index.mdx +0 -0
  12. package/templates/{blocklet-page-static → blocklet-page}/pages/index.zh.mdx +0 -0
  13. package/templates/{doc-site-static → doc-site}/.blocklet-pages/config.yml +0 -0
  14. package/templates/{doc-site-static → doc-site}/.blocklet-pages/layouts/Documentation.mdx +0 -0
  15. package/templates/{doc-site-static → doc-site}/.blocklet-pages/layouts/images/logo.png +0 -0
  16. package/templates/{doc-site-static → doc-site}/README.md +0 -0
  17. package/templates/{doc-site-static → doc-site}/blocklet.md +1 -1
  18. package/templates/{doc-site-static → doc-site}/blocklet.yml +0 -0
  19. package/templates/{doc-site-static → doc-site}/package.json +7 -4
  20. package/templates/{doc-site-static → doc-site}/pages/index.mdx +0 -0
  21. package/templates/{doc-site-static → doc-site}/pages/index.zh.mdx +0 -0
  22. package/templates/{doc-site-static → doc-site}/pages/intro/index.mdx +0 -0
  23. package/templates/{doc-site-static → doc-site}/pages/intro/index.zh.mdx +0 -0
  24. package/templates/express-api/.env +1 -0
  25. package/templates/express-api/blocklet.md +2 -2
  26. package/templates/express-api/package.json +7 -5
  27. package/templates/html-static/package.json +3 -0
  28. package/templates/monorepo/.editorconfig +23 -0
  29. package/templates/monorepo/.github/workflows/main.yml +36 -0
  30. package/templates/monorepo/.github/workflows/pr-title.yml +21 -0
  31. package/templates/monorepo/.github/workflows/version-check.yml +20 -0
  32. package/templates/monorepo/.husky/pre-commit +4 -0
  33. package/templates/monorepo/.prettierrc +9 -0
  34. package/templates/monorepo/LICENSE +13 -0
  35. package/templates/monorepo/Makefile +22 -0
  36. package/templates/monorepo/README.md +64 -0
  37. package/templates/monorepo/eslintrc.js +7 -0
  38. package/templates/monorepo/lerna.json +14 -0
  39. package/templates/monorepo/package.json +31 -0
  40. package/templates/monorepo/scripts/bump-version.mjs +32 -0
  41. package/templates/monorepo/version +1 -0
  42. package/templates/nextjs-dapp/blocklet.md +2 -2
  43. package/templates/nextjs-dapp/package.json +9 -7
  44. package/templates/react-dapp/api/index.js +1 -1
  45. package/templates/react-dapp/package.json +11 -9
  46. package/templates/react-gun-dapp/api/index.js +1 -1
  47. package/templates/react-gun-dapp/blocklet.md +2 -2
  48. package/templates/react-gun-dapp/package.json +11 -9
  49. package/templates/react-static/package.json +4 -2
  50. package/templates/solidjs-dapp/api/index.js +1 -1
  51. package/templates/solidjs-dapp/package.json +14 -12
  52. package/templates/solidjs-static/package.json +7 -5
  53. package/templates/svelte-dapp/api/index.js +1 -1
  54. package/templates/svelte-dapp/package.json +12 -10
  55. package/templates/svelte-static/package.json +6 -4
  56. package/templates/vue-dapp/api/index.js +1 -1
  57. package/templates/vue-dapp/package.json +15 -13
  58. package/templates/vue-static/package.json +8 -6
  59. package/templates/vue2-dapp/api/index.js +1 -1
  60. package/templates/vue2-dapp/package.json +14 -12
  61. package/templates/vue2-static/package.json +7 -5
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "blocklet-page",
3
+ "version": "0.1.0",
3
4
  "private": true,
4
5
  "scripts": {
5
6
  "dev": "blocklet dev",
6
7
  "start": "xmark start",
7
8
  "clean": "rm -rf .blocklet && rm -rf node_modules/.vite",
8
- "build": "xmark build --base=/",
9
+ "build": "xmark build",
9
10
  "bundle": "npm run clean && xmark build && blocklet bundle --create-release",
10
11
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
11
- "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json"
12
+ "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
13
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
14
+ "dev:child": "blocklet dev --component --app-did=<%= did %>"
12
15
  },
13
16
  "dependencies": {
14
- "@xmark/cli": "^2.4.36"
17
+ "@xmark/cli": "^2.4.44"
15
18
  }
16
19
  }
@@ -1,3 +1,3 @@
1
- # template-blocklet-page
1
+ # template-doc-site
2
2
 
3
3
  A doc-site template for creating a new blocklet project.
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "doc-site",
3
+ "version": "0.1.0",
3
4
  "private": true,
4
5
  "scripts": {
5
6
  "dev": "blocklet dev",
6
7
  "start": "xmark start",
7
8
  "clean": "rm -rf .blocklet && rm -rf node_modules/.vite",
8
- "build": "xmark build --base=/",
9
+ "build": "xmark build",
9
10
  "bundle": "npm run clean && xmark build && blocklet bundle --create-release",
10
11
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
11
- "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json"
12
+ "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
13
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
14
+ "dev:child": "blocklet dev --component --app-did=<%= did %>"
12
15
  },
13
16
  "dependencies": {
14
- "@xmark/cli": "^2.4.36",
15
- "@xmark/theme-docs": "^2.4.36"
17
+ "@xmark/cli": "^2.4.44",
18
+ "@xmark/theme-docs": "^2.4.44"
16
19
  }
17
20
  }
@@ -0,0 +1 @@
1
+ APP_TITLE=''
@@ -1,3 +1,3 @@
1
- # template-react
1
+ # template-express
2
2
 
3
- A react template for creating a new blocklet project.
3
+ A express template for creating a new blocklet project.
@@ -12,6 +12,8 @@
12
12
  "bundle": "npm run clean && blocklet bundle --zip --create-release",
13
13
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
14
14
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
15
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
16
+ "dev:child": "blocklet dev --component --app-did=<%= did %>",
15
17
  "prepare": "husky install"
16
18
  },
17
19
  "lint-staged": {
@@ -27,18 +29,18 @@
27
29
  "author": "",
28
30
  "license": "ISC",
29
31
  "dependencies": {
30
- "@arcblock/did-auth-storage-nedb": "^1.6.3",
31
- "@blocklet/sdk": "^1.8.13",
32
- "@ocap/client": "^1.17.16",
32
+ "@arcblock/did-auth-storage-nedb": "^1.7.1",
33
+ "@blocklet/sdk": "^1.8.22",
34
+ "@ocap/client": "^1.17.19",
33
35
  "dotenv-flow": "^3.2.0",
34
36
  "express": "^4.18.1"
35
37
  },
36
38
  "devDependencies": {
37
- "nodemon": "^2.0.19",
38
39
  "@arcblock/eslint-config-base": "^0.2.3",
39
- "eslint": "^8.23.0",
40
+ "eslint": "^8.23.1",
40
41
  "husky": "^8.0.1",
41
42
  "lint-staged": "^12.5.0",
43
+ "nodemon": "^2.0.20",
42
44
  "prettier": "^2.7.1"
43
45
  }
44
46
  }
@@ -2,9 +2,12 @@
2
2
  "name": "template-html",
3
3
  "version": "0.1.0",
4
4
  "scripts": {
5
+ "dev": "blocklet dev",
5
6
  "clean": "rm -rf .blocklet",
6
7
  "bundle": "npm run clean && blocklet bundle --create-release",
7
8
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle --skip-hooks",
9
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
10
+ "dev:child": "blocklet dev --component --app-did=<%= did %>",
8
11
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json"
9
12
  },
10
13
  "keywords": [],
@@ -0,0 +1,23 @@
1
+ # For more information about the properties used in
2
+ # this file, please see the EditorConfig documentation:
3
+ # http://editorconfig.org/
4
+ #
5
+ # Sensible EditorConfig defaults
6
+ # https://gist.github.com/matijs/662bf45dd4ec37b3a068
7
+ root = true
8
+
9
+ [*]
10
+ charset = utf-8
11
+ end_of_line = lf
12
+ indent_size = 2
13
+ indent_style = space
14
+ insert_final_newline = true
15
+ trim_trailing_whitespace = true
16
+
17
+ # Make sure package.json always uses 2 spaces to indent
18
+ [{package.json}]
19
+ indent_size = 2
20
+ indent_style = space
21
+
22
+ [{makefile, Makefile}]
23
+ indent_style = tab
@@ -0,0 +1,36 @@
1
+ name: Deploy
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ Deploy:
10
+ runs-on: ubuntu-latest
11
+
12
+ if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
13
+
14
+ steps:
15
+ - name: Checkout repo
16
+ uses: actions/checkout@v2
17
+
18
+ - name: Set yarn cache
19
+ uses: c-hive/gha-yarn-cache@v2
20
+
21
+ - name: Install dependencies
22
+ run: yarn
23
+
24
+ - name: Blocklet workflow
25
+ uses: blocklet/action-workflow@v1
26
+ with:
27
+ skip-upload: false
28
+ skip-deploy: false
29
+ bundle-command: yarn bundle
30
+ store-endpoint: ${{ secrets.STORE_ENDPOINT }}
31
+ store-access-token: ${{ secrets.STORE_ACCESS_TOKEN }}
32
+ server-endpoint: ${{ secrets.SERVER_ENDPOINT }}
33
+ server-access-key: ${{ secrets.SERVER_ACCESS_KEY }}
34
+ server-access-secret: ${{ secrets.SERVER_ACCESS_SECRET }}
35
+ slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
36
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,21 @@
1
+ name: 'Lint PR Title'
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - reopened
8
+ - edited
9
+ - synchronize
10
+ branches:
11
+ - main
12
+ - dev
13
+ - master
14
+
15
+ jobs:
16
+ lint-title:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: ArcBlock/action-lint-pull-request-title@master
20
+ env:
21
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,20 @@
1
+ name: 'Version Check'
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - reopened
8
+ - edited
9
+ - synchronize
10
+ branches:
11
+ - main
12
+ - master
13
+ jobs:
14
+ main:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: action-version-check
18
+ uses: arcblock/action-version-check@master
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,9 @@
1
+ {
2
+ "printWidth": 120,
3
+ "useTabs": false,
4
+ "tabWidth": 2,
5
+ "trailingComma": "es5",
6
+ "bracketSameLine": true,
7
+ "semi": true,
8
+ "singleQuote": true
9
+ }
@@ -0,0 +1,13 @@
1
+ Copyright 2018-2020 ArcBlock
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+
3
+ init: install dep
4
+ @echo "Initializing the repo..."
5
+
6
+ install:
7
+ @echo "Install software required for this repo..."
8
+
9
+ dep:
10
+ @echo "Install dependencies required for this repo..."
11
+ @lerna bootstrap
12
+ @lerna link
13
+
14
+ test:
15
+ @echo "Running test suites..."
16
+
17
+ build:
18
+ @echo "Building the software..."
19
+
20
+
21
+ github-init:
22
+ @make dep
@@ -0,0 +1,64 @@
1
+ # Getting Started with Create Blocklet
2
+
3
+ This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet).
4
+
5
+ This project is a monorepo project, which means that there are multiple blocklet applications.
6
+
7
+ ## File Structure
8
+
9
+ - .prettierrc - Prettier configuration
10
+ - LICENSE - License file
11
+ - Makefile - Makefile
12
+ - package.json - Npm package file
13
+ - eslintrc.js
14
+ - lerna.json
15
+ - README.md - A guide for this blocklet
16
+ - version - Version file
17
+ - .gitignore
18
+ - .npmrc
19
+ - scripts/
20
+ - batch-modify-deps-version.mjs
21
+ - bump-version.mjs
22
+ - blocklets/ - Blocklet applications
23
+
24
+ ## Development
25
+
26
+ 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
27
+
28
+ Blocklet needs blocklet server as a dependency. So you need to install it first.
29
+ `npm install -g @blocklet/cli`
30
+ See details in [https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#use-the-binary-distribution](https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#use-the-binary-distribution)
31
+
32
+ 2. Init blocklet server & start blocklet server
33
+
34
+ Before starting an blocklet server, you need to init blocklet server.
35
+ `blocklet server init --mode=debug`
36
+ `blocklet server start`
37
+ See details in [https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#configure-abt-node](https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#configure-abt-node)
38
+
39
+ 3. init project
40
+
41
+ ```bash
42
+ make init
43
+ ```
44
+
45
+ 4. Go to the main blocklet directory `cd blocklets/[main blocklet]`
46
+ 5. Start development server: `npm run dev`
47
+ 6. Go to the other blocklet directory `cd blocklets/[other blocklet]`
48
+ 7. Start development server: `npm run dev:child`
49
+
50
+ ## update version
51
+
52
+ ```bash
53
+ npm run bump-version
54
+ ```
55
+
56
+ ## Reference
57
+
58
+ Our docs site is generate by Create Blocklet itself.
59
+
60
+ We use Blocklet Page to write our docs
61
+
62
+ check more details on
63
+
64
+ - [Create Blocklet Docs](https://www.createblocklet.dev/docs/en/intro)
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@arcblock/eslint-config',
4
+ globals: {
5
+ logger: true,
6
+ },
7
+ };
@@ -0,0 +1,14 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "useWorkspaces": true,
4
+ "npmClient": "yarn",
5
+ "command": {
6
+ "publish": {
7
+ "message": "[skip ci] %s"
8
+ }
9
+ },
10
+ "packages": [
11
+ "blocklets/*"
12
+ ]
13
+ }
14
+
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "root",
3
+ "private": true,
4
+ "workspaces": [
5
+ "blocklets/*"
6
+ ],
7
+ "husky": {
8
+ "hooks": {
9
+ "pre-commit": "npm run lint"
10
+ }
11
+ },
12
+ "scripts": {
13
+ "lint": "lerna run lint",
14
+ "lint:fix": "lerna run lint:fix",
15
+ "build": "lerna run clean && lerna run build",
16
+ "clean": "lerna clean && lerna run clean",
17
+ "bump-version": "zx scripts/bump-version.mjs --quiet",
18
+ "update:deps": "lerna exec --no-bail -- \"ncu -u -f /arcblock\\|ocap\\|abtnode\\|blocklet\\|did-connect/\" && lerna bootstrap && npx yarn-deduplicate yarn.lock && yarn"
19
+ },
20
+ "keywords": [],
21
+ "author": "",
22
+ "license": "ISC",
23
+ "devDependencies": {
24
+ "@arcblock/eslint-config": "0.2.2",
25
+ "bumpp": "^7.2.0",
26
+ "eslint": "^8.23.1",
27
+ "husky": "^4.3.8",
28
+ "prettier": "^2.7.1",
29
+ "zx": "^7.0.8"
30
+ }
31
+ }
@@ -0,0 +1,32 @@
1
+ /* eslint-disable no-console */
2
+ import { execSync } from 'child_process';
3
+ import { $, chalk, fs } from 'zx';
4
+
5
+ // or use pnpm to bump version: `pnpm -r --filter {packages/*, themes/*} -- pnpm version`
6
+ execSync('bumpp package.json packages/*/package.json plugins/*/package.json', { stdio: 'inherit' });
7
+
8
+ const { version } = await fs.readJSON('package.json');
9
+
10
+ console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Then press enter to continue.`);
11
+
12
+ let newChangelog = '';
13
+
14
+ try {
15
+ const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
16
+ newChangelog = gitRes.stdout.trim();
17
+ } catch {
18
+ console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
19
+ }
20
+
21
+ // TODO: 这里可以直接用 nodejs 来获取日期?不需要区分系统语言
22
+ const dateRes = await $`date +'%B %d, %Y'`;
23
+ const date = dateRes.stdout.trim();
24
+ const title = `## ${version} (${date})`;
25
+
26
+ await fs.ensureFile('CHANGELOG.md');
27
+ const oldChangelog = await fs.readFile('CHANGELOG.md', 'utf8');
28
+ const changelog = [title, newChangelog, oldChangelog].filter((item) => !!item).join('\n\n');
29
+
30
+ await fs.writeFile('CHANGELOG.md', changelog);
31
+ await $`read`;
32
+ await fs.writeFileSync('version', version);
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -1,3 +1,3 @@
1
- # template-react
1
+ # template-nextjs
2
2
 
3
- A react template for creating a new blocklet project.
3
+ A nextjs template for creating a new blocklet project.
@@ -13,6 +13,8 @@
13
13
  "bundle:api": "npm run clean && blocklet bundle --zip --create-release",
14
14
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
15
15
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
16
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
17
+ "dev:child": "blocklet dev --component --app-did=<%= did %>",
16
18
  "prepare": "husky install"
17
19
  },
18
20
  "lint-staged": {
@@ -25,12 +27,12 @@
25
27
  ]
26
28
  },
27
29
  "dependencies": {
28
- "@arcblock/did-auth": "^1.17.16",
29
- "@arcblock/did-auth-storage-nedb": "^1.6.3",
30
- "@blocklet/sdk": "^1.8.13",
31
- "@ocap/client": "^1.17.16",
32
- "@ocap/mcrypto": "^1.17.16",
33
- "@ocap/wallet": "^1.17.16",
30
+ "@arcblock/did-auth": "^1.17.19",
31
+ "@arcblock/did-auth-storage-nedb": "^1.7.1",
32
+ "@blocklet/sdk": "^1.8.22",
33
+ "@ocap/client": "^1.17.19",
34
+ "@ocap/mcrypto": "^1.17.19",
35
+ "@ocap/wallet": "^1.17.19",
34
36
  "dotenv-flow": "^3.2.0",
35
37
  "express": "^4.18.1",
36
38
  "next": "12.2.3",
@@ -42,7 +44,7 @@
42
44
  "eslint-config-next": "12.2.3",
43
45
  "husky": "^8.0.1",
44
46
  "lint-staged": "^12.5.0",
45
- "nodemon": "^2.0.19",
47
+ "nodemon": "^2.0.20",
46
48
  "npm-run-all": "^4.1.5"
47
49
  }
48
50
  }
@@ -27,7 +27,7 @@ if (isProduction) {
27
27
  app.use(cors());
28
28
  app.use(compression());
29
29
 
30
- const staticDir = path.resolve(__dirname, '../', 'build');
30
+ const staticDir = path.resolve(process.env.BLOCKLET_APP_DIR, 'build');
31
31
  app.use(express.static(staticDir, { maxAge: '30d', index: false }));
32
32
  app.use(router);
33
33
  app.use(fallback('index.html', { root: staticDir }));
@@ -15,6 +15,8 @@
15
15
  "bundle:api": "npm run clean && blocklet bundle --zip --create-release",
16
16
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
17
17
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
18
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
19
+ "dev:child": "blocklet dev --component --app-did=<%= did %>",
18
20
  "prepare": "husky install"
19
21
  },
20
22
  "lint-staged": {
@@ -39,12 +41,12 @@
39
41
  ]
40
42
  },
41
43
  "dependencies": {
42
- "@arcblock/did-auth": "^1.17.16",
43
- "@arcblock/did-auth-storage-nedb": "^1.6.3",
44
- "@blocklet/sdk": "^1.8.13",
45
- "@ocap/client": "^1.17.16",
46
- "@ocap/mcrypto": "^1.17.16",
47
- "@ocap/wallet": "^1.17.16",
44
+ "@arcblock/did-auth": "^1.17.19",
45
+ "@arcblock/did-auth-storage-nedb": "^1.7.1",
46
+ "@blocklet/sdk": "^1.8.22",
47
+ "@ocap/client": "^1.17.19",
48
+ "@ocap/mcrypto": "^1.17.19",
49
+ "@ocap/wallet": "^1.17.19",
48
50
  "axios": "^0.27.2",
49
51
  "compression": "^1.7.4",
50
52
  "cookie-parser": "^1.4.6",
@@ -55,16 +57,16 @@
55
57
  "express-history-api-fallback": "^2.2.1",
56
58
  "react": "^18.2.0",
57
59
  "react-dom": "^18.2.0",
58
- "react-router-dom": "^6.3.0"
60
+ "react-router-dom": "^6.4.0"
59
61
  },
60
62
  "devDependencies": {
61
63
  "@arcblock/eslint-config": "^0.2.3",
62
64
  "@craco/craco": "^6.4.5",
63
- "eslint": "^8.23.0",
65
+ "eslint": "^8.23.1",
64
66
  "husky": "^8.0.1",
65
67
  "lint-staged": "^12.5.0",
66
- "nodemon": "^2.0.19",
67
68
  "node-polyfill-webpack-plugin": "^2.0.1",
69
+ "nodemon": "^2.0.20",
68
70
  "npm-run-all": "^4.1.5",
69
71
  "prettier": "^2.7.1",
70
72
  "react-scripts": "5.0.1"
@@ -32,7 +32,7 @@ if (isProduction) {
32
32
  app.use(cors());
33
33
  app.use(compression());
34
34
 
35
- const staticDir = path.resolve(__dirname, '../', 'build');
35
+ const staticDir = path.resolve(process.env.BLOCKLET_APP_DIR, 'build');
36
36
  app.use(express.static(staticDir, { maxAge: '30d', index: false }));
37
37
  app.use(router);
38
38
  app.use(fallback('index.html', { root: staticDir }));
@@ -1,3 +1,3 @@
1
- # template-react
1
+ # template-react-gun
2
2
 
3
- A react template for creating a new blocklet project.
3
+ A react gun for creating a new blocklet project.
@@ -15,6 +15,8 @@
15
15
  "bundle:api": "npm run clean && blocklet bundle --zip --create-release",
16
16
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
17
17
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
18
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
19
+ "dev:child": "blocklet dev --component --app-did=<%= did %>",
18
20
  "prepare": "husky install"
19
21
  },
20
22
  "lint-staged": {
@@ -39,12 +41,12 @@
39
41
  ]
40
42
  },
41
43
  "dependencies": {
42
- "@arcblock/did-auth": "^1.17.16",
43
- "@arcblock/did-auth-storage-nedb": "^1.6.3",
44
- "@blocklet/sdk": "^1.8.13",
45
- "@ocap/client": "^1.17.16",
46
- "@ocap/mcrypto": "^1.17.16",
47
- "@ocap/wallet": "^1.17.16",
44
+ "@arcblock/did-auth": "^1.17.19",
45
+ "@arcblock/did-auth-storage-nedb": "^1.7.1",
46
+ "@blocklet/sdk": "^1.8.22",
47
+ "@ocap/client": "^1.17.19",
48
+ "@ocap/mcrypto": "^1.17.19",
49
+ "@ocap/wallet": "^1.17.19",
48
50
  "axios": "^0.27.2",
49
51
  "compression": "^1.7.4",
50
52
  "cookie-parser": "^1.4.6",
@@ -56,15 +58,15 @@
56
58
  "gun": "^0.2020.1238",
57
59
  "react": "^18.2.0",
58
60
  "react-dom": "^18.2.0",
59
- "react-router-dom": "^6.3.0"
61
+ "react-router-dom": "^6.4.0"
60
62
  },
61
63
  "devDependencies": {
62
64
  "@arcblock/eslint-config": "^0.2.3",
63
65
  "@craco/craco": "^6.4.5",
64
- "eslint": "^8.23.0",
66
+ "eslint": "^8.23.1",
65
67
  "husky": "^8.0.1",
66
68
  "lint-staged": "^12.5.0",
67
- "nodemon": "^2.0.19",
69
+ "nodemon": "^2.0.20",
68
70
  "npm-run-all": "^4.1.5",
69
71
  "prettier": "^2.7.1",
70
72
  "react-scripts": "5.0.1"
@@ -11,6 +11,8 @@
11
11
  "bundle": "npm run clean && PUBLIC_URL='/.blocklet/proxy/<%= did %>' craco build && blocklet bundle --zip --create-release",
12
12
  "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
13
13
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
14
+ "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
15
+ "dev:child": "blocklet dev --component --app-did=<%= did %>",
14
16
  "prepare": "husky install"
15
17
  },
16
18
  "lint-staged": {
@@ -37,12 +39,12 @@
37
39
  "dependencies": {
38
40
  "react": "^18.2.0",
39
41
  "react-dom": "^18.2.0",
40
- "react-router-dom": "^6.3.0"
42
+ "react-router-dom": "^6.4.0"
41
43
  },
42
44
  "devDependencies": {
43
45
  "@arcblock/eslint-config": "^0.2.3",
44
46
  "@craco/craco": "^6.4.5",
45
- "eslint": "^8.23.0",
47
+ "eslint": "^8.23.1",
46
48
  "husky": "^8.0.1",
47
49
  "lint-staged": "^12.5.0",
48
50
  "prettier": "^2.7.1",