create-blocklet 0.7.8 → 0.8.0
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/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/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/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/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/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.md +27 -2
- package/templates/todo-list-example/blocklet.yml +8 -6
- package/templates/todo-list-example/blocklet.zh.md +28 -0
- 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/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/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/_npmrc +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
|
@@ -1,23 +0,0 @@
|
|
|
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
|
|
@@ -1,36 +0,0 @@
|
|
|
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(github.event.head_commit.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 }}
|
|
@@ -1,21 +0,0 @@
|
|
|
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 }}
|
|
@@ -1,20 +0,0 @@
|
|
|
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 }}
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import { execSync } from 'child_process';
|
|
3
|
-
import { $, chalk, fs } from 'zx';
|
|
4
|
-
|
|
5
|
-
execSync('bumpp --no-tag --no-commit --no-push package.json', { stdio: 'inherit' });
|
|
6
|
-
|
|
7
|
-
const { version } = await fs.readJSON('package.json');
|
|
8
|
-
await fs.writeFileSync('version', version);
|
|
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.'));
|
|
13
|
-
|
|
14
|
-
let newChangelog = '';
|
|
15
|
-
try {
|
|
16
|
-
const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
|
|
17
|
-
newChangelog = gitRes.stdout.trim();
|
|
18
|
-
} catch {
|
|
19
|
-
console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const now = new Date();
|
|
23
|
-
const currentDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
|
|
24
|
-
const title = `## ${version} (${currentDate})`;
|
|
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
|
-
await fs.writeFile('CHANGELOG.md', changelog);
|
|
30
|
-
|
|
31
|
-
console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')} . Then press enter to continue.`);
|
|
32
|
-
|
|
33
|
-
process.stdin.setRawMode(true);
|
|
34
|
-
process.stdin.resume();
|
|
35
|
-
process.stdin.on('data', process.exit.bind(process, 0));
|
|
Binary file
|
|
File without changes
|
|
File without changes
|