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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
require('dotenv-flow').config();
|
|
2
2
|
require('express-async-errors');
|
|
3
|
-
|
|
4
3
|
const path = require('path');
|
|
5
4
|
const cors = require('cors');
|
|
6
5
|
const Gun = require('gun');
|
|
@@ -21,34 +20,27 @@ app.use(express.json({ limit: '1 mb' }));
|
|
|
21
20
|
app.use(express.urlencoded({ extended: true, limit: '1 mb' }));
|
|
22
21
|
|
|
23
22
|
app.use(Gun.serve);
|
|
23
|
+
app.use(cors());
|
|
24
24
|
|
|
25
25
|
const router = express.Router();
|
|
26
26
|
router.use('/api', require('./routes'));
|
|
27
|
+
app.use(router);
|
|
27
28
|
|
|
28
|
-
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
29
29
|
const isProduction = process.env.NODE_ENV === 'production' || process.env.ABT_NODE_SERVICE_ENV === 'production';
|
|
30
30
|
|
|
31
31
|
if (isProduction) {
|
|
32
|
-
|
|
32
|
+
const staticDir = path.resolve(__dirname, '../dist');
|
|
33
33
|
app.use(compression());
|
|
34
|
-
|
|
35
|
-
const staticDir = path.resolve(process.env.BLOCKLET_APP_DIR, 'dist');
|
|
36
34
|
app.use(express.static(staticDir, { maxAge: '30d', index: false }));
|
|
37
|
-
app.use(router);
|
|
38
35
|
app.use(fallback('index.html', { root: staticDir }));
|
|
39
36
|
|
|
40
|
-
app.use((req, res) => {
|
|
41
|
-
res.status(404).send('404 NOT FOUND');
|
|
42
|
-
});
|
|
43
37
|
app.use((err, req, res) => {
|
|
44
38
|
logger.error(err.stack);
|
|
45
39
|
res.status(500).send('Something broke!');
|
|
46
40
|
});
|
|
47
|
-
} else {
|
|
48
|
-
app.use(router);
|
|
49
41
|
}
|
|
50
42
|
|
|
51
|
-
const port =
|
|
43
|
+
const port = parseInt(process.env.BLOCKLET_PORT, 10);
|
|
52
44
|
|
|
53
45
|
const server = app.listen(port, (err) => {
|
|
54
46
|
if (err) throw err;
|
|
@@ -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": "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",
|
|
@@ -59,23 +57,23 @@
|
|
|
59
57
|
"gun": "^0.2020.1238",
|
|
60
58
|
"react": "^18.2.0",
|
|
61
59
|
"react-dom": "^18.2.0",
|
|
62
|
-
"react-router-dom": "^6.4.
|
|
60
|
+
"react-router-dom": "^6.4.3"
|
|
63
61
|
},
|
|
64
62
|
"devDependencies": {
|
|
65
63
|
"@arcblock/eslint-config": "^0.2.3",
|
|
66
|
-
"@vitejs/plugin-react": "^2.
|
|
67
|
-
"
|
|
64
|
+
"@vitejs/plugin-react": "^2.2.0",
|
|
65
|
+
"bumpp": "^8.2.1",
|
|
66
|
+
"cross-env": "^7.0.3",
|
|
67
|
+
"eslint": "^8.26.0",
|
|
68
68
|
"husky": "^8.0.1",
|
|
69
69
|
"lint-staged": "^12.5.0",
|
|
70
70
|
"nodemon": "^2.0.20",
|
|
71
71
|
"npm-run-all": "^4.1.5",
|
|
72
72
|
"prettier": "^2.7.1",
|
|
73
|
-
"vite": "^3.1.8",
|
|
74
|
-
"vite-plugin-blocklet": "^0.4.81",
|
|
75
|
-
"vite-plugin-html": "^3.2.0",
|
|
76
|
-
"vite-plugin-svgr": "^2.2.2",
|
|
77
|
-
"zx": "^7.1.1",
|
|
78
73
|
"rimraf": "^3.0.2",
|
|
79
|
-
"
|
|
74
|
+
"vite": "^3.2.2",
|
|
75
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
76
|
+
"vite-plugin-svgr": "^2.2.2",
|
|
77
|
+
"zx": "^7.1.1"
|
|
80
78
|
}
|
|
81
79
|
}
|
|
@@ -1,41 +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
|
-
const gunPrefix = '/gun'; // ws suffix only supports first level paths
|
|
13
|
-
|
|
7
|
+
export default defineConfig(() => {
|
|
14
8
|
return {
|
|
15
|
-
plugins: [
|
|
16
|
-
react(),
|
|
17
|
-
createHtmlPlugin({
|
|
18
|
-
minify: true,
|
|
19
|
-
inject: {
|
|
20
|
-
data: {
|
|
21
|
-
title: envMap.APP_TITLE,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
createBlockletPlugin(),
|
|
26
|
-
svgr(),
|
|
27
|
-
],
|
|
28
|
-
server: {
|
|
29
|
-
proxy: {
|
|
30
|
-
[apiPrefix]: {
|
|
31
|
-
target: `http://127.0.0.1:${apiPort}`,
|
|
32
|
-
rewrite: (path) => path.replace(apiPrefix, '/api'), // rewrite path when blocklet dev
|
|
33
|
-
},
|
|
34
|
-
[gunPrefix]: {
|
|
35
|
-
target: `ws://127.0.0.1:${apiPort}`,
|
|
36
|
-
ws: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
9
|
+
plugins: [react(), createBlockletPlugin(), svgr()],
|
|
40
10
|
};
|
|
41
11
|
});
|
|
@@ -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>
|
|
@@ -41,21 +41,20 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"react": "^18.2.0",
|
|
43
43
|
"react-dom": "^18.2.0",
|
|
44
|
-
"react-router-dom": "^6.4.
|
|
44
|
+
"react-router-dom": "^6.4.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@arcblock/eslint-config": "^0.2.3",
|
|
48
|
-
"@vitejs/plugin-react": "^2.
|
|
49
|
-
"
|
|
48
|
+
"@vitejs/plugin-react": "^2.2.0",
|
|
49
|
+
"bumpp": "^8.2.1",
|
|
50
|
+
"eslint": "^8.26.0",
|
|
50
51
|
"husky": "^8.0.1",
|
|
51
52
|
"lint-staged": "^12.5.0",
|
|
52
53
|
"prettier": "^2.7.1",
|
|
53
|
-
"vite": "^3.1.8",
|
|
54
|
-
"vite-plugin-blocklet": "^0.4.81",
|
|
55
|
-
"vite-plugin-html": "^3.2.0",
|
|
56
|
-
"vite-plugin-svgr": "^2.2.2",
|
|
57
|
-
"zx": "^7.1.1",
|
|
58
54
|
"rimraf": "^3.0.2",
|
|
59
|
-
"
|
|
55
|
+
"vite": "^3.2.2",
|
|
56
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
57
|
+
"vite-plugin-svgr": "^2.2.2",
|
|
58
|
+
"zx": "^7.1.1"
|
|
60
59
|
}
|
|
61
60
|
}
|
|
@@ -1,26 +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
|
-
|
|
7
|
+
export default defineConfig(() => {
|
|
11
8
|
return {
|
|
12
|
-
plugins: [
|
|
13
|
-
react(),
|
|
14
|
-
createHtmlPlugin({
|
|
15
|
-
minify: true,
|
|
16
|
-
inject: {
|
|
17
|
-
data: {
|
|
18
|
-
title: envMap.APP_TITLE,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
createBlockletPlugin(),
|
|
23
|
-
svgr(),
|
|
24
|
-
],
|
|
9
|
+
plugins: [react(), createBlockletPlugin(), svgr()],
|
|
25
10
|
};
|
|
26
11
|
});
|
|
@@ -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
|
+
};
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<meta name="theme-color" content="#000000" />
|
|
7
7
|
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
|
|
8
|
-
<title><%- title %></title>
|
|
9
8
|
</head>
|
|
10
9
|
<body>
|
|
11
10
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "blocklet dev",
|
|
7
|
-
"
|
|
8
|
-
"start": "npm-run-all --parallel start:*",
|
|
9
|
-
"start:client": "vite",
|
|
10
|
-
"start:api": "NODE_ENV=development nodemon api/index.js -w api",
|
|
7
|
+
"start": "cross-env NODE_ENV=development nodemon api/dev.js -w api",
|
|
11
8
|
"clean": "node scripts/build-clean.js",
|
|
12
9
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
13
10
|
"bundle:client": "vite build",
|
|
@@ -23,7 +20,9 @@
|
|
|
23
20
|
},
|
|
24
21
|
"license": "MIT",
|
|
25
22
|
"devDependencies": {
|
|
26
|
-
"
|
|
23
|
+
"bumpp": "^8.2.1",
|
|
24
|
+
"cross-env": "^7.0.3",
|
|
25
|
+
"eslint": "^8.26.0",
|
|
27
26
|
"eslint-config-prettier": "^8.5.0",
|
|
28
27
|
"eslint-plugin-prettier": "^4.2.1",
|
|
29
28
|
"eslint-plugin-solid": "0.7.1",
|
|
@@ -32,21 +31,19 @@
|
|
|
32
31
|
"nodemon": "^2.0.20",
|
|
33
32
|
"npm-run-all": "^4.1.5",
|
|
34
33
|
"prettier": "^2.7.1",
|
|
35
|
-
"vite": "^3.1.8",
|
|
36
|
-
"vite-plugin-blocklet": "^0.4.81",
|
|
37
|
-
"vite-plugin-html": "^3.2.0",
|
|
38
|
-
"vite-plugin-solid": "^2.3.9",
|
|
39
|
-
"zx": "^7.1.1",
|
|
40
34
|
"rimraf": "^3.0.2",
|
|
41
|
-
"
|
|
35
|
+
"vite": "^3.2.2",
|
|
36
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
37
|
+
"vite-plugin-solid": "^2.3.10",
|
|
38
|
+
"zx": "^7.1.1"
|
|
42
39
|
},
|
|
43
40
|
"dependencies": {
|
|
44
|
-
"@arcblock/did-auth": "^1.
|
|
41
|
+
"@arcblock/did-auth": "^1.18.6",
|
|
45
42
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
46
|
-
"@blocklet/sdk": "^1.8.
|
|
47
|
-
"@ocap/client": "^1.
|
|
48
|
-
"@ocap/mcrypto": "^1.
|
|
49
|
-
"@ocap/wallet": "^1.
|
|
43
|
+
"@blocklet/sdk": "^1.8.33",
|
|
44
|
+
"@ocap/client": "^1.18.6",
|
|
45
|
+
"@ocap/mcrypto": "^1.18.6",
|
|
46
|
+
"@ocap/wallet": "^1.18.6",
|
|
50
47
|
"axios": "^0.27.2",
|
|
51
48
|
"compression": "^1.7.4",
|
|
52
49
|
"cookie-parser": "^1.4.6",
|
|
@@ -55,7 +52,7 @@
|
|
|
55
52
|
"express": "^4.18.2",
|
|
56
53
|
"express-async-errors": "^3.1.1",
|
|
57
54
|
"express-history-api-fallback": "^2.2.1",
|
|
58
|
-
"solid-js": "^1.
|
|
55
|
+
"solid-js": "^1.6.1"
|
|
59
56
|
},
|
|
60
57
|
"lint-staged": {
|
|
61
58
|
"*.{mjs,js,vue}": [
|
|
@@ -1,33 +1,13 @@
|
|
|
1
|
-
import { defineConfig
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
2
|
import solidPlugin from 'vite-plugin-solid';
|
|
3
|
-
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
3
|
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
4
|
|
|
6
|
-
export default defineConfig(
|
|
7
|
-
const envMap = loadEnv(mode, process.cwd(), '');
|
|
8
|
-
const apiPort = envMap.API_PORT || 3030;
|
|
9
|
-
|
|
5
|
+
export default defineConfig(() => {
|
|
10
6
|
return {
|
|
11
|
-
plugins: [
|
|
12
|
-
solidPlugin(),
|
|
13
|
-
createHtmlPlugin({
|
|
14
|
-
minify: true,
|
|
15
|
-
inject: {
|
|
16
|
-
data: {
|
|
17
|
-
title: envMap.APP_TITLE,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
}),
|
|
21
|
-
createBlockletPlugin(),
|
|
22
|
-
],
|
|
7
|
+
plugins: [solidPlugin(), createBlockletPlugin()],
|
|
23
8
|
build: {
|
|
24
9
|
target: 'esnext',
|
|
25
10
|
polyfillDynamicImport: false,
|
|
26
11
|
},
|
|
27
|
-
server: {
|
|
28
|
-
proxy: {
|
|
29
|
-
'/api': `http://127.0.0.1:${apiPort}`,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
12
|
};
|
|
33
13
|
});
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<meta name="theme-color" content="#000000" />
|
|
7
7
|
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
|
|
8
|
-
<title><%- title %></title>
|
|
9
8
|
</head>
|
|
10
9
|
<body>
|
|
11
10
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -19,23 +19,22 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"
|
|
22
|
+
"bumpp": "^8.2.1",
|
|
23
|
+
"eslint": "^8.26.0",
|
|
23
24
|
"eslint-config-prettier": "^8.5.0",
|
|
24
25
|
"eslint-plugin-prettier": "^4.2.1",
|
|
25
26
|
"eslint-plugin-solid": "0.7.1",
|
|
26
27
|
"husky": "^8.0.1",
|
|
27
28
|
"lint-staged": "^12.5.0",
|
|
28
29
|
"prettier": "^2.7.1",
|
|
29
|
-
"vite": "^3.1.8",
|
|
30
|
-
"vite-plugin-blocklet": "^0.4.81",
|
|
31
|
-
"vite-plugin-html": "^3.2.0",
|
|
32
|
-
"vite-plugin-solid": "^2.3.9",
|
|
33
|
-
"zx": "^7.1.1",
|
|
34
30
|
"rimraf": "^3.0.2",
|
|
35
|
-
"
|
|
31
|
+
"vite": "^3.2.2",
|
|
32
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
33
|
+
"vite-plugin-solid": "^2.3.10",
|
|
34
|
+
"zx": "^7.1.1"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"solid-js": "^1.
|
|
37
|
+
"solid-js": "^1.6.1"
|
|
39
38
|
},
|
|
40
39
|
"lint-staged": {
|
|
41
40
|
"*.{mjs,js,vue}": [
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
import { defineConfig
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
2
|
import solidPlugin from 'vite-plugin-solid';
|
|
3
|
-
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
3
|
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
4
|
|
|
6
|
-
export default defineConfig(
|
|
7
|
-
const envMap = loadEnv(mode, process.cwd(), '');
|
|
8
|
-
|
|
5
|
+
export default defineConfig(() => {
|
|
9
6
|
return {
|
|
10
|
-
plugins: [
|
|
11
|
-
solidPlugin(),
|
|
12
|
-
createHtmlPlugin({
|
|
13
|
-
minify: true,
|
|
14
|
-
inject: {
|
|
15
|
-
data: {
|
|
16
|
-
title: envMap.APP_TITLE,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
createBlockletPlugin(),
|
|
21
|
-
],
|
|
7
|
+
plugins: [solidPlugin(), createBlockletPlugin()],
|
|
22
8
|
build: {
|
|
23
9
|
target: 'esnext',
|
|
24
10
|
polyfillDynamicImport: false,
|
|
@@ -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
|
<div id="app"></div>
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
"version": "0.1.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "blocklet dev",
|
|
7
|
-
"
|
|
8
|
-
"start": "npm-run-all --parallel start:*",
|
|
9
|
-
"start:client": "vite",
|
|
10
|
-
"start:api": "NODE_ENV=development nodemon api/index.js -w api",
|
|
7
|
+
"start": "cross-env NODE_ENV=development nodemon api/dev.js -w api",
|
|
11
8
|
"clean": "node scripts/build-clean.js",
|
|
12
9
|
"bundle": "npm run bundle:client && npm run bundle:api",
|
|
13
10
|
"bundle:client": "vite build",
|
|
@@ -20,12 +17,12 @@
|
|
|
20
17
|
"bump-version": "zx scripts/bump-version.mjs"
|
|
21
18
|
},
|
|
22
19
|
"dependencies": {
|
|
23
|
-
"@arcblock/did-auth": "^1.
|
|
20
|
+
"@arcblock/did-auth": "^1.18.6",
|
|
24
21
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
25
|
-
"@blocklet/sdk": "^1.8.
|
|
26
|
-
"@ocap/client": "^1.
|
|
27
|
-
"@ocap/mcrypto": "^1.
|
|
28
|
-
"@ocap/wallet": "^1.
|
|
22
|
+
"@blocklet/sdk": "^1.8.33",
|
|
23
|
+
"@ocap/client": "^1.18.6",
|
|
24
|
+
"@ocap/mcrypto": "^1.18.6",
|
|
25
|
+
"@ocap/wallet": "^1.18.6",
|
|
29
26
|
"axios": "^0.27.2",
|
|
30
27
|
"compression": "^1.7.4",
|
|
31
28
|
"cookie-parser": "^1.4.6",
|
|
@@ -37,7 +34,9 @@
|
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
36
|
"@sveltejs/vite-plugin-svelte": "1.0.1",
|
|
40
|
-
"
|
|
37
|
+
"bumpp": "^8.2.1",
|
|
38
|
+
"cross-env": "^7.0.3",
|
|
39
|
+
"eslint": "^8.26.0",
|
|
41
40
|
"eslint-config-prettier": "^8.5.0",
|
|
42
41
|
"eslint-plugin-prettier": "^4.2.1",
|
|
43
42
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
@@ -45,13 +44,12 @@
|
|
|
45
44
|
"lint-staged": "^12.5.0",
|
|
46
45
|
"npm-run-all": "^4.1.5",
|
|
47
46
|
"prettier": "^2.7.1",
|
|
47
|
+
"rimraf": "^3.0.2",
|
|
48
48
|
"svelte": "^3.52.0",
|
|
49
|
-
"vite": "^3.
|
|
50
|
-
"vite-plugin-blocklet": "^0.
|
|
49
|
+
"vite": "^3.2.2",
|
|
50
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
51
51
|
"vite-plugin-html": "^3.2.0",
|
|
52
|
-
"zx": "^7.1.1"
|
|
53
|
-
"rimraf": "^3.0.2",
|
|
54
|
-
"bumpp": "^8.2.1"
|
|
52
|
+
"zx": "^7.1.1"
|
|
55
53
|
},
|
|
56
54
|
"lint-staged": {
|
|
57
55
|
"*.{mjs,js,vue}": [
|
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
import { defineConfig
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
2
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
|
3
|
-
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
4
3
|
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
5
4
|
|
|
6
5
|
// https://vitejs.dev/config/
|
|
7
|
-
export default defineConfig(
|
|
8
|
-
const envMap = loadEnv(mode, process.cwd(), '');
|
|
9
|
-
const apiPort = envMap.API_PORT || 3030;
|
|
10
|
-
|
|
6
|
+
export default defineConfig(() => {
|
|
11
7
|
return {
|
|
12
|
-
plugins: [
|
|
13
|
-
svelte(),
|
|
14
|
-
createHtmlPlugin({
|
|
15
|
-
minify: true,
|
|
16
|
-
inject: {
|
|
17
|
-
data: {
|
|
18
|
-
title: envMap.APP_TITLE,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
createBlockletPlugin(),
|
|
23
|
-
],
|
|
24
|
-
server: {
|
|
25
|
-
proxy: {
|
|
26
|
-
'/api': `http://127.0.0.1:${apiPort}`,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
8
|
+
plugins: [svelte(), createBlockletPlugin()],
|
|
29
9
|
};
|
|
30
10
|
});
|
|
@@ -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
|
<div id="app"></div>
|
|
@@ -19,20 +19,19 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@sveltejs/vite-plugin-svelte": "1.0.1",
|
|
22
|
-
"
|
|
22
|
+
"bumpp": "^8.2.1",
|
|
23
|
+
"eslint": "^8.26.0",
|
|
23
24
|
"eslint-config-prettier": "^8.5.0",
|
|
24
25
|
"eslint-plugin-prettier": "^4.2.1",
|
|
25
26
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
26
27
|
"husky": "^8.0.1",
|
|
27
28
|
"lint-staged": "^12.5.0",
|
|
28
29
|
"prettier": "^2.7.1",
|
|
29
|
-
"svelte": "^3.52.0",
|
|
30
|
-
"vite": "^3.1.8",
|
|
31
|
-
"vite-plugin-blocklet": "^0.4.81",
|
|
32
|
-
"vite-plugin-html": "^3.2.0",
|
|
33
|
-
"zx": "^7.1.1",
|
|
34
30
|
"rimraf": "^3.0.2",
|
|
35
|
-
"
|
|
31
|
+
"svelte": "^3.52.0",
|
|
32
|
+
"vite": "^3.2.2",
|
|
33
|
+
"vite-plugin-blocklet": "^0.5.1",
|
|
34
|
+
"zx": "^7.1.1"
|
|
36
35
|
},
|
|
37
36
|
"lint-staged": {
|
|
38
37
|
"*.{mjs,js,vue}": [
|