create-blocklet 0.4.81 → 0.5.1
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.
- package/README.md +4 -4
- package/{templates/docsite → common}/.editorconfig +0 -0
- package/{templates/docsite → common}/.github/workflows/main.yml +0 -0
- package/{templates/docsite → common}/.github/workflows/pr-title.yml +0 -0
- package/{templates/docsite → common}/.github/workflows/version-check.yml +0 -0
- package/{templates/express-api → common}/.husky/pre-commit +0 -0
- package/{templates/docsite → common}/.prettierrc +0 -0
- package/{templates/docsite → common}/LICENSE +0 -0
- package/{templates/docsite → common}/_gitignore +0 -0
- package/{templates/docsite → common}/_npmrc +0 -0
- package/{templates/docsite → common}/logo.png +0 -0
- package/{templates/docsite → common}/public/favicon.ico +0 -0
- package/{templates/docsite → common}/public/robots.txt +0 -0
- package/{templates/docsite → common}/screenshots/.gitkeep +0 -0
- package/{templates/express-api → common}/scripts/build-clean.js +0 -0
- package/{templates/docsite → common}/scripts/bump-version.mjs +6 -4
- package/{templates/docsite → common}/version +0 -0
- package/index.js +64 -70
- package/package.json +5 -6
- package/templates/docsite/package.json +4 -4
- package/templates/express-api/package.json +5 -5
- package/templates/html-static/package.json +3 -3
- package/templates/monorepo/package.json +1 -1
- package/templates/monorepo/scripts/bump-version.mjs +13 -17
- package/templates/nextjs-dapp/package.json +7 -7
- package/templates/react-dapp/api/dev.js +4 -0
- package/templates/react-dapp/api/index.js +10 -12
- package/templates/react-dapp/index.html +0 -1
- package/templates/react-dapp/package.json +11 -14
- package/templates/react-dapp/vite.config.js +3 -28
- package/templates/react-gun-dapp/api/dev.js +4 -0
- package/templates/react-gun-dapp/api/index.js +4 -12
- package/templates/react-gun-dapp/index.html +0 -1
- package/templates/react-gun-dapp/package.json +15 -17
- package/templates/react-gun-dapp/vite.config.js +3 -33
- package/templates/react-static/index.html +0 -1
- package/templates/react-static/package.json +8 -9
- package/templates/react-static/vite.config.js +3 -18
- package/templates/solidjs-dapp/api/dev.js +4 -0
- package/templates/solidjs-dapp/api/index.js +10 -12
- package/templates/solidjs-dapp/index.html +0 -1
- package/templates/solidjs-dapp/package.json +14 -17
- package/templates/solidjs-dapp/vite.config.js +3 -23
- package/templates/solidjs-static/index.html +0 -1
- package/templates/solidjs-static/package.json +7 -8
- package/templates/solidjs-static/vite.config.js +3 -17
- package/templates/svelte-dapp/api/dev.js +4 -0
- package/templates/svelte-dapp/api/index.js +10 -12
- package/templates/svelte-dapp/index.html +0 -1
- package/templates/svelte-dapp/package.json +13 -15
- package/templates/svelte-dapp/vite.config.js +3 -23
- package/templates/svelte-static/index.html +0 -1
- package/templates/svelte-static/package.json +6 -7
- package/templates/svelte-static/vite.config.js +3 -17
- package/templates/vue-dapp/api/dev.js +4 -0
- package/templates/vue-dapp/api/index.js +10 -12
- package/templates/vue-dapp/index.html +0 -1
- package/templates/vue-dapp/package.json +14 -17
- package/templates/vue-dapp/vite.config.js +3 -27
- package/templates/vue-static/index.html +0 -1
- package/templates/vue-static/package.json +7 -8
- package/templates/vue-static/vite.config.js +3 -17
- package/templates/vue2-dapp/.eslintrc.js +0 -3
- package/templates/vue2-dapp/api/dev.js +4 -0
- package/templates/vue2-dapp/api/index.js +10 -12
- package/templates/vue2-dapp/{public/index.html → index.html} +4 -6
- package/templates/vue2-dapp/package.json +19 -24
- package/templates/vue2-dapp/vite.config.js +10 -0
- package/templates/vue2-static/.eslintrc.js +0 -3
- package/templates/vue2-static/{public/index.html → index.html} +4 -6
- package/templates/vue2-static/package.json +13 -16
- package/templates/vue2-static/vite.config.js +10 -0
- package/templates/website/package.json +3 -3
- package/templates/docsite/scripts/build-clean.js +0 -6
- package/templates/express-api/.editorconfig +0 -23
- package/templates/express-api/.github/workflows/main.yml +0 -36
- package/templates/express-api/.github/workflows/pr-title.yml +0 -21
- package/templates/express-api/.github/workflows/version-check.yml +0 -20
- package/templates/express-api/.prettierrc +0 -9
- package/templates/express-api/LICENSE +0 -13
- package/templates/express-api/_gitignore +0 -28
- package/templates/express-api/_npmrc +0 -3
- package/templates/express-api/logo.png +0 -0
- package/templates/express-api/public/favicon.ico +0 -0
- package/templates/express-api/public/robots.txt +0 -3
- package/templates/express-api/screenshots/.gitkeep +0 -0
- package/templates/express-api/scripts/bump-version.mjs +0 -33
- package/templates/express-api/version +0 -1
- package/templates/html-static/.editorconfig +0 -23
- package/templates/html-static/.github/workflows/main.yml +0 -36
- package/templates/html-static/.github/workflows/pr-title.yml +0 -21
- package/templates/html-static/.github/workflows/version-check.yml +0 -20
- package/templates/html-static/.prettierrc +0 -9
- package/templates/html-static/LICENSE +0 -13
- package/templates/html-static/_gitignore +0 -28
- package/templates/html-static/_npmrc +0 -3
- package/templates/html-static/logo.png +0 -0
- package/templates/html-static/public/favicon.ico +0 -0
- package/templates/html-static/public/robots.txt +0 -3
- package/templates/html-static/screenshots/.gitkeep +0 -0
- package/templates/html-static/scripts/build-clean.js +0 -5
- package/templates/html-static/scripts/bump-version.mjs +0 -33
- package/templates/html-static/version +0 -1
- package/templates/nextjs-dapp/.editorconfig +0 -23
- package/templates/nextjs-dapp/.github/workflows/main.yml +0 -36
- package/templates/nextjs-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/nextjs-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/nextjs-dapp/.husky/pre-commit +0 -4
- package/templates/nextjs-dapp/.prettierrc +0 -9
- package/templates/nextjs-dapp/LICENSE +0 -13
- package/templates/nextjs-dapp/_gitignore +0 -28
- package/templates/nextjs-dapp/_npmrc +0 -3
- package/templates/nextjs-dapp/logo.png +0 -0
- package/templates/nextjs-dapp/public/favicon.ico +0 -0
- package/templates/nextjs-dapp/public/robots.txt +0 -3
- package/templates/nextjs-dapp/screenshots/.gitkeep +0 -0
- package/templates/nextjs-dapp/scripts/build-clean.js +0 -5
- package/templates/nextjs-dapp/scripts/bump-version.mjs +0 -33
- package/templates/nextjs-dapp/version +0 -1
- package/templates/react-dapp/.editorconfig +0 -23
- package/templates/react-dapp/.env +0 -2
- package/templates/react-dapp/.github/workflows/main.yml +0 -36
- package/templates/react-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/react-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/react-dapp/.husky/pre-commit +0 -4
- package/templates/react-dapp/.prettierrc +0 -9
- package/templates/react-dapp/LICENSE +0 -13
- package/templates/react-dapp/_gitignore +0 -28
- package/templates/react-dapp/_npmrc +0 -3
- package/templates/react-dapp/logo.png +0 -0
- package/templates/react-dapp/public/favicon.ico +0 -0
- package/templates/react-dapp/public/robots.txt +0 -3
- package/templates/react-dapp/screenshots/.gitkeep +0 -0
- package/templates/react-dapp/scripts/build-clean.js +0 -5
- package/templates/react-dapp/scripts/bump-version.mjs +0 -33
- package/templates/react-dapp/version +0 -1
- package/templates/react-gun-dapp/.editorconfig +0 -23
- package/templates/react-gun-dapp/.env +0 -2
- package/templates/react-gun-dapp/.github/workflows/main.yml +0 -36
- package/templates/react-gun-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/react-gun-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/react-gun-dapp/.husky/pre-commit +0 -4
- package/templates/react-gun-dapp/.prettierrc +0 -9
- package/templates/react-gun-dapp/LICENSE +0 -13
- package/templates/react-gun-dapp/_gitignore +0 -28
- package/templates/react-gun-dapp/_npmrc +0 -3
- package/templates/react-gun-dapp/logo.png +0 -0
- package/templates/react-gun-dapp/public/favicon.ico +0 -0
- package/templates/react-gun-dapp/public/robots.txt +0 -3
- package/templates/react-gun-dapp/screenshots/.gitkeep +0 -0
- package/templates/react-gun-dapp/scripts/build-clean.js +0 -5
- package/templates/react-gun-dapp/scripts/bump-version.mjs +0 -33
- package/templates/react-gun-dapp/version +0 -1
- package/templates/react-static/.editorconfig +0 -23
- package/templates/react-static/.env +0 -2
- package/templates/react-static/.github/workflows/main.yml +0 -36
- package/templates/react-static/.github/workflows/pr-title.yml +0 -21
- package/templates/react-static/.github/workflows/version-check.yml +0 -20
- package/templates/react-static/.husky/pre-commit +0 -4
- package/templates/react-static/.prettierrc +0 -9
- package/templates/react-static/LICENSE +0 -13
- package/templates/react-static/_gitignore +0 -28
- package/templates/react-static/_npmrc +0 -3
- package/templates/react-static/logo.png +0 -0
- package/templates/react-static/public/favicon.ico +0 -0
- package/templates/react-static/public/robots.txt +0 -3
- package/templates/react-static/screenshots/.gitkeep +0 -0
- package/templates/react-static/scripts/build-clean.js +0 -5
- package/templates/react-static/scripts/bump-version.mjs +0 -33
- package/templates/react-static/version +0 -1
- package/templates/solidjs-dapp/.editorconfig +0 -23
- package/templates/solidjs-dapp/.env +0 -1
- package/templates/solidjs-dapp/.github/workflows/main.yml +0 -36
- package/templates/solidjs-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/solidjs-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/solidjs-dapp/.husky/pre-commit +0 -4
- package/templates/solidjs-dapp/.prettierrc +0 -9
- package/templates/solidjs-dapp/LICENSE +0 -13
- package/templates/solidjs-dapp/_gitignore +0 -28
- package/templates/solidjs-dapp/_npmrc +0 -3
- package/templates/solidjs-dapp/logo.png +0 -0
- package/templates/solidjs-dapp/public/favicon.ico +0 -0
- package/templates/solidjs-dapp/public/robots.txt +0 -3
- package/templates/solidjs-dapp/screenshots/.gitkeep +0 -0
- package/templates/solidjs-dapp/scripts/build-clean.js +0 -5
- package/templates/solidjs-dapp/scripts/bump-version.mjs +0 -33
- package/templates/solidjs-dapp/version +0 -1
- package/templates/solidjs-static/.editorconfig +0 -23
- package/templates/solidjs-static/.env +0 -1
- package/templates/solidjs-static/.github/workflows/main.yml +0 -36
- package/templates/solidjs-static/.github/workflows/pr-title.yml +0 -21
- package/templates/solidjs-static/.github/workflows/version-check.yml +0 -20
- package/templates/solidjs-static/.husky/pre-commit +0 -4
- package/templates/solidjs-static/.prettierrc +0 -9
- package/templates/solidjs-static/LICENSE +0 -13
- package/templates/solidjs-static/_gitignore +0 -28
- package/templates/solidjs-static/_npmrc +0 -3
- package/templates/solidjs-static/logo.png +0 -0
- package/templates/solidjs-static/public/favicon.ico +0 -0
- package/templates/solidjs-static/public/robots.txt +0 -3
- package/templates/solidjs-static/screenshots/.gitkeep +0 -0
- package/templates/solidjs-static/scripts/build-clean.js +0 -5
- package/templates/solidjs-static/scripts/bump-version.mjs +0 -33
- package/templates/solidjs-static/version +0 -1
- package/templates/svelte-dapp/.editorconfig +0 -23
- package/templates/svelte-dapp/.env +0 -1
- package/templates/svelte-dapp/.github/workflows/main.yml +0 -36
- package/templates/svelte-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/svelte-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/svelte-dapp/.husky/pre-commit +0 -4
- package/templates/svelte-dapp/.prettierrc +0 -9
- package/templates/svelte-dapp/.vscode/extensions.json +0 -3
- package/templates/svelte-dapp/LICENSE +0 -13
- package/templates/svelte-dapp/_gitignore +0 -28
- package/templates/svelte-dapp/_npmrc +0 -3
- package/templates/svelte-dapp/logo.png +0 -0
- package/templates/svelte-dapp/public/favicon.ico +0 -0
- package/templates/svelte-dapp/public/robots.txt +0 -3
- package/templates/svelte-dapp/screenshots/.gitkeep +0 -0
- package/templates/svelte-dapp/scripts/build-clean.js +0 -5
- package/templates/svelte-dapp/scripts/bump-version.mjs +0 -33
- package/templates/svelte-dapp/version +0 -1
- package/templates/svelte-static/.editorconfig +0 -23
- package/templates/svelte-static/.env +0 -1
- package/templates/svelte-static/.github/workflows/main.yml +0 -36
- package/templates/svelte-static/.github/workflows/pr-title.yml +0 -21
- package/templates/svelte-static/.github/workflows/version-check.yml +0 -20
- package/templates/svelte-static/.husky/pre-commit +0 -4
- package/templates/svelte-static/.prettierrc +0 -9
- package/templates/svelte-static/.vscode/extensions.json +0 -3
- package/templates/svelte-static/LICENSE +0 -13
- package/templates/svelte-static/_gitignore +0 -28
- package/templates/svelte-static/_npmrc +0 -3
- package/templates/svelte-static/logo.png +0 -0
- package/templates/svelte-static/public/favicon.ico +0 -0
- package/templates/svelte-static/public/robots.txt +0 -3
- package/templates/svelte-static/screenshots/.gitkeep +0 -0
- package/templates/svelte-static/scripts/build-clean.js +0 -5
- package/templates/svelte-static/scripts/bump-version.mjs +0 -33
- package/templates/svelte-static/version +0 -1
- package/templates/vue-dapp/.editorconfig +0 -23
- package/templates/vue-dapp/.env +0 -1
- package/templates/vue-dapp/.github/workflows/main.yml +0 -36
- package/templates/vue-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/vue-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/vue-dapp/.husky/pre-commit +0 -4
- package/templates/vue-dapp/.prettierrc +0 -9
- package/templates/vue-dapp/LICENSE +0 -13
- package/templates/vue-dapp/_gitignore +0 -28
- package/templates/vue-dapp/_npmrc +0 -3
- package/templates/vue-dapp/logo.png +0 -0
- package/templates/vue-dapp/public/favicon.ico +0 -0
- package/templates/vue-dapp/public/robots.txt +0 -3
- package/templates/vue-dapp/screenshots/.gitkeep +0 -0
- package/templates/vue-dapp/scripts/build-clean.js +0 -5
- package/templates/vue-dapp/scripts/bump-version.mjs +0 -33
- package/templates/vue-dapp/version +0 -1
- package/templates/vue-static/.editorconfig +0 -23
- package/templates/vue-static/.env +0 -1
- package/templates/vue-static/.github/workflows/main.yml +0 -36
- package/templates/vue-static/.github/workflows/pr-title.yml +0 -21
- package/templates/vue-static/.github/workflows/version-check.yml +0 -20
- package/templates/vue-static/.husky/pre-commit +0 -4
- package/templates/vue-static/.prettierrc +0 -9
- package/templates/vue-static/LICENSE +0 -13
- package/templates/vue-static/_gitignore +0 -28
- package/templates/vue-static/_npmrc +0 -3
- package/templates/vue-static/logo.png +0 -0
- package/templates/vue-static/public/favicon.ico +0 -0
- package/templates/vue-static/public/robots.txt +0 -3
- package/templates/vue-static/screenshots/.gitkeep +0 -0
- package/templates/vue-static/scripts/build-clean.js +0 -5
- package/templates/vue-static/scripts/bump-version.mjs +0 -33
- package/templates/vue-static/version +0 -1
- package/templates/vue2-dapp/.editorconfig +0 -23
- package/templates/vue2-dapp/.env +0 -1
- package/templates/vue2-dapp/.github/workflows/main.yml +0 -36
- package/templates/vue2-dapp/.github/workflows/pr-title.yml +0 -21
- package/templates/vue2-dapp/.github/workflows/version-check.yml +0 -20
- package/templates/vue2-dapp/.husky/pre-commit +0 -4
- package/templates/vue2-dapp/.prettierrc +0 -9
- package/templates/vue2-dapp/LICENSE +0 -13
- package/templates/vue2-dapp/_gitignore +0 -28
- package/templates/vue2-dapp/_npmrc +0 -3
- package/templates/vue2-dapp/babel.config.js +0 -3
- package/templates/vue2-dapp/jsconfig.json +0 -19
- package/templates/vue2-dapp/logo.png +0 -0
- package/templates/vue2-dapp/public/favicon.ico +0 -0
- package/templates/vue2-dapp/public/robots.txt +0 -3
- package/templates/vue2-dapp/screenshots/.gitkeep +0 -0
- package/templates/vue2-dapp/scripts/build-clean.js +0 -5
- package/templates/vue2-dapp/scripts/bump-version.mjs +0 -33
- package/templates/vue2-dapp/version +0 -1
- package/templates/vue2-dapp/vue.config.js +0 -25
- package/templates/vue2-static/.editorconfig +0 -23
- package/templates/vue2-static/.env +0 -1
- package/templates/vue2-static/.github/workflows/main.yml +0 -36
- package/templates/vue2-static/.github/workflows/pr-title.yml +0 -21
- package/templates/vue2-static/.github/workflows/version-check.yml +0 -20
- package/templates/vue2-static/.husky/pre-commit +0 -4
- package/templates/vue2-static/.prettierrc +0 -9
- package/templates/vue2-static/LICENSE +0 -13
- package/templates/vue2-static/_gitignore +0 -28
- package/templates/vue2-static/_npmrc +0 -3
- package/templates/vue2-static/babel.config.js +0 -3
- package/templates/vue2-static/jsconfig.json +0 -19
- package/templates/vue2-static/logo.png +0 -0
- package/templates/vue2-static/public/favicon.ico +0 -0
- package/templates/vue2-static/public/robots.txt +0 -3
- package/templates/vue2-static/screenshots/.gitkeep +0 -0
- package/templates/vue2-static/scripts/build-clean.js +0 -5
- package/templates/vue2-static/scripts/bump-version.mjs +0 -33
- package/templates/vue2-static/version +0 -1
- package/templates/vue2-static/vue.config.js +0 -17
- package/templates/website/.editorconfig +0 -23
- package/templates/website/.github/workflows/main.yml +0 -36
- package/templates/website/.github/workflows/pr-title.yml +0 -21
- package/templates/website/.github/workflows/version-check.yml +0 -20
- package/templates/website/.prettierrc +0 -9
- package/templates/website/LICENSE +0 -13
- package/templates/website/_gitignore +0 -28
- package/templates/website/_npmrc +0 -3
- package/templates/website/logo.png +0 -0
- package/templates/website/public/favicon.ico +0 -0
- package/templates/website/public/robots.txt +0 -3
- package/templates/website/screenshots/.gitkeep +0 -0
- package/templates/website/scripts/build-clean.js +0 -6
- package/templates/website/scripts/bump-version.mjs +0 -33
- package/templates/website/version +0 -1
package/README.md
CHANGED
|
@@ -34,8 +34,8 @@ Currently supported template presets include:
|
|
|
34
34
|
**dapp**
|
|
35
35
|
|
|
36
36
|
- `react`
|
|
37
|
-
- `vue3
|
|
38
|
-
- `vue2
|
|
37
|
+
- `vue3`
|
|
38
|
+
- `vue2`
|
|
39
39
|
- `solid-js`
|
|
40
40
|
- `svelte`
|
|
41
41
|
- `next.js`
|
|
@@ -44,8 +44,8 @@ Currently supported template presets include:
|
|
|
44
44
|
**static**
|
|
45
45
|
|
|
46
46
|
- `react`
|
|
47
|
-
- `vue3
|
|
48
|
-
- `vue2
|
|
47
|
+
- `vue3`
|
|
48
|
+
- `vue2`
|
|
49
49
|
- `solid-js`
|
|
50
50
|
- `svelte`
|
|
51
51
|
- `website powered by blocklet pages`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,11 +5,15 @@ import { $, chalk, fs } from 'zx';
|
|
|
5
5
|
execSync('bumpp --no-tag --no-commit --no-push package.json', { stdio: 'inherit' });
|
|
6
6
|
|
|
7
7
|
const { version } = await fs.readJSON('package.json');
|
|
8
|
+
await fs.writeFileSync('version', version);
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
console.log(chalk.greenBright(`[info]: start to modify blocklet version to ${version}`));
|
|
11
|
+
await $`blocklet version ${version}`;
|
|
12
|
+
console.log(chalk.greenBright('[info]: blocklet version modified.'));
|
|
10
13
|
|
|
14
|
+
let newChangelog = '';
|
|
11
15
|
try {
|
|
12
|
-
const gitRes = await $`git log --pretty=format:"- %s" "
|
|
16
|
+
const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
|
|
13
17
|
newChangelog = gitRes.stdout.trim();
|
|
14
18
|
} catch {
|
|
15
19
|
console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
|
|
@@ -29,5 +33,3 @@ console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Th
|
|
|
29
33
|
process.stdin.setRawMode(true);
|
|
30
34
|
process.stdin.resume();
|
|
31
35
|
process.stdin.on('data', process.exit.bind(process, 0));
|
|
32
|
-
|
|
33
|
-
await fs.writeFileSync('version', version);
|
|
File without changes
|
package/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import { cd, argv, fs, YAML, chalk, path } from 'zx';
|
|
|
8
8
|
import ora from 'ora';
|
|
9
9
|
import prompts from 'prompts';
|
|
10
10
|
import * as envfile from 'envfile';
|
|
11
|
-
import getPort from 'get-port';
|
|
12
11
|
|
|
13
12
|
import { echoBrand, echoDocument } from './lib/arcblock.js';
|
|
14
13
|
import { getUser } from './lib/index.js';
|
|
@@ -63,11 +62,12 @@ const templates = [
|
|
|
63
62
|
display: '[dapp] next.js',
|
|
64
63
|
color: blue,
|
|
65
64
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
// 暂时不用这个模板
|
|
66
|
+
// {
|
|
67
|
+
// name: 'react-gun-dapp',
|
|
68
|
+
// display: '[dapp] react + gun.js + express.js',
|
|
69
|
+
// color: blue,
|
|
70
|
+
// },
|
|
71
71
|
{
|
|
72
72
|
name: 'react-static',
|
|
73
73
|
display: '[static] react',
|
|
@@ -80,12 +80,12 @@ const templates = [
|
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
name: 'vue-static',
|
|
83
|
-
display: '[static] vue3
|
|
83
|
+
display: '[static] vue3',
|
|
84
84
|
color: green,
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: 'vue2-static',
|
|
88
|
-
display: '[static] vue2
|
|
88
|
+
display: '[static] vue2',
|
|
89
89
|
color: green,
|
|
90
90
|
},
|
|
91
91
|
{
|
|
@@ -121,8 +121,6 @@ const renameFiles = {
|
|
|
121
121
|
_npmrc: '.npmrc',
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
const excludeFiles = ['.github', '.husky', '.vscode', '.editorconfig', '_gitignore', '_npmrc', 'version']
|
|
125
|
-
|
|
126
124
|
async function init() {
|
|
127
125
|
const { version } = await fs.readJSONSync(path.resolve(__dirname, 'package.json'));
|
|
128
126
|
await echoBrand({ version });
|
|
@@ -155,7 +153,8 @@ async function init() {
|
|
|
155
153
|
type: () => (!fs.existsSync(targetDir) || isEmpty(targetDir) ? null : 'confirm'),
|
|
156
154
|
name: 'overwrite',
|
|
157
155
|
message: () =>
|
|
158
|
-
`${
|
|
156
|
+
`${
|
|
157
|
+
targetDir === '.' ? 'Current directory' : `Target directory "${targetDir}"`
|
|
159
158
|
} is not empty. Remove existing files and continue?`,
|
|
160
159
|
},
|
|
161
160
|
{
|
|
@@ -177,38 +176,38 @@ async function init() {
|
|
|
177
176
|
...(inputTemplateName
|
|
178
177
|
? []
|
|
179
178
|
: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
title: templateColor(template.display),
|
|
188
|
-
value: template.name,
|
|
189
|
-
};
|
|
190
|
-
}),
|
|
191
|
-
min: 1,
|
|
192
|
-
suggest: (input, choices) => Promise.resolve(choices.filter((i) => i.title.includes(input))),
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
type: (templateNames = []) => {
|
|
196
|
-
return templateNames.length > 1 ? 'select' : null;
|
|
197
|
-
},
|
|
198
|
-
name: 'mainBlocklet',
|
|
199
|
-
message: 'Please choose the main blocklet',
|
|
200
|
-
//
|
|
201
|
-
choices: (templateNames = []) =>
|
|
202
|
-
templateNames.map((templateName) => {
|
|
203
|
-
const template = templates.find((x) => x.name === templateName);
|
|
179
|
+
{
|
|
180
|
+
type: 'autocompleteMultiselect',
|
|
181
|
+
name: 'templateNames',
|
|
182
|
+
message: 'Choose one or more blocklet templates:',
|
|
183
|
+
choices: templates.map((template) => {
|
|
184
|
+
const templateColor = template.color;
|
|
204
185
|
return {
|
|
205
|
-
title: template.display,
|
|
186
|
+
title: templateColor(template.display),
|
|
206
187
|
value: template.name,
|
|
207
188
|
};
|
|
208
189
|
}),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
190
|
+
min: 1,
|
|
191
|
+
suggest: (input, choices) => Promise.resolve(choices.filter((i) => i.title.includes(input))),
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: (templateNames = []) => {
|
|
195
|
+
return templateNames.length > 1 ? 'select' : null;
|
|
196
|
+
},
|
|
197
|
+
name: 'mainBlocklet',
|
|
198
|
+
message: 'Please choose the main blocklet',
|
|
199
|
+
//
|
|
200
|
+
choices: (templateNames = []) =>
|
|
201
|
+
templateNames.map((templateName) => {
|
|
202
|
+
const template = templates.find((x) => x.name === templateName);
|
|
203
|
+
return {
|
|
204
|
+
title: template.display,
|
|
205
|
+
value: template.name,
|
|
206
|
+
};
|
|
207
|
+
}),
|
|
208
|
+
initial: 1,
|
|
209
|
+
},
|
|
210
|
+
]),
|
|
212
211
|
{
|
|
213
212
|
type: 'text',
|
|
214
213
|
name: 'authorName',
|
|
@@ -285,19 +284,38 @@ async function init() {
|
|
|
285
284
|
for (const templateName of templateNames) {
|
|
286
285
|
const templateDir = path.join(__dirname, `templates/${templateName}`);
|
|
287
286
|
const finalTemplateName = `${name}-${templateName}`;
|
|
287
|
+
// TODO: 需要把 common file copy 的逻辑移除,不同的 template 之间的差异越来越多,就会需要越来越多特殊处理的代码,违背了初衷,移除这部分逻辑可能是更好的选择
|
|
288
|
+
// copy common files
|
|
289
|
+
(() => {
|
|
290
|
+
const commonDir = path.join(__dirname, 'common');
|
|
291
|
+
const commonFiles = fs.readdirSync(commonDir);
|
|
292
|
+
for (const file of commonFiles) {
|
|
293
|
+
// 如果选择多个模板,每个子 package 中 只会包含必要的 文件
|
|
294
|
+
if (mainBlocklet && !['screenshots', 'public', 'logo.png', '.prettierrc', 'LICENSE'].includes(file)) {
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
// html-staic 和 xmark 相关的模板不添加 .husky
|
|
298
|
+
if (fuzzyQuery(['html-static', 'website', 'docsite'], templateName) && ['.husky'].includes(file)) {
|
|
299
|
+
// eslint-disable-next-line no-continue
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
const targetPath = renameFiles[file]
|
|
303
|
+
? path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', renameFiles[file])
|
|
304
|
+
: path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', file);
|
|
305
|
+
|
|
306
|
+
copy(path.join(commonDir, file), targetPath);
|
|
307
|
+
}
|
|
308
|
+
})();
|
|
288
309
|
// copy template files
|
|
289
310
|
(() => {
|
|
290
311
|
// 过滤掉 template-info.json 文件
|
|
291
312
|
let files = fs.readdirSync(templateDir).filter((file) => file !== 'template-info.json');
|
|
292
|
-
// 如果选择了多个模板,每个子 package 中应该过滤掉一些文件
|
|
293
|
-
if (mainBlocklet) {
|
|
294
|
-
files = files.filter((file) => !fuzzyQuery(excludeFiles, file));
|
|
295
|
-
}
|
|
296
313
|
for (const file of files) {
|
|
297
314
|
write(file, null, templateDir, templateName);
|
|
298
315
|
}
|
|
316
|
+
// 如果选择了多个模板,每个子 package 中的 bump-version.mjs 文件
|
|
299
317
|
if (mainBlocklet) {
|
|
300
|
-
fs.removeSync(path.join(root, `blocklets/${templateName}`, 'scripts/bump-version.mjs'))
|
|
318
|
+
fs.removeSync(path.join(root, `blocklets/${templateName}`, 'scripts/bump-version.mjs'));
|
|
301
319
|
}
|
|
302
320
|
})();
|
|
303
321
|
|
|
@@ -317,30 +335,6 @@ async function init() {
|
|
|
317
335
|
templateName
|
|
318
336
|
);
|
|
319
337
|
|
|
320
|
-
let randomPort;
|
|
321
|
-
if (fuzzyQuery(['dapp'], templateName)) {
|
|
322
|
-
randomPort = await getPort();
|
|
323
|
-
}
|
|
324
|
-
modifyEnv(
|
|
325
|
-
(env) => {
|
|
326
|
-
if (randomPort) {
|
|
327
|
-
env.API_PORT = randomPort;
|
|
328
|
-
}
|
|
329
|
-
if (!fuzzyQuery(['website'], templateName)) {
|
|
330
|
-
if (fuzzyQuery(['react'], templateName)) {
|
|
331
|
-
env.REACT_APP_TITLE = finalTemplateName;
|
|
332
|
-
} else if (fuzzyQuery(['vue', 'website'], templateName)) {
|
|
333
|
-
env.VITE_APP_TITLE = finalTemplateName;
|
|
334
|
-
} else {
|
|
335
|
-
env.APP_TITLE = finalTemplateName;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
return env;
|
|
339
|
-
},
|
|
340
|
-
templateDir,
|
|
341
|
-
templateName
|
|
342
|
-
);
|
|
343
|
-
|
|
344
338
|
// patch blocklet author
|
|
345
339
|
modifyBlockletYaml(
|
|
346
340
|
async (yamlConfig) => {
|
|
@@ -535,13 +529,13 @@ async function init() {
|
|
|
535
529
|
return null;
|
|
536
530
|
}
|
|
537
531
|
|
|
538
|
-
function modifyPackage(modifyFn = () => {
|
|
532
|
+
function modifyPackage(modifyFn = () => {}, templateDir, templateName) {
|
|
539
533
|
const pkg = JSON.parse(read('package.json', templateName));
|
|
540
534
|
modifyFn(pkg);
|
|
541
535
|
write('package.json', JSON.stringify(pkg, null, 2), templateDir, templateName);
|
|
542
536
|
}
|
|
543
537
|
|
|
544
|
-
function modifyBlockletYaml(modifyFn = () => {
|
|
538
|
+
function modifyBlockletYaml(modifyFn = () => {}, templateDir, templateName) {
|
|
545
539
|
const blockletYaml = read('blocklet.yml', templateName);
|
|
546
540
|
const yamlConfig = YAML.parse(blockletYaml);
|
|
547
541
|
modifyFn(yamlConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-blocklet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"exports": "./index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "git@github.com:blocklet/create-blocklet.git",
|
|
@@ -29,14 +29,13 @@
|
|
|
29
29
|
"test:run": "vitest run"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@arcblock/did": "^1.
|
|
33
|
-
"@ocap/mcrypto": "^1.
|
|
34
|
-
"@ocap/util": "^1.
|
|
32
|
+
"@arcblock/did": "^1.18.6",
|
|
33
|
+
"@ocap/mcrypto": "^1.18.6",
|
|
34
|
+
"@ocap/util": "^1.18.6",
|
|
35
35
|
"boxen": "^6.2.1",
|
|
36
36
|
"ejs": "^3.1.8",
|
|
37
37
|
"envfile": "^6.18.0",
|
|
38
38
|
"figlet": "^1.5.2",
|
|
39
|
-
"get-port": "^6.1.2",
|
|
40
39
|
"gradient-string": "^2.0.2",
|
|
41
40
|
"jdenticon": "^3.2.0",
|
|
42
41
|
"ora": "^6.1.2",
|
|
@@ -47,7 +46,7 @@
|
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@arcblock/eslint-config-base": "0.2.2",
|
|
50
|
-
"eslint": "^8.
|
|
49
|
+
"eslint": "^8.26.0",
|
|
51
50
|
"prettier": "^2.7.1",
|
|
52
51
|
"vitest": "^0.19.1"
|
|
53
52
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"bump-version": "zx scripts/bump-version.mjs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@xmark/cli": "^2.4.
|
|
19
|
-
"@xmark/theme-docs": "^2.4.
|
|
20
|
-
"
|
|
18
|
+
"@xmark/cli": "^2.4.85",
|
|
19
|
+
"@xmark/theme-docs": "^2.4.85",
|
|
20
|
+
"bumpp": "^8.2.1",
|
|
21
21
|
"rimraf": "^3.0.2",
|
|
22
|
-
"
|
|
22
|
+
"zx": "^7.1.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
34
|
-
"@blocklet/sdk": "^1.8.
|
|
35
|
-
"@ocap/client": "^1.
|
|
34
|
+
"@blocklet/sdk": "^1.8.33",
|
|
35
|
+
"@ocap/client": "^1.18.6",
|
|
36
36
|
"dotenv-flow": "^3.2.0",
|
|
37
37
|
"express": "^4.18.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@arcblock/eslint-config-base": "^0.2.3",
|
|
41
|
-
"
|
|
41
|
+
"bumpp": "^8.2.1",
|
|
42
|
+
"eslint": "^8.26.0",
|
|
42
43
|
"husky": "^8.0.1",
|
|
43
44
|
"lint-staged": "^12.5.0",
|
|
44
45
|
"nodemon": "^2.0.20",
|
|
45
46
|
"prettier": "^2.7.1",
|
|
46
|
-
"zx": "^7.1.1",
|
|
47
47
|
"rimraf": "^3.0.2",
|
|
48
|
-
"
|
|
48
|
+
"zx": "^7.1.1"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dev": "blocklet dev",
|
|
6
6
|
"clean": "node scripts/build-clean.js",
|
|
7
7
|
"bundle": "npm run clean && blocklet bundle --zip --create-release",
|
|
8
|
-
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle
|
|
8
|
+
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
9
9
|
"deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
|
|
10
10
|
"dev:child": "blocklet dev --component --app-did=<%= did %>",
|
|
11
11
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"author": "",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"
|
|
18
|
+
"bumpp": "^8.2.1",
|
|
19
19
|
"rimraf": "^3.0.2",
|
|
20
|
-
"
|
|
20
|
+
"zx": "^7.1.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
|
-
import { $, chalk, fs, path
|
|
3
|
+
import { $, chalk, fs, path } from 'zx';
|
|
4
|
+
|
|
5
|
+
const cwd = process.cwd(); // 获取脚本执行目录
|
|
4
6
|
|
|
5
7
|
// or use pnpm to bump version: `pnpm -r --filter {packages/*, themes/*} -- pnpm version`
|
|
6
8
|
execSync('bumpp package.json blocklets/*/package.json', { stdio: 'inherit' });
|
|
7
9
|
|
|
8
10
|
const { version } = await fs.readJSON('package.json');
|
|
11
|
+
await fs.writeFileSync('version', version);
|
|
9
12
|
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
yamlConfig.version = version;
|
|
19
|
-
fs.writeFileSync(ymlPath, YAML.stringify(yamlConfig, 2));
|
|
20
|
-
}
|
|
21
|
-
console.log(chalk.greenBright('[info]: all blocklets version modified.'));
|
|
22
|
-
})();
|
|
13
|
+
console.log(chalk.greenBright(`[info]: start to modify blocklets version to ${version}`));
|
|
14
|
+
const dirPath = path.join(__dirname, '../blocklets');
|
|
15
|
+
let pathList = await fs.readdirSync(dirPath);
|
|
16
|
+
pathList = pathList.map((item) => `${dirPath}/${item}`);
|
|
17
|
+
for (const ymlDir of pathList) {
|
|
18
|
+
await $`cd ${ymlDir} && blocklet version ${version}`;
|
|
19
|
+
}
|
|
20
|
+
console.log(chalk.greenBright('[info]: all blocklets version modified.'));
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
await $`cd ${cwd}`;
|
|
25
23
|
|
|
26
24
|
let newChangelog = '';
|
|
27
25
|
|
|
@@ -47,5 +45,3 @@ console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Th
|
|
|
47
45
|
process.stdin.setRawMode(true);
|
|
48
46
|
process.stdin.resume();
|
|
49
47
|
process.stdin.on('data', process.exit.bind(process, 0));
|
|
50
|
-
|
|
51
|
-
await fs.writeFileSync('version', version);
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@arcblock/did-auth": "^1.
|
|
31
|
+
"@arcblock/did-auth": "^1.18.6",
|
|
32
32
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
33
|
-
"@blocklet/sdk": "^1.8.
|
|
34
|
-
"@ocap/client": "^1.
|
|
35
|
-
"@ocap/mcrypto": "^1.
|
|
36
|
-
"@ocap/wallet": "^1.
|
|
33
|
+
"@blocklet/sdk": "^1.8.33",
|
|
34
|
+
"@ocap/client": "^1.18.6",
|
|
35
|
+
"@ocap/mcrypto": "^1.18.6",
|
|
36
|
+
"@ocap/wallet": "^1.18.6",
|
|
37
37
|
"dotenv-flow": "^3.2.0",
|
|
38
38
|
"express": "^4.18.2",
|
|
39
39
|
"next": "12.2.3",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"react-dom": "18.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"bumpp": "^8.2.1",
|
|
44
45
|
"eslint": "8.20.0",
|
|
45
46
|
"eslint-config-next": "12.2.3",
|
|
46
47
|
"husky": "^8.0.1",
|
|
47
48
|
"lint-staged": "^12.5.0",
|
|
48
49
|
"nodemon": "^2.0.20",
|
|
49
50
|
"npm-run-all": "^4.1.5",
|
|
50
|
-
"zx": "^7.1.1",
|
|
51
51
|
"rimraf": "^3.0.2",
|
|
52
|
-
"
|
|
52
|
+
"zx": "^7.1.1"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -16,36 +16,34 @@ app.set('trust proxy', true);
|
|
|
16
16
|
app.use(cookieParser());
|
|
17
17
|
app.use(express.json({ limit: '1 mb' }));
|
|
18
18
|
app.use(express.urlencoded({ extended: true, limit: '1 mb' }));
|
|
19
|
+
app.use(cors());
|
|
19
20
|
|
|
20
21
|
const router = express.Router();
|
|
21
22
|
router.use('/api', require('./routes'));
|
|
23
|
+
app.use(router);
|
|
22
24
|
|
|
23
|
-
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
24
25
|
const isProduction = process.env.NODE_ENV === 'production' || process.env.ABT_NODE_SERVICE_ENV === 'production';
|
|
25
26
|
|
|
26
27
|
if (isProduction) {
|
|
27
|
-
|
|
28
|
+
const staticDir = path.resolve(__dirname, '../dist');
|
|
28
29
|
app.use(compression());
|
|
29
|
-
|
|
30
|
-
const staticDir = path.resolve(process.env.BLOCKLET_APP_DIR, 'dist');
|
|
31
30
|
app.use(express.static(staticDir, { maxAge: '30d', index: false }));
|
|
32
|
-
app.use(router);
|
|
33
31
|
app.use(fallback('index.html', { root: staticDir }));
|
|
34
32
|
|
|
35
|
-
app.use((req, res) => {
|
|
36
|
-
res.status(404).send('404 NOT FOUND');
|
|
37
|
-
});
|
|
38
33
|
app.use((err, req, res) => {
|
|
39
34
|
logger.error(err.stack);
|
|
40
35
|
res.status(500).send('Something broke!');
|
|
41
36
|
});
|
|
42
|
-
} else {
|
|
43
|
-
app.use(router);
|
|
44
37
|
}
|
|
45
38
|
|
|
46
|
-
const port =
|
|
39
|
+
const port = parseInt(process.env.BLOCKLET_PORT, 10);
|
|
47
40
|
|
|
48
|
-
app.listen(port, (err) => {
|
|
41
|
+
const server = app.listen(port, (err) => {
|
|
49
42
|
if (err) throw err;
|
|
50
43
|
logger.info(`> ${name} v${version} ready on ${port}`);
|
|
51
44
|
});
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
app,
|
|
48
|
+
server,
|
|
49
|
+
};
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
7
7
|
<meta name="theme-color" content="#4F6AF5" />
|
|
8
8
|
<meta name="description" content="Web site created using create-blocklet" />
|
|
9
|
-
<title><%- title %></title>
|
|
10
9
|
</head>
|
|
11
10
|
<body>
|
|
12
11
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
"eject": "vite eject",
|
|
7
7
|
"lint": "eslint src api --ext .mjs,.js,.jsx,.ts,.tsx",
|
|
8
8
|
"lint:fix": "npm run lint -- --fix",
|
|
9
|
-
"start": "
|
|
10
|
-
"start:client": "vite --host",
|
|
11
|
-
"start:api": "cross-env NODE_ENV=development nodemon api/index.js -w api",
|
|
9
|
+
"start": "cross-env NODE_ENV=development nodemon api/dev.js -w api",
|
|
12
10
|
"clean": "node scripts/build-clean.js",
|
|
13
11
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
14
12
|
"bundle:client": "vite build",
|
|
@@ -42,12 +40,12 @@
|
|
|
42
40
|
]
|
|
43
41
|
},
|
|
44
42
|
"dependencies": {
|
|
45
|
-
"@arcblock/did-auth": "^1.
|
|
43
|
+
"@arcblock/did-auth": "^1.18.6",
|
|
46
44
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
47
|
-
"@blocklet/sdk": "^1.8.
|
|
48
|
-
"@ocap/client": "^1.
|
|
49
|
-
"@ocap/mcrypto": "^1.
|
|
50
|
-
"@ocap/wallet": "^1.
|
|
45
|
+
"@blocklet/sdk": "^1.8.33",
|
|
46
|
+
"@ocap/client": "^1.18.6",
|
|
47
|
+
"@ocap/mcrypto": "^1.18.6",
|
|
48
|
+
"@ocap/wallet": "^1.18.6",
|
|
51
49
|
"axios": "^0.27.2",
|
|
52
50
|
"compression": "^1.7.4",
|
|
53
51
|
"cookie-parser": "^1.4.6",
|
|
@@ -58,24 +56,23 @@
|
|
|
58
56
|
"express-history-api-fallback": "^2.2.1",
|
|
59
57
|
"react": "^18.2.0",
|
|
60
58
|
"react-dom": "^18.2.0",
|
|
61
|
-
"react-router-dom": "^6.4.
|
|
59
|
+
"react-router-dom": "^6.4.3",
|
|
62
60
|
"rimraf": "^3.0.2"
|
|
63
61
|
},
|
|
64
62
|
"devDependencies": {
|
|
65
63
|
"@arcblock/eslint-config": "^0.2.3",
|
|
66
|
-
"@vitejs/plugin-react": "^2.
|
|
64
|
+
"@vitejs/plugin-react": "^2.2.0",
|
|
67
65
|
"bumpp": "^8.2.1",
|
|
68
66
|
"cross-env": "^7.0.3",
|
|
69
|
-
"eslint": "^8.
|
|
67
|
+
"eslint": "^8.26.0",
|
|
70
68
|
"husky": "^8.0.1",
|
|
71
69
|
"lint-staged": "^12.5.0",
|
|
72
70
|
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
73
71
|
"nodemon": "^2.0.20",
|
|
74
72
|
"npm-run-all": "^4.1.5",
|
|
75
73
|
"prettier": "^2.7.1",
|
|
76
|
-
"vite": "^3.
|
|
77
|
-
"vite-plugin-blocklet": "^0.
|
|
78
|
-
"vite-plugin-html": "^3.2.0",
|
|
74
|
+
"vite": "^3.2.2",
|
|
75
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
79
76
|
"vite-plugin-svgr": "^2.2.2",
|
|
80
77
|
"zx": "^7.1.1"
|
|
81
78
|
}
|
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
import { defineConfig
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
2
|
import react from '@vitejs/plugin-react';
|
|
3
|
-
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
3
|
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
4
|
import svgr from 'vite-plugin-svgr';
|
|
6
5
|
|
|
7
6
|
// https://vitejs.dev/config/
|
|
8
|
-
export default defineConfig(
|
|
9
|
-
const envMap = loadEnv(mode, process.cwd(), '');
|
|
10
|
-
const apiPort = envMap.API_PORT || 3030;
|
|
11
|
-
const apiPrefix = `${process.env.BLOCKLET_DEV_MOUNT_POINT || ''}/api`;
|
|
12
|
-
|
|
7
|
+
export default defineConfig(() => {
|
|
13
8
|
return {
|
|
14
|
-
plugins: [
|
|
15
|
-
react(),
|
|
16
|
-
createHtmlPlugin({
|
|
17
|
-
minify: true,
|
|
18
|
-
inject: {
|
|
19
|
-
data: {
|
|
20
|
-
title: envMap.APP_TITLE,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
}),
|
|
24
|
-
createBlockletPlugin(),
|
|
25
|
-
svgr(),
|
|
26
|
-
],
|
|
27
|
-
server: {
|
|
28
|
-
proxy: {
|
|
29
|
-
[apiPrefix]: {
|
|
30
|
-
target: `http://127.0.0.1:${apiPort}`,
|
|
31
|
-
rewrite: (path) => path.replace(apiPrefix, '/api'), // rewrite path when blocklet dev
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
9
|
+
plugins: [react(), createBlockletPlugin(), svgr()],
|
|
35
10
|
};
|
|
36
11
|
});
|