create-blocklet 0.7.9 → 0.8.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/common/.github/workflows/main.yml +10 -7
- package/common/.prettierrc +1 -1
- package/common/LICENSE +1 -1
- package/common/_gitignore +1 -0
- package/common/_npmrc +0 -2
- package/common/scripts/build-clean.mjs +7 -0
- package/index.js +40 -32
- package/lib/arcblock.js +1 -1
- package/lib/constant.js +1 -0
- package/lib/did.js +2 -1
- package/lib/git.js +21 -21
- package/lib/server.js +10 -10
- package/lib/utils.js +2 -1
- package/package.json +16 -16
- package/templates/express-api/README.md +3 -3
- package/templates/express-api/api/hooks/pre-start.js +2 -1
- package/templates/express-api/api/index.js +1 -12
- package/templates/express-api/blocklet.yml +1 -1
- package/templates/express-api/package.json +20 -17
- package/templates/express-api/template-info.json +6 -3
- package/templates/html-static/README.md +3 -3
- package/templates/html-static/app/index.html +35 -36
- package/templates/html-static/app/styles/style.css +9 -1
- package/templates/html-static/blocklet.yml +1 -1
- package/templates/html-static/package.json +6 -5
- package/templates/html-static/template-info.json +2 -2
- package/templates/monorepo/.prettierrc +1 -1
- package/templates/monorepo/README.md +2 -2
- package/templates/monorepo/package.json +21 -13
- package/templates/monorepo/scripts/bump-version.mjs +1 -1
- package/templates/nestjs-api/.eslintrc.js +27 -3
- package/templates/nestjs-api/README.md +3 -3
- package/templates/nestjs-api/api/app.controller.ts +3 -1
- package/templates/nestjs-api/api/app.service.ts +1 -16
- package/templates/nestjs-api/api/hooks/pre-start.js +2 -1
- package/templates/nestjs-api/blocklet.yml +1 -1
- package/templates/nestjs-api/package.json +29 -26
- package/templates/nestjs-api/template-info.json +4 -1
- package/templates/nestjs-api/tsconfig.build.json +6 -1
- package/templates/nestjs-api/tsconfig.eslint.json +7 -0
- package/templates/nextjs-dapp/README.md +3 -3
- package/templates/nextjs-dapp/api/hooks/pre-start.js +2 -1
- package/templates/nextjs-dapp/blocklet.yml +1 -1
- package/templates/nextjs-dapp/package.json +23 -20
- package/templates/nextjs-dapp/pages/_app.js +1 -1
- package/templates/nextjs-dapp/pages/api/hello.js +1 -1
- package/templates/nextjs-dapp/pages/index.js +9 -17
- package/templates/nextjs-dapp/styles/Home.module.css +12 -3
- package/templates/nextjs-dapp/styles/globals.css +12 -2
- package/templates/nextjs-dapp/template-info.json +2 -2
- package/templates/react-dapp/README.md +3 -3
- package/templates/react-dapp/api/hooks/pre-start.js +2 -1
- package/templates/react-dapp/api/index.js +1 -0
- package/templates/react-dapp/api/routes/index.js +6 -0
- package/templates/react-dapp/blocklet.yml +1 -1
- package/templates/react-dapp/index.html +14 -11
- package/templates/react-dapp/package.json +32 -28
- package/templates/react-dapp/src/app.jsx +1 -5
- package/templates/react-dapp/src/assets/blocklet.svg +16 -0
- package/templates/react-dapp/src/assets/react.svg +1 -0
- package/templates/react-dapp/src/assets/vite.svg +1 -0
- package/templates/react-dapp/src/index.css +68 -0
- package/templates/react-dapp/src/index.jsx +1 -0
- package/templates/react-dapp/src/libs/api.js +5 -12
- package/templates/react-dapp/src/pages/home.css +45 -0
- package/templates/react-dapp/src/pages/home.jsx +42 -15
- package/templates/react-dapp/template-info.json +2 -2
- package/templates/react-dapp-ts/.eslintrc.js +3 -0
- package/templates/react-dapp-ts/README.md +3 -3
- package/templates/react-dapp-ts/api/src/hooks/pre-start.ts +2 -2
- package/templates/react-dapp-ts/api/src/routes/index.ts +6 -0
- package/templates/react-dapp-ts/blocklet.yml +1 -1
- package/templates/react-dapp-ts/index.html +14 -11
- package/templates/react-dapp-ts/package.json +38 -34
- package/templates/react-dapp-ts/src/app.tsx +1 -6
- package/templates/react-dapp-ts/src/assets/blocklet.svg +16 -0
- package/templates/react-dapp-ts/src/assets/react.svg +1 -0
- package/templates/react-dapp-ts/src/assets/vite.svg +1 -0
- package/templates/react-dapp-ts/src/index.css +68 -0
- package/templates/react-dapp-ts/src/index.tsx +2 -2
- package/templates/react-dapp-ts/src/libs/api.ts +5 -12
- package/templates/react-dapp-ts/src/pages/home.css +45 -0
- package/templates/react-dapp-ts/src/pages/home.tsx +42 -15
- package/templates/react-dapp-ts/tsconfig.api.json +4 -1
- package/templates/react-dapp-ts/tsconfig.eslint.json +3 -1
- package/templates/react-gun-dapp/README.md +3 -3
- package/templates/react-gun-dapp/api/hooks/pre-start.js +2 -1
- package/templates/react-gun-dapp/api/index.js +1 -0
- package/templates/react-gun-dapp/blocklet.yml +1 -1
- package/templates/react-gun-dapp/index.html +14 -11
- package/templates/react-gun-dapp/package.json +31 -28
- package/templates/react-gun-dapp/src/app.jsx +1 -1
- package/templates/react-gun-dapp/src/libs/api.js +1 -1
- package/templates/react-gun-dapp/src/pages/about.jsx +5 -1
- package/templates/react-gun-dapp/src/pages/home.jsx +5 -1
- package/templates/react-static/README.md +3 -3
- package/templates/react-static/blocklet.yml +1 -1
- package/templates/react-static/index.html +14 -11
- package/templates/react-static/package.json +20 -18
- package/templates/react-static/src/app.jsx +1 -5
- package/templates/react-static/src/assets/blocklet.svg +16 -0
- package/templates/react-static/src/assets/react.svg +1 -0
- package/templates/react-static/src/assets/vite.svg +1 -0
- package/templates/react-static/src/index.css +68 -0
- package/templates/react-static/src/index.jsx +1 -0
- package/templates/react-static/src/pages/home.css +45 -0
- package/templates/react-static/src/pages/home.jsx +30 -15
- package/templates/react-static/template-info.json +6 -3
- package/templates/solidjs-dapp/.eslintrc.js +2 -1
- package/templates/solidjs-dapp/README.md +3 -3
- package/templates/solidjs-dapp/api/hooks/pre-start.js +2 -1
- package/templates/solidjs-dapp/api/index.js +1 -0
- package/templates/solidjs-dapp/api/routes/index.js +6 -0
- package/templates/solidjs-dapp/blocklet.yml +4 -2
- package/templates/solidjs-dapp/index.html +15 -12
- package/templates/solidjs-dapp/package.json +34 -30
- package/templates/solidjs-dapp/src/App.jsx +15 -3
- package/templates/solidjs-dapp/src/App.module.css +7 -1
- package/templates/solidjs-dapp/src/assets/blocklet.svg +16 -0
- package/templates/{solidjs-static/src/logo.svg → solidjs-dapp/src/assets/solidjs.svg} +1 -1
- package/templates/solidjs-dapp/src/index.css +21 -5
- package/templates/solidjs-dapp/src/libs/api.js +7 -0
- package/templates/solidjs-dapp/template-info.json +2 -2
- package/templates/solidjs-static/.eslintrc.js +4 -0
- package/templates/solidjs-static/README.md +3 -3
- package/templates/solidjs-static/blocklet.yml +1 -1
- package/templates/solidjs-static/index.html +15 -12
- package/templates/solidjs-static/package.json +22 -21
- package/templates/solidjs-static/src/App.jsx +7 -3
- package/templates/solidjs-static/src/App.module.css +7 -1
- package/templates/solidjs-static/src/assets/blocklet.svg +16 -0
- package/templates/solidjs-static/src/index.css +3 -5
- package/templates/solidjs-static/template-info.json +2 -2
- package/templates/svelte-dapp/README.md +3 -4
- package/templates/svelte-dapp/api/hooks/pre-start.js +2 -1
- package/templates/svelte-dapp/api/index.js +1 -0
- package/templates/svelte-dapp/api/routes/index.js +6 -0
- package/templates/svelte-dapp/blocklet.yml +1 -1
- package/templates/svelte-dapp/index.html +13 -10
- package/templates/svelte-dapp/jsconfig.json +9 -7
- package/templates/svelte-dapp/package.json +29 -29
- package/templates/svelte-dapp/src/App.svelte +45 -42
- package/templates/svelte-dapp/src/app.css +79 -0
- package/templates/svelte-dapp/src/assets/blocklet.svg +16 -0
- package/templates/svelte-dapp/src/assets/svelte.svg +1 -0
- package/templates/svelte-dapp/src/assets/vite.svg +1 -0
- package/templates/svelte-dapp/src/components/Counter.svelte +10 -0
- package/templates/svelte-dapp/src/libs/api.js +7 -0
- package/templates/svelte-dapp/src/main.js +1 -0
- package/templates/svelte-dapp/template-info.json +2 -2
- package/templates/svelte-dapp/vite.config.mjs +6 -1
- package/templates/svelte-static/README.md +3 -4
- package/templates/svelte-static/blocklet.yml +1 -1
- package/templates/svelte-static/index.html +13 -10
- package/templates/svelte-static/jsconfig.json +9 -7
- package/templates/svelte-static/package.json +18 -22
- package/templates/svelte-static/src/App.svelte +36 -43
- package/templates/svelte-static/src/app.css +79 -0
- package/templates/svelte-static/src/assets/blocklet.svg +16 -0
- package/templates/svelte-static/src/assets/svelte.svg +1 -0
- package/templates/svelte-static/src/assets/vite.svg +1 -0
- package/templates/svelte-static/src/components/Counter.svelte +10 -0
- package/templates/svelte-static/src/main.js +1 -0
- package/templates/svelte-static/template-info.json +6 -3
- package/templates/svelte-static/vite.config.mjs +6 -1
- package/templates/todo-list-example/.eslintrc.js +1 -1
- package/templates/todo-list-example/api/src/hooks/pre-start.ts +2 -1
- package/templates/todo-list-example/api/src/routes/todo-list/$get.ts +1 -1
- package/templates/todo-list-example/api/src/routes/todo-list/$put.ts +1 -1
- package/templates/todo-list-example/blocklet.yml +7 -5
- package/templates/todo-list-example/index.html +14 -11
- package/templates/todo-list-example/package.json +44 -41
- package/templates/todo-list-example/src/components/layout.tsx +1 -1
- package/templates/todo-list-example/src/libs/api.ts +5 -12
- package/templates/todo-list-example/src/logo.svg +1 -1
- package/templates/todo-list-example/src/pages/required-login.tsx +3 -6
- package/templates/todo-list-example/src/pages/todo-list.css +72 -68
- package/templates/todo-list-example/src/pages/todo-list.tsx +32 -32
- package/templates/todo-list-example/template-info.json +1 -1
- package/templates/todo-list-example/tsconfig.api.json +4 -1
- package/templates/todo-list-example/tsconfig.eslint.json +3 -1
- package/templates/vue-dapp/README.md +3 -3
- package/templates/vue-dapp/api/hooks/pre-start.js +2 -1
- package/templates/vue-dapp/api/index.js +1 -0
- package/templates/vue-dapp/api/routes/index.js +6 -0
- package/templates/vue-dapp/blocklet.yml +1 -1
- package/templates/vue-dapp/index.html +14 -11
- package/templates/vue-dapp/package.json +32 -28
- package/templates/vue-dapp/src/App.vue +26 -19
- package/templates/vue-dapp/src/assets/blocklet.svg +16 -0
- package/templates/vue-dapp/src/assets/vite.svg +1 -0
- package/templates/vue-dapp/src/assets/vue.svg +1 -0
- package/templates/vue-dapp/src/components/HelloWorld.vue +25 -15
- package/templates/vue-dapp/src/libs/api.js +5 -12
- package/templates/vue-dapp/src/main.js +1 -0
- package/templates/vue-dapp/src/style.css +79 -0
- package/templates/vue-dapp/template-info.json +2 -2
- package/templates/vue-static/README.md +3 -3
- package/templates/vue-static/blocklet.yml +1 -1
- package/templates/vue-static/index.html +14 -11
- package/templates/vue-static/package.json +20 -19
- package/templates/vue-static/src/App.vue +27 -12
- package/templates/vue-static/src/assets/blocklet.svg +16 -0
- package/templates/vue-static/src/assets/vite.svg +1 -0
- package/templates/vue-static/src/assets/vue.svg +1 -0
- package/templates/vue-static/src/components/HelloWorld.vue +15 -15
- package/templates/vue-static/src/main.js +1 -0
- package/templates/vue-static/src/style.css +79 -0
- package/templates/vue-static/template-info.json +6 -3
- package/templates/vue2-dapp/README.md +3 -3
- package/templates/vue2-dapp/api/hooks/pre-start.js +2 -1
- package/templates/vue2-dapp/api/index.js +1 -0
- package/templates/vue2-dapp/blocklet.yml +1 -1
- package/templates/vue2-dapp/index.html +14 -11
- package/templates/vue2-dapp/package.json +30 -27
- package/templates/vue2-dapp/src/libs/api.js +1 -1
- package/templates/vue2-dapp/template-info.json +2 -2
- package/templates/vue2-static/README.md +3 -3
- package/templates/vue2-static/blocklet.yml +1 -1
- package/templates/vue2-static/index.html +14 -11
- package/templates/vue2-static/package.json +19 -18
- package/templates/vue2-static/template-info.json +6 -3
- package/common/.husky/pre-commit +0 -4
- package/common/scripts/build-clean.js +0 -5
- package/templates/express-api/.env +0 -1
- package/templates/monorepo/.husky/pre-commit +0 -4
- package/templates/react-dapp/src/app.css +0 -30
- package/templates/react-dapp/src/logo.svg +0 -1
- package/templates/react-dapp/src/pages/about.jsx +0 -16
- package/templates/react-dapp-ts/src/app.css +0 -30
- package/templates/react-dapp-ts/src/logo.svg +0 -1
- package/templates/react-dapp-ts/src/pages/about.tsx +0 -16
- package/templates/react-static/src/app.css +0 -30
- package/templates/react-static/src/logo.svg +0 -1
- package/templates/react-static/src/pages/about.jsx +0 -16
- package/templates/svelte-dapp/.eslintrc.js +0 -22
- package/templates/svelte-dapp/src/assets/svelte.png +0 -0
- package/templates/svelte-dapp/src/lib/Counter.svelte +0 -34
- package/templates/svelte-static/.eslintrc.js +0 -22
- package/templates/svelte-static/src/assets/svelte.png +0 -0
- package/templates/svelte-static/src/lib/Counter.svelte +0 -34
- package/templates/todo-list-example/.editorconfig +0 -23
- package/templates/todo-list-example/.github/workflows/main.yml +0 -36
- package/templates/todo-list-example/.github/workflows/pr-title.yml +0 -21
- package/templates/todo-list-example/.github/workflows/version-check.yml +0 -20
- package/templates/todo-list-example/.husky/pre-commit +0 -4
- package/templates/todo-list-example/.prettierrc +0 -9
- package/templates/todo-list-example/logo.png +0 -0
- package/templates/todo-list-example/public/.gitkeep +0 -0
- package/templates/todo-list-example/screenshots/.gitkeep +0 -0
- package/templates/todo-list-example/scripts/build-clean.js +0 -5
- package/templates/todo-list-example/scripts/bump-version.mjs +0 -35
- package/templates/vue-static/src/assets/logo.png +0 -0
- /package/templates/monorepo/{eslintrc.js → .eslintrc.js} +0 -0
- /package/templates/{solidjs-dapp/src/logo.svg → solidjs-static/src/assets/solidjs.svg} +0 -0
|
@@ -32,14 +32,14 @@ This blocklet is a static project, which means this is a frontend application. I
|
|
|
32
32
|
|
|
33
33
|
Blocklet needs blocklet server as a dependency. So you need to install it first.
|
|
34
34
|
`npm install -g @blocklet/cli`
|
|
35
|
-
See details in [https://
|
|
35
|
+
See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
|
|
36
36
|
|
|
37
37
|
2. Init blocklet server & start blocklet server
|
|
38
38
|
|
|
39
39
|
Before starting an blocklet server, you need to init blocklet server.
|
|
40
40
|
`blocklet server init --mode=debug`
|
|
41
41
|
`blocklet server start`
|
|
42
|
-
See details in [https://
|
|
42
|
+
See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
|
|
43
43
|
|
|
44
44
|
3. Go to the project directory `cd [name]`
|
|
45
45
|
4. Install dependencies: `npm install` or `yarn`
|
|
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
|
|
|
139
139
|
## Learn More
|
|
140
140
|
|
|
141
141
|
- Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md)
|
|
142
|
-
- Full document of Blocklet Server & blocklet development: [https://
|
|
142
|
+
- Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
|
|
143
143
|
|
|
144
144
|
## License
|
|
145
145
|
|
|
@@ -25,9 +25,10 @@ const ensureAccountDeclared = async () => {
|
|
|
25
25
|
(async () => {
|
|
26
26
|
try {
|
|
27
27
|
await ensureAccountDeclared();
|
|
28
|
+
logger.info(`${name} pre-start successfully`);
|
|
28
29
|
process.exit(0);
|
|
29
30
|
} catch (err) {
|
|
30
|
-
logger.error(`${name} pre-start error`, err
|
|
31
|
+
logger.error(`${name} pre-start error`, err);
|
|
31
32
|
process.exit(1);
|
|
32
33
|
}
|
|
33
34
|
})();
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<link rel="icon" href="/favicon.ico?imageFilter=convert&f=png&w=32" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<meta name="theme-color" content="#4F6AF5" />
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
<script type="module" src="/src/main.js"></script>
|
|
15
|
+
</body>
|
|
16
|
+
|
|
14
17
|
</html>
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "template-vue2",
|
|
2
|
+
"name": "template-vue2-dapp",
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev",
|
|
6
6
|
"start": "cross-env NODE_ENV=development nodemon api/dev.js -w api",
|
|
7
|
-
"clean": "node scripts/build-clean.
|
|
7
|
+
"clean": "node scripts/build-clean.mjs",
|
|
8
8
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
9
9
|
"bundle:client": "vite build",
|
|
10
|
-
"bundle:api": "npm run clean && blocklet bundle --
|
|
10
|
+
"bundle:api": "npm run clean && blocklet bundle --compact --create-release",
|
|
11
11
|
"deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
|
|
12
12
|
"upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
|
|
13
13
|
"lint": "eslint src api --ext .mjs,.js,.vue",
|
|
14
14
|
"lint:fix": "npm run lint -- --fix",
|
|
15
15
|
"deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
|
|
16
16
|
"dev:child": "blocklet dev --component --app-did=<%= did %>",
|
|
17
|
-
"prepare": "
|
|
17
|
+
"prepare": "npx simple-git-hooks",
|
|
18
18
|
"bump-version": "zx --quiet scripts/bump-version.mjs"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/did-auth": "^1.18.
|
|
21
|
+
"@arcblock/did-auth": "^1.18.124",
|
|
22
22
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
23
|
-
"@blocklet/sdk": "^1.16.
|
|
24
|
-
"@ocap/client": "^1.18.
|
|
25
|
-
"@ocap/mcrypto": "^1.18.
|
|
26
|
-
"@ocap/wallet": "^1.18.
|
|
27
|
-
"axios": "^1.
|
|
23
|
+
"@blocklet/sdk": "^1.16.28",
|
|
24
|
+
"@ocap/client": "^1.18.124",
|
|
25
|
+
"@ocap/mcrypto": "^1.18.124",
|
|
26
|
+
"@ocap/wallet": "^1.18.124",
|
|
27
|
+
"axios": "^1.7.2",
|
|
28
28
|
"cookie-parser": "^1.4.6",
|
|
29
29
|
"cors": "^2.8.5",
|
|
30
|
-
"dotenv-flow": "^
|
|
31
|
-
"express": "^4.
|
|
32
|
-
"express-async-errors": "^3.1.1"
|
|
33
|
-
"vue": "^2.7.15"
|
|
30
|
+
"dotenv-flow": "^4.1.0",
|
|
31
|
+
"express": "^4.19.2",
|
|
32
|
+
"express-async-errors": "^3.1.1"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
35
|
"@vitejs/plugin-vue2": "^2.3.1",
|
|
37
|
-
"bumpp": "^
|
|
36
|
+
"bumpp": "^9.4.1",
|
|
38
37
|
"cross-env": "^7.0.3",
|
|
39
|
-
"eslint": "^8.
|
|
40
|
-
"eslint-config-prettier": "^
|
|
41
|
-
"eslint-plugin-prettier": "^
|
|
42
|
-
"eslint-plugin-vue": "^9.
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"nodemon": "^3.0.2",
|
|
38
|
+
"eslint": "^8.57.0",
|
|
39
|
+
"eslint-config-prettier": "^9.1.0",
|
|
40
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
41
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
42
|
+
"lint-staged": "^15.2.7",
|
|
43
|
+
"nodemon": "^3.1.4",
|
|
46
44
|
"npm-run-all": "^4.1.5",
|
|
47
|
-
"prettier": "^3.
|
|
48
|
-
"rimraf": "^
|
|
49
|
-
"
|
|
50
|
-
"vite
|
|
51
|
-
"
|
|
45
|
+
"prettier": "^3.3.2",
|
|
46
|
+
"rimraf": "^5.0.7",
|
|
47
|
+
"simple-git-hooks": "^2.11.1",
|
|
48
|
+
"vite": "^5.3.2",
|
|
49
|
+
"vite-plugin-blocklet": "^0.8.1",
|
|
50
|
+
"vue": "^2.7.16",
|
|
51
|
+
"zx": "^8.1.3"
|
|
52
52
|
},
|
|
53
53
|
"lint-staged": {
|
|
54
54
|
"*.{mjs,js,vue}": [
|
|
@@ -58,5 +58,8 @@
|
|
|
58
58
|
"*.{css,less,scss,json,graphql}": [
|
|
59
59
|
"prettier --write"
|
|
60
60
|
]
|
|
61
|
+
},
|
|
62
|
+
"simple-git-hooks": {
|
|
63
|
+
"pre-commit": "npx lint-staged"
|
|
61
64
|
}
|
|
62
65
|
}
|
|
@@ -32,14 +32,14 @@ This blocklet is a static project, which means this is a frontend application. I
|
|
|
32
32
|
|
|
33
33
|
Blocklet needs blocklet server as a dependency. So you need to install it first.
|
|
34
34
|
`npm install -g @blocklet/cli`
|
|
35
|
-
See details in [https://
|
|
35
|
+
See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
|
|
36
36
|
|
|
37
37
|
2. Init blocklet server & start blocklet server
|
|
38
38
|
|
|
39
39
|
Before starting an blocklet server, you need to init blocklet server.
|
|
40
40
|
`blocklet server init --mode=debug`
|
|
41
41
|
`blocklet server start`
|
|
42
|
-
See details in [https://
|
|
42
|
+
See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
|
|
43
43
|
|
|
44
44
|
3. Go to the project directory `cd [name]`
|
|
45
45
|
4. Install dependencies: `npm install` or `yarn`
|
|
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
|
|
|
139
139
|
## Learn More
|
|
140
140
|
|
|
141
141
|
- Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md)
|
|
142
|
-
- Full document of Blocklet Server & blocklet development: [https://
|
|
142
|
+
- Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
|
|
143
143
|
|
|
144
144
|
## License
|
|
145
145
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<link rel="icon" href="/favicon.ico?imageFilter=convert&f=png&w=32" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<meta name="theme-color" content="#4F6AF5" />
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
<script type="module" src="/src/main.js"></script>
|
|
15
|
+
</body>
|
|
16
|
+
|
|
14
17
|
</html>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "template-vue2",
|
|
2
|
+
"name": "template-vue2-static",
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev",
|
|
@@ -7,32 +7,30 @@
|
|
|
7
7
|
"lint": "eslint src --ext .mjs,.js,.vue",
|
|
8
8
|
"lint:fix": "npm run lint -- --fix",
|
|
9
9
|
"serve": "vite preview",
|
|
10
|
-
"clean": "node scripts/build-clean.
|
|
10
|
+
"clean": "node scripts/build-clean.mjs",
|
|
11
11
|
"bundle": "npm run clean && vite 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
14
|
"deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
|
|
15
15
|
"dev:child": "blocklet dev --component --app-did=<%= did %>",
|
|
16
|
-
"prepare": "
|
|
16
|
+
"prepare": "npx simple-git-hooks",
|
|
17
17
|
"bump-version": "zx --quiet scripts/bump-version.mjs"
|
|
18
18
|
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"vue": "^2.7.15"
|
|
21
|
-
},
|
|
22
19
|
"devDependencies": {
|
|
23
20
|
"@vitejs/plugin-vue2": "^2.3.1",
|
|
24
|
-
"bumpp": "^
|
|
25
|
-
"eslint": "^8.
|
|
26
|
-
"eslint-config-prettier": "^
|
|
27
|
-
"eslint-plugin-prettier": "^
|
|
28
|
-
"eslint-plugin-vue": "^9.
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"vite": "^5.
|
|
34
|
-
"vite-plugin-blocklet": "^0.
|
|
35
|
-
"
|
|
21
|
+
"bumpp": "^9.4.1",
|
|
22
|
+
"eslint": "^8.57.0",
|
|
23
|
+
"eslint-config-prettier": "^9.1.0",
|
|
24
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
25
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
26
|
+
"lint-staged": "^15.2.7",
|
|
27
|
+
"prettier": "^3.3.2",
|
|
28
|
+
"rimraf": "^5.0.7",
|
|
29
|
+
"simple-git-hooks": "^2.11.1",
|
|
30
|
+
"vite": "^5.3.2",
|
|
31
|
+
"vite-plugin-blocklet": "^0.8.1",
|
|
32
|
+
"vue": "^2.7.16",
|
|
33
|
+
"zx": "^8.1.3"
|
|
36
34
|
},
|
|
37
35
|
"lint-staged": {
|
|
38
36
|
"*.{mjs,js,vue}": [
|
|
@@ -42,5 +40,8 @@
|
|
|
42
40
|
"*.{css,less,scss,json,graphql}": [
|
|
43
41
|
"prettier --write"
|
|
44
42
|
]
|
|
43
|
+
},
|
|
44
|
+
"simple-git-hooks": {
|
|
45
|
+
"pre-commit": "npx lint-staged"
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-static",
|
|
3
|
-
"desc": {
|
|
3
|
+
"desc": {
|
|
4
|
+
"en": "A front-end application skeleton built with Vue 2",
|
|
5
|
+
"zh": "一个基于 Vue 2 构建的前端应用骨架"
|
|
6
|
+
},
|
|
4
7
|
"blockletType": "static",
|
|
5
8
|
"composable": true,
|
|
6
9
|
"languages": "JavaScript",
|
|
7
10
|
"useCase": "Starter",
|
|
8
|
-
"author": "
|
|
9
|
-
}
|
|
11
|
+
"author": "Blocklet"
|
|
12
|
+
}
|
package/common/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
APP_TITLE=''
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
html,
|
|
2
|
-
body {
|
|
3
|
-
padding: 0;
|
|
4
|
-
margin: 0;
|
|
5
|
-
}
|
|
6
|
-
.app {
|
|
7
|
-
text-align: center;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.app-logo {
|
|
11
|
-
height: 10vmin;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.app-header {
|
|
16
|
-
min-height: 100vh;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
font-size: calc(10px + 2vmin);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pre {
|
|
25
|
-
font-size: 0.75em;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.app-link {
|
|
29
|
-
color: #4f6af5;
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="450" height="520" viewBox="0 0 45 52"><g fill="none" fill-rule="evenodd" stroke="#4F6AF5"><path d="M.5 13.077L22.15.577l21.651 12.5v25l-21.65 12.5L.5 38.077zM22.15.577v50M.5 13.077l43.301 25m-43.301 0l43.301-25"></path><path d="M22.15 38.077l10.826-6.25-10.825-18.75-10.825 18.75z"></path></g></svg>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
html,
|
|
2
|
-
body {
|
|
3
|
-
padding: 0;
|
|
4
|
-
margin: 0;
|
|
5
|
-
}
|
|
6
|
-
.app {
|
|
7
|
-
text-align: center;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.app-logo {
|
|
11
|
-
height: 10vmin;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.app-header {
|
|
16
|
-
min-height: 100vh;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
font-size: calc(10px + 2vmin);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pre {
|
|
25
|
-
font-size: 0.75em;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.app-link {
|
|
29
|
-
color: #4f6af5;
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="450" height="520" viewBox="0 0 45 52"><g fill="none" fill-rule="evenodd" stroke="#4F6AF5"><path d="M.5 13.077L22.15.577l21.651 12.5v25l-21.65 12.5L.5 38.077zM22.15.577v50M.5 13.077l43.301 25m-43.301 0l43.301-25"></path><path d="M22.15 38.077l10.826-6.25-10.825-18.75-10.825 18.75z"></path></g></svg>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
html,
|
|
2
|
-
body {
|
|
3
|
-
padding: 0;
|
|
4
|
-
margin: 0;
|
|
5
|
-
}
|
|
6
|
-
.app {
|
|
7
|
-
text-align: center;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.app-logo {
|
|
11
|
-
height: 10vmin;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.app-header {
|
|
16
|
-
min-height: 100vh;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
font-size: calc(10px + 2vmin);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pre {
|
|
25
|
-
font-size: 0.75em;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.app-link {
|
|
29
|
-
color: #4f6af5;
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 52"><g fill="none" fill-rule="evenodd" stroke="#4F6AF5"><path d="M.5 13.077L22.15.577l21.651 12.5v25l-21.65 12.5L.5 38.077zM22.15.577v50M.5 13.077l43.301 25m-43.301 0l43.301-25"></path><path d="M22.15 38.077l10.826-6.25-10.825-18.75-10.825 18.75z"></path></g></svg>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
es6: true,
|
|
5
|
-
browser: true,
|
|
6
|
-
},
|
|
7
|
-
parserOptions: {
|
|
8
|
-
ecmaVersion: 2019,
|
|
9
|
-
sourceType: 'module',
|
|
10
|
-
},
|
|
11
|
-
plugins: ['svelte3'],
|
|
12
|
-
overrides: [
|
|
13
|
-
{
|
|
14
|
-
files: ['*.svelte'],
|
|
15
|
-
processor: 'svelte3/svelte3',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
rules: {
|
|
19
|
-
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
20
|
-
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
Binary file
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
let count = 0;
|
|
3
|
-
const increment = () => {
|
|
4
|
-
count += 1;
|
|
5
|
-
};
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<button on:click={increment}>
|
|
9
|
-
Clicks: {count}
|
|
10
|
-
</button>
|
|
11
|
-
|
|
12
|
-
<style>
|
|
13
|
-
button {
|
|
14
|
-
font-family: inherit;
|
|
15
|
-
font-size: inherit;
|
|
16
|
-
padding: 1em 2em;
|
|
17
|
-
color: #ff3e00;
|
|
18
|
-
background-color: rgba(255, 62, 0, 0.1);
|
|
19
|
-
border-radius: 2em;
|
|
20
|
-
border: 2px solid rgba(255, 62, 0, 0);
|
|
21
|
-
outline: none;
|
|
22
|
-
width: 200px;
|
|
23
|
-
font-variant-numeric: tabular-nums;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
button:focus {
|
|
28
|
-
border: 2px solid #ff3e00;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
button:active {
|
|
32
|
-
background-color: rgba(255, 62, 0, 0.2);
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
es6: true,
|
|
5
|
-
browser: true,
|
|
6
|
-
},
|
|
7
|
-
parserOptions: {
|
|
8
|
-
ecmaVersion: 2019,
|
|
9
|
-
sourceType: 'module',
|
|
10
|
-
},
|
|
11
|
-
plugins: ['svelte3'],
|
|
12
|
-
overrides: [
|
|
13
|
-
{
|
|
14
|
-
files: ['*.svelte'],
|
|
15
|
-
processor: 'svelte3/svelte3',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
rules: {
|
|
19
|
-
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
20
|
-
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
Binary file
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
let count = 0;
|
|
3
|
-
const increment = () => {
|
|
4
|
-
count += 1;
|
|
5
|
-
};
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<button on:click={increment}>
|
|
9
|
-
Clicks: {count}
|
|
10
|
-
</button>
|
|
11
|
-
|
|
12
|
-
<style>
|
|
13
|
-
button {
|
|
14
|
-
font-family: inherit;
|
|
15
|
-
font-size: inherit;
|
|
16
|
-
padding: 1em 2em;
|
|
17
|
-
color: #ff3e00;
|
|
18
|
-
background-color: rgba(255, 62, 0, 0.1);
|
|
19
|
-
border-radius: 2em;
|
|
20
|
-
border: 2px solid rgba(255, 62, 0, 0);
|
|
21
|
-
outline: none;
|
|
22
|
-
width: 200px;
|
|
23
|
-
font-variant-numeric: tabular-nums;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
button:focus {
|
|
28
|
-
border: 2px solid #ff3e00;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
button:active {
|
|
32
|
-
background-color: rgba(255, 62, 0, 0.2);
|
|
33
|
-
}
|
|
34
|
-
</style>
|