create-blocklet 0.3.6 → 0.3.9
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 +5 -0
- package/common/.makefiles/bump_version.sh +2 -1
- package/common/_editorconfig +23 -0
- package/common/_gitignore +9 -16
- package/common/{.prettierrc → _prettierrc} +1 -1
- package/index.js +50 -12
- package/package.json +2 -1
- package/templates/blocklet-page-static/package.json +1 -1
- package/templates/express-api/api/index.js +1 -1
- package/templates/express-api/package.json +4 -4
- package/templates/html-static/app/favicon.ico +0 -0
- package/templates/html-static/app/images/logo.svg +17 -0
- package/templates/html-static/app/index.html +39 -0
- package/templates/html-static/app/styles/style.css +67 -0
- package/templates/html-static/blocklet.md +3 -0
- package/templates/html-static/blocklet.yml +48 -0
- package/templates/html-static/package.json +13 -0
- package/templates/{react-dapp/.env.local → nextjs-dapp/.env} +0 -0
- package/templates/nextjs-dapp/api/index.js +1 -1
- package/templates/nextjs-dapp/package.json +13 -13
- package/templates/react-dapp/.env +0 -1
- package/templates/react-dapp/api/index.js +1 -6
- package/templates/react-dapp/craco.config.js +5 -3
- package/templates/react-dapp/package.json +11 -11
- package/templates/react-gun-dapp/.env +0 -1
- package/templates/react-gun-dapp/api/index.js +1 -6
- package/templates/react-gun-dapp/craco.config.js +6 -4
- package/templates/react-gun-dapp/package.json +13 -13
- package/templates/react-static/craco.config.js +1 -1
- package/templates/react-static/package.json +6 -6
- package/templates/solidjs-dapp/.env +1 -0
- package/templates/solidjs-dapp/.eslintrc.js +17 -0
- package/templates/solidjs-dapp/README.md +147 -0
- package/templates/solidjs-dapp/api/hooks/pre-start.js +33 -0
- package/templates/solidjs-dapp/api/index.js +50 -0
- package/templates/solidjs-dapp/api/libs/auth.js +22 -0
- package/templates/solidjs-dapp/api/libs/env.js +6 -0
- package/templates/solidjs-dapp/api/libs/logger.js +3 -0
- package/templates/solidjs-dapp/api/routes/index.js +6 -0
- package/templates/solidjs-dapp/blocklet.md +3 -0
- package/templates/solidjs-dapp/blocklet.yml +49 -0
- package/templates/solidjs-dapp/index.html +17 -0
- package/templates/solidjs-dapp/package.json +63 -0
- package/templates/solidjs-dapp/src/App.jsx +24 -0
- package/templates/solidjs-dapp/src/App.module.css +33 -0
- package/templates/solidjs-dapp/src/assets/favicon.ico +0 -0
- package/templates/solidjs-dapp/src/index.css +13 -0
- package/templates/solidjs-dapp/src/index.jsx +7 -0
- package/templates/solidjs-dapp/src/logo.svg +1 -0
- package/templates/solidjs-dapp/vite.config.js +36 -0
- package/templates/solidjs-static/.env +1 -0
- package/templates/solidjs-static/.eslintrc.js +9 -0
- package/templates/solidjs-static/README.md +147 -0
- package/templates/solidjs-static/blocklet.md +3 -0
- package/templates/solidjs-static/blocklet.yml +49 -0
- package/templates/solidjs-static/index.html +17 -0
- package/templates/solidjs-static/package.json +43 -0
- package/templates/solidjs-static/src/App.jsx +24 -0
- package/templates/solidjs-static/src/App.module.css +33 -0
- package/templates/solidjs-static/src/assets/favicon.ico +0 -0
- package/templates/solidjs-static/src/index.css +13 -0
- package/templates/solidjs-static/src/index.jsx +7 -0
- package/templates/solidjs-static/src/logo.svg +1 -0
- package/templates/solidjs-static/vite.config.js +32 -0
- package/templates/svelte-dapp/.browserslistrc +4 -0
- package/templates/svelte-dapp/.env +1 -0
- package/templates/svelte-dapp/.eslintrc.js +22 -0
- package/templates/svelte-dapp/.vscode/extensions.json +3 -0
- package/templates/svelte-dapp/README.md +146 -0
- package/templates/svelte-dapp/api/hooks/pre-start.js +33 -0
- package/templates/svelte-dapp/api/index.js +50 -0
- package/templates/svelte-dapp/api/libs/auth.js +22 -0
- package/templates/svelte-dapp/api/libs/env.js +6 -0
- package/templates/svelte-dapp/api/libs/logger.js +3 -0
- package/templates/svelte-dapp/api/routes/index.js +6 -0
- package/templates/svelte-dapp/blocklet.md +3 -0
- package/templates/svelte-dapp/blocklet.yml +49 -0
- package/templates/svelte-dapp/index.html +16 -0
- package/templates/svelte-dapp/jsconfig.json +34 -0
- package/templates/svelte-dapp/package.json +59 -0
- package/templates/svelte-dapp/src/App.svelte +64 -0
- package/templates/svelte-dapp/src/assets/svelte.png +0 -0
- package/templates/svelte-dapp/src/lib/Counter.svelte +34 -0
- package/templates/svelte-dapp/src/main.js +7 -0
- package/templates/svelte-dapp/src/vite-env.d.ts +2 -0
- package/templates/svelte-dapp/vite.config.js +33 -0
- package/templates/svelte-static/.browserslistrc +4 -0
- package/templates/svelte-static/.env +1 -0
- package/templates/svelte-static/.eslintrc.js +22 -0
- package/templates/svelte-static/.vscode/extensions.json +3 -0
- package/templates/svelte-static/README.md +146 -0
- package/templates/svelte-static/blocklet.md +3 -0
- package/templates/svelte-static/blocklet.yml +49 -0
- package/templates/svelte-static/index.html +16 -0
- package/templates/svelte-static/jsconfig.json +34 -0
- package/templates/svelte-static/package.json +40 -0
- package/templates/svelte-static/src/App.svelte +64 -0
- package/templates/svelte-static/src/assets/svelte.png +0 -0
- package/templates/svelte-static/src/lib/Counter.svelte +34 -0
- package/templates/svelte-static/src/main.js +7 -0
- package/templates/svelte-static/src/vite-env.d.ts +2 -0
- package/templates/svelte-static/vite.config.js +29 -0
- package/templates/vue-dapp/api/index.js +1 -6
- package/templates/vue-dapp/index.html +1 -1
- package/templates/vue-dapp/package.json +15 -15
- package/templates/vue-dapp/vite.config.js +8 -4
- package/templates/vue-static/README.md +0 -1
- package/templates/vue-static/package.json +9 -9
- package/templates/vue-static/vite.config.js +5 -3
- package/templates/vue2-dapp/api/index.js +1 -6
- package/templates/vue2-dapp/package.json +16 -16
- package/templates/vue2-dapp/vue.config.js +5 -2
- package/templates/vue2-static/package.json +8 -8
- package/templates/vue2-static/vue.config.js +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,8 @@ Currently supported template presets include:
|
|
|
36
36
|
- `react`
|
|
37
37
|
- `vue3 + vite`
|
|
38
38
|
- `vue2 + @vue/cli`
|
|
39
|
+
- `solid-js`
|
|
40
|
+
- `svelte`
|
|
39
41
|
- `next.js`
|
|
40
42
|
- `react + gunjs`
|
|
41
43
|
|
|
@@ -44,7 +46,10 @@ Currently supported template presets include:
|
|
|
44
46
|
- `react`
|
|
45
47
|
- `vue3 + vite`
|
|
46
48
|
- `vue2 + @vue/cli`
|
|
49
|
+
- `solid-js`
|
|
50
|
+
- `svelte`
|
|
47
51
|
- `blocklet page`
|
|
52
|
+
- `html`
|
|
48
53
|
|
|
49
54
|
**api**
|
|
50
55
|
- `express`
|
|
@@ -39,7 +39,8 @@ if [ -f $VERSION ]; then
|
|
|
39
39
|
echo -e "${NOTICE_FLAG} Will set new version to be ${WHITE}$INPUT_STRING"
|
|
40
40
|
echo $INPUT_STRING >$VERSION
|
|
41
41
|
|
|
42
|
-
echo "## $INPUT_STRING ($NOW)
|
|
42
|
+
echo "## $INPUT_STRING ($NOW)" >tmpfile
|
|
43
|
+
echo "" >>tmpfile
|
|
43
44
|
git log --pretty=format:"- %s" "$BASE_STRING"...HEAD >>tmpfile
|
|
44
45
|
echo "" >>tmpfile
|
|
45
46
|
echo "" >>tmpfile
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# For more information about the properties used in
|
|
2
|
+
# this file, please see the EditorConfig documentation:
|
|
3
|
+
# http://editorconfig.org/
|
|
4
|
+
#
|
|
5
|
+
# Sensible EditorConfig defaults
|
|
6
|
+
# https://gist.github.com/matijs/662bf45dd4ec37b3a068
|
|
7
|
+
root = true
|
|
8
|
+
|
|
9
|
+
[*]
|
|
10
|
+
charset = utf-8
|
|
11
|
+
end_of_line = lf
|
|
12
|
+
indent_size = 2
|
|
13
|
+
indent_style = space
|
|
14
|
+
insert_final_newline = true
|
|
15
|
+
trim_trailing_whitespace = true
|
|
16
|
+
|
|
17
|
+
# Make sure package.json always uses 2 spaces to indent
|
|
18
|
+
[{package.json}]
|
|
19
|
+
indent_size = 2
|
|
20
|
+
indent_style = space
|
|
21
|
+
|
|
22
|
+
[{makefile, Makefile}]
|
|
23
|
+
indent_style = tab
|
package/common/_gitignore
CHANGED
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
2
|
|
|
3
3
|
# dependencies
|
|
4
|
-
|
|
4
|
+
.pnp
|
|
5
5
|
.pnp.js
|
|
6
6
|
.DS_Store
|
|
7
7
|
node_modules
|
|
8
8
|
|
|
9
9
|
# testing
|
|
10
|
-
|
|
10
|
+
coverage
|
|
11
11
|
|
|
12
12
|
# production
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
build
|
|
14
|
+
dist
|
|
15
|
+
dist-ssr
|
|
15
16
|
.blocklet
|
|
16
17
|
|
|
17
18
|
# local env files
|
|
18
|
-
|
|
19
|
-
.env.*.local
|
|
19
|
+
*.local
|
|
20
20
|
|
|
21
21
|
# Log files
|
|
22
|
+
logs
|
|
23
|
+
*.log
|
|
22
24
|
npm-debug.log*
|
|
23
25
|
yarn-debug.log*
|
|
24
26
|
yarn-error.log*
|
|
25
27
|
pnpm-debug.log*
|
|
26
|
-
|
|
27
|
-
# Editor directories and files
|
|
28
|
-
.idea
|
|
29
|
-
.vscode
|
|
30
|
-
*.suo
|
|
31
|
-
*.ntvs*
|
|
32
|
-
*.njsproj
|
|
33
|
-
*.sln
|
|
34
|
-
*.sw?
|
|
35
|
-
|
|
28
|
+
lerna-debug.log*
|
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { cd, argv, fs, YAML, chalk, path } from 'zx';
|
|
|
8
8
|
import ora from 'ora';
|
|
9
9
|
import prompts from 'prompts';
|
|
10
10
|
import * as envfile from 'envfile';
|
|
11
|
+
import getPort from 'get-port';
|
|
11
12
|
|
|
12
13
|
import { echoBrand, echoDocument } from './lib/arcblock.js';
|
|
13
14
|
import { getUser } from './lib/index.js';
|
|
@@ -15,7 +16,7 @@ import { checkServerInstalled, checkServerRunning, checkSatisfiedVersion, getSer
|
|
|
15
16
|
import { toBlockletDid } from './lib/did.js';
|
|
16
17
|
import { initGitRepo } from './lib/git.js';
|
|
17
18
|
|
|
18
|
-
const { yellow, red, green, cyan, blue, bold } = chalk;
|
|
19
|
+
const { yellow, red, green, cyan, blue, bold, magenta } = chalk;
|
|
19
20
|
|
|
20
21
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
21
22
|
|
|
@@ -31,6 +32,11 @@ const TYPES = [
|
|
|
31
32
|
display: 'react',
|
|
32
33
|
color: yellow,
|
|
33
34
|
},
|
|
35
|
+
{
|
|
36
|
+
name: 'solidjs',
|
|
37
|
+
display: 'solidjs',
|
|
38
|
+
color: yellow,
|
|
39
|
+
},
|
|
34
40
|
{
|
|
35
41
|
name: 'vue',
|
|
36
42
|
display: 'vue3 + vite',
|
|
@@ -41,6 +47,11 @@ const TYPES = [
|
|
|
41
47
|
display: 'vue2 + @vue/cli',
|
|
42
48
|
color: green,
|
|
43
49
|
},
|
|
50
|
+
{
|
|
51
|
+
name: 'svelte',
|
|
52
|
+
display: 'svelte',
|
|
53
|
+
color: magenta,
|
|
54
|
+
},
|
|
44
55
|
{
|
|
45
56
|
name: 'nextjs',
|
|
46
57
|
display: 'next.js',
|
|
@@ -62,6 +73,11 @@ const TYPES = [
|
|
|
62
73
|
display: 'react',
|
|
63
74
|
color: yellow,
|
|
64
75
|
},
|
|
76
|
+
{
|
|
77
|
+
name: 'solidjs',
|
|
78
|
+
display: 'solidjs',
|
|
79
|
+
color: yellow,
|
|
80
|
+
},
|
|
65
81
|
{
|
|
66
82
|
name: 'vue',
|
|
67
83
|
display: 'vue3 + vite',
|
|
@@ -72,11 +88,21 @@ const TYPES = [
|
|
|
72
88
|
display: 'vue2 + @vue/cli',
|
|
73
89
|
color: green,
|
|
74
90
|
},
|
|
91
|
+
{
|
|
92
|
+
name: 'svelte',
|
|
93
|
+
display: 'svelte',
|
|
94
|
+
color: magenta,
|
|
95
|
+
},
|
|
75
96
|
{
|
|
76
97
|
name: 'blocklet-page',
|
|
77
98
|
display: 'blocklet page',
|
|
78
99
|
color: blue,
|
|
79
100
|
},
|
|
101
|
+
{
|
|
102
|
+
name: 'html',
|
|
103
|
+
display: 'html',
|
|
104
|
+
color: blue,
|
|
105
|
+
},
|
|
80
106
|
],
|
|
81
107
|
},
|
|
82
108
|
{
|
|
@@ -97,6 +123,8 @@ const renameFiles = {
|
|
|
97
123
|
'_eslintrc.js': '.eslintrc.js',
|
|
98
124
|
_eslintignore: '.eslintignore',
|
|
99
125
|
_npmrc: '.npmrc',
|
|
126
|
+
_editorconfig: '.editorconfig',
|
|
127
|
+
_prettierrc: '.prettierrc',
|
|
100
128
|
};
|
|
101
129
|
|
|
102
130
|
async function init() {
|
|
@@ -279,8 +307,16 @@ async function init() {
|
|
|
279
307
|
modifyBlockletMd((md) => {
|
|
280
308
|
return md.replace(/# template-react/g, `# ${name}`);
|
|
281
309
|
});
|
|
282
|
-
|
|
283
|
-
|
|
310
|
+
|
|
311
|
+
let randomPort;
|
|
312
|
+
if (['dapp'].includes(type)) {
|
|
313
|
+
randomPort = await getPort();
|
|
314
|
+
}
|
|
315
|
+
modifyEnv((env) => {
|
|
316
|
+
if (randomPort) {
|
|
317
|
+
env.API_PORT = randomPort;
|
|
318
|
+
}
|
|
319
|
+
if (!['blocklet-page'].includes(framework)) {
|
|
284
320
|
if (['react'].includes(framework)) {
|
|
285
321
|
env.REACT_APP_TITLE = name;
|
|
286
322
|
} else if (['vue', 'blocklet-page'].includes(framework)) {
|
|
@@ -288,9 +324,9 @@ async function init() {
|
|
|
288
324
|
} else {
|
|
289
325
|
env.APP_TITLE = name;
|
|
290
326
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
327
|
+
}
|
|
328
|
+
return env;
|
|
329
|
+
});
|
|
294
330
|
|
|
295
331
|
// patch blocklet author
|
|
296
332
|
modifyBlockletYaml(async (yamlConfig) => {
|
|
@@ -305,10 +341,14 @@ async function init() {
|
|
|
305
341
|
yamlConfig.did = did;
|
|
306
342
|
});
|
|
307
343
|
modifyPackage((pkg) => {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
344
|
+
try {
|
|
345
|
+
if (type === 'dapp') {
|
|
346
|
+
pkg.scripts['bundle:client'] = ejs.render(pkg.scripts['bundle:client'], { did });
|
|
347
|
+
} else if (type === 'static') {
|
|
348
|
+
pkg.scripts.bundle = ejs.render(pkg.scripts.bundle, { did });
|
|
349
|
+
}
|
|
350
|
+
} catch {
|
|
351
|
+
console.info('\nNo need to patch bundle script\n');
|
|
312
352
|
}
|
|
313
353
|
});
|
|
314
354
|
// disabled random logo
|
|
@@ -383,11 +423,9 @@ async function init() {
|
|
|
383
423
|
execSync('blocklet dev', { stdio: 'inherit' });
|
|
384
424
|
} else {
|
|
385
425
|
console.log();
|
|
386
|
-
console.log();
|
|
387
426
|
}
|
|
388
427
|
} else {
|
|
389
428
|
console.log();
|
|
390
|
-
console.log();
|
|
391
429
|
}
|
|
392
430
|
|
|
393
431
|
if (!isServerInstalled) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-blocklet",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"exports": "./index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "git@github.com:blocklet/create-blocklet.git",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"ejs": "^3.1.6",
|
|
37
37
|
"envfile": "^6.17.0",
|
|
38
38
|
"figlet": "^1.5.2",
|
|
39
|
+
"get-port": "^6.1.2",
|
|
39
40
|
"gradient-string": "^2.0.0",
|
|
40
41
|
"jdenticon": "^3.1.1",
|
|
41
42
|
"ora": "^6.1.0",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@arcblock/did-auth-storage-nedb": "^1.6.3",
|
|
18
|
-
"@blocklet/sdk": "^1.7.
|
|
19
|
-
"@ocap/client": "^1.
|
|
18
|
+
"@blocklet/sdk": "^1.7.9",
|
|
19
|
+
"@ocap/client": "^1.16.4",
|
|
20
20
|
"dotenv-flow": "^3.2.0",
|
|
21
|
-
"express": "^4.
|
|
21
|
+
"express": "^4.18.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"nodemon": "^2.0.
|
|
24
|
+
"nodemon": "^2.0.16"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg width="204" height="64" viewBox="0 0 204 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M80 44.5707V20H91.8859C95.101 20 97.7075 22.6064 97.7075 25.8216V27.5875C97.7075 29.135 97.1037 30.5414 96.1188 31.5841C97.8642 32.5893 99.0393 34.4737 99.0393 36.6325V38.7491C99.0393 41.9643 96.4328 44.5707 93.2177 44.5707H80ZM82.5874 30.8109H92.1522C93.8138 30.6754 95.1201 29.284 95.1201 27.5875V25.8216C95.1201 24.0354 93.6721 22.5874 91.8859 22.5874H82.5874V30.8109ZM82.5874 41.9833V33.4091L93.2177 33.3983C95.0039 33.3983 96.4519 34.8463 96.4519 36.6325V38.7491C96.4519 40.5353 95.0039 41.9833 93.2177 41.9833H82.5874ZM106.501 20V44.5707H103.794V20H106.501ZM119.917 26.6346H117.11C113.877 26.6346 111.256 29.2555 111.256 32.4885V38.7167C111.256 41.9498 113.877 44.5707 117.11 44.5707H119.917C123.15 44.5707 125.771 41.9498 125.771 38.7167V32.4885C125.771 29.2555 123.15 26.6346 119.917 26.6346ZM117.11 29.3416C115.372 29.3416 113.963 30.7505 113.963 32.4885V38.7167C113.963 40.4547 115.372 41.8636 117.11 41.8636H119.917C121.655 41.8636 123.064 40.4547 123.064 38.7167V32.4885C123.064 30.7505 121.655 29.3416 119.917 29.3416H117.11ZM149.437 44.5801V35.7411H152.738L157.841 44.5801H160.967L155.097 34.413L159.695 26.4493H156.569L152.767 33.0341H149.437V20H146.73V44.5801H149.437ZM140.902 32.9673V32.4885C140.902 30.7505 139.493 29.3416 137.755 29.3416H134.948C133.21 29.3416 131.801 30.7505 131.801 32.4885V38.7167C131.801 40.4547 133.21 41.8636 134.948 41.8636H137.755C139.493 41.8636 140.902 40.4547 140.902 38.7167V38.2379H143.609V38.7167C143.609 41.9498 140.988 44.5707 137.755 44.5707H134.948C131.715 44.5707 129.094 41.9498 129.094 38.7167V32.4885C129.094 29.2555 131.715 26.6346 134.948 26.6346H137.755C140.988 26.6346 143.609 29.2555 143.609 32.4885V32.9673H140.902ZM168.429 44.5707V20H165.722V44.5707H168.429ZM176.094 36.342V38.7167C176.094 40.4547 177.502 41.8636 179.24 41.8636H182.047C183.785 41.8636 185.194 40.4547 185.194 38.7167V38.2379H187.901V38.7167C187.901 41.9498 185.281 44.5707 182.047 44.5707H179.24C176.007 44.5707 173.386 41.9498 173.386 38.7167V32.4885C173.386 29.2555 176.007 26.6346 179.24 26.6346H182.047C185.281 26.6346 187.901 29.2555 187.901 32.4885V33.635V35.3244V36.342H176.094ZM185.194 33.635H176.094V32.4885C176.094 30.7505 177.502 29.3416 179.24 29.3416H182.047C183.785 29.3416 185.194 30.7505 185.194 32.4885V33.635ZM193.626 30.6973H191.217V27.9903H193.626V23.6154H196.214V27.9903H202.477V30.6973H196.214V39.4188C196.214 40.8351 197.362 41.9833 198.778 41.9833C200.194 41.9833 201.343 40.8351 201.343 39.4188V38.8802H203.93V39.4188C203.93 42.2641 201.623 44.5707 198.778 44.5707C195.933 44.5707 193.626 42.2641 193.626 39.4188V30.6973Z" fill="black"/>
|
|
3
|
+
<path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M49.12 10.6348L30.7 0L12.28 10.6348V24.7781L0 31.868V53.1375L18.42 63.7723L30.6702 56.6997L30.7 56.7169L30.7298 56.6997L42.98 63.7723L61.4 53.1375V31.868L49.12 24.7781V10.6348ZM59.4813 32.9757L47.2013 25.8859V11.7426L30.7 2.21558L14.1988 11.7426V25.8859L1.91875 32.9757V52.0297L18.42 61.5568L30.6702 54.4841L30.7 54.5013L30.7298 54.4841L42.98 61.5568L59.4813 52.0297V32.9757Z" fill="url(#paint0_linear_898_1378)"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.6998 14.1797L49.1198 24.8145V46.0841L30.6998 56.7189L12.2798 46.0841V24.8145L30.6998 14.1797ZM15.1579 25.3684L29.7404 33.7876V16.9492L15.1579 25.3684ZM28.781 35.4493L14.1985 27.0301V43.8685L28.781 35.4493ZM31.6592 37.111L46.2417 45.5302L31.6592 53.9494V37.111ZM47.201 43.8685L32.6185 35.4493L47.201 27.0301V43.8685ZM29.7404 53.9494L15.1579 45.5302L29.7404 37.111V53.9494ZM31.6592 16.9492L46.2417 25.3684L31.6592 33.7876V16.9492Z" fill="url(#paint1_linear_898_1378)"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_898_1378" x1="30.7" y1="-31.8862" x2="-33.0265" y2="29.4697" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#4EF1BA"/>
|
|
8
|
+
<stop offset="0.501904" stop-color="#16CED1"/>
|
|
9
|
+
<stop offset="1" stop-color="#3773F2"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
<linearGradient id="paint1_linear_898_1378" x1="33.1078" y1="-37.1138" x2="-37.2973" y2="18.5071" gradientUnits="userSpaceOnUse">
|
|
12
|
+
<stop stop-color="#4EF1BA"/>
|
|
13
|
+
<stop offset="0.501904" stop-color="#16CED1"/>
|
|
14
|
+
<stop offset="1" stop-color="#3773F2"/>
|
|
15
|
+
</linearGradient>
|
|
16
|
+
</defs>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<link rel="stylesheet" href="./styles/style.css" />
|
|
8
|
+
<title>HTML Template</title>
|
|
9
|
+
<script src="__meta__.js"></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app">
|
|
13
|
+
<section class="body">
|
|
14
|
+
<div class="logo">
|
|
15
|
+
<img src="./images/logo.svg" alt="logo" />
|
|
16
|
+
<p>Get started by edit <code class="code">app/index.html</code> file</p>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="card-list">
|
|
19
|
+
<a class="card" href="https://docs.arcblock.io/abtnode/en/blocklet" target="_blank">
|
|
20
|
+
<h3>Documentation →</h3>
|
|
21
|
+
<p>Find in-depth information about blocklet features and API.</p>
|
|
22
|
+
</a>
|
|
23
|
+
<a class="card" href="https://docs.arcblock.io/abtnode/en/introduction" target="_blank">
|
|
24
|
+
<h3>Blocklet Server →</h3>
|
|
25
|
+
<p>Learn about Blocklet Server</p>
|
|
26
|
+
</a>
|
|
27
|
+
</div>
|
|
28
|
+
<br />
|
|
29
|
+
<br />
|
|
30
|
+
</section>
|
|
31
|
+
<footer class="footer">
|
|
32
|
+
Powered by
|
|
33
|
+
<a href="http://www.arcblock.io/" target="_blank">
|
|
34
|
+
<strong>ArcBlock</strong>
|
|
35
|
+
</a>
|
|
36
|
+
</footer>
|
|
37
|
+
</div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
a {
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
color: initial;
|
|
9
|
+
}
|
|
10
|
+
#app {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 100vh;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.body {
|
|
17
|
+
flex: 1;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
}
|
|
23
|
+
.logo {
|
|
24
|
+
font-size: 18px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.footer {
|
|
28
|
+
height: 80px;
|
|
29
|
+
line-height: 80px;
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
}
|
|
33
|
+
.card-list {
|
|
34
|
+
display: flex;
|
|
35
|
+
margin-top: 30px;
|
|
36
|
+
gap: 40px;
|
|
37
|
+
padding: 20px;
|
|
38
|
+
}
|
|
39
|
+
.card {
|
|
40
|
+
border: 1px solid #e7e7e7;
|
|
41
|
+
border-radius: 6px;
|
|
42
|
+
padding: 0 25px;
|
|
43
|
+
flex: 1;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
color: initial;
|
|
46
|
+
font-size: 18px;
|
|
47
|
+
}
|
|
48
|
+
.card:hover {
|
|
49
|
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
|
|
50
|
+
}
|
|
51
|
+
.card h3 {
|
|
52
|
+
font-size: 24px;
|
|
53
|
+
}
|
|
54
|
+
.code {
|
|
55
|
+
background: #fafafa;
|
|
56
|
+
border-radius: 5px;
|
|
57
|
+
padding: 0.75rem;
|
|
58
|
+
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New,
|
|
59
|
+
monospace;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (max-width: 768px) {
|
|
63
|
+
.card-list {
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: 20px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: template-html
|
|
2
|
+
title: Blocklet Template HTML
|
|
3
|
+
description: A Blocklet Server blocklet
|
|
4
|
+
keywords:
|
|
5
|
+
- blocklet
|
|
6
|
+
- html
|
|
7
|
+
- static
|
|
8
|
+
group: static
|
|
9
|
+
did: ''
|
|
10
|
+
main: app
|
|
11
|
+
author:
|
|
12
|
+
name: Blocklet
|
|
13
|
+
email: blocklet@arcblock.io
|
|
14
|
+
repository:
|
|
15
|
+
type: git
|
|
16
|
+
url: 'git+https://github.com/blocklet/create-blocklet.git'
|
|
17
|
+
specVersion: 1.1.1
|
|
18
|
+
version: 0.1.0
|
|
19
|
+
logo: logo.png
|
|
20
|
+
files:
|
|
21
|
+
- logo.png
|
|
22
|
+
- README.md
|
|
23
|
+
- blocklet.md
|
|
24
|
+
- screenshots
|
|
25
|
+
interfaces:
|
|
26
|
+
- type: web
|
|
27
|
+
name: publicUrl
|
|
28
|
+
path: /
|
|
29
|
+
prefix: '*'
|
|
30
|
+
port: BLOCKLET_PORT
|
|
31
|
+
protocol: http
|
|
32
|
+
community: ''
|
|
33
|
+
documentation: ''
|
|
34
|
+
homepage: ''
|
|
35
|
+
license: ''
|
|
36
|
+
payment:
|
|
37
|
+
price: []
|
|
38
|
+
share: []
|
|
39
|
+
timeout:
|
|
40
|
+
start: 60
|
|
41
|
+
requirements:
|
|
42
|
+
server: '>=1.6.29'
|
|
43
|
+
os: '*'
|
|
44
|
+
cpu: '*'
|
|
45
|
+
environments: []
|
|
46
|
+
capabilities: {}
|
|
47
|
+
screenshots: []
|
|
48
|
+
children: []
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-html",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"clean": "rm -rf .blocklet",
|
|
6
|
+
"release": "npm run clean && blocklet bundle --create-release",
|
|
7
|
+
"deploy": "npm run release && blocklet deploy .blocklet/bundle --skip-hooks",
|
|
8
|
+
"upload": "npm run release && blocklet upload .blocklet/release/blocklet.json"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC"
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const express = require('express');
|
|
2
2
|
const next = require('next');
|
|
3
3
|
|
|
4
|
-
const port = parseInt(process.env.BLOCKLET_PORT, 10) || 3000;
|
|
4
|
+
const port = parseInt(process.env.BLOCKLET_PORT || process.env.PORT, 10) || 3000;
|
|
5
5
|
const dev = process.env.NODE_ENV !== 'production';
|
|
6
6
|
const app = next({ dev });
|
|
7
7
|
const handle = app.getRequestHandler();
|
|
@@ -25,24 +25,24 @@
|
|
|
25
25
|
]
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@arcblock/did-auth": "^1.16.
|
|
28
|
+
"@arcblock/did-auth": "^1.16.4",
|
|
29
29
|
"@arcblock/did-auth-storage-nedb": "^1.6.3",
|
|
30
|
-
"@blocklet/sdk": "^1.7.
|
|
31
|
-
"@ocap/client": "^1.16.
|
|
32
|
-
"@ocap/mcrypto": "^1.16.
|
|
33
|
-
"@ocap/wallet": "^1.16.
|
|
30
|
+
"@blocklet/sdk": "^1.7.9",
|
|
31
|
+
"@ocap/client": "^1.16.4",
|
|
32
|
+
"@ocap/mcrypto": "^1.16.4",
|
|
33
|
+
"@ocap/wallet": "^1.16.4",
|
|
34
34
|
"dotenv-flow": "^3.2.0",
|
|
35
|
-
"express": "^4.
|
|
36
|
-
"next": "12.1.
|
|
37
|
-
"react": "
|
|
38
|
-
"react-dom": "
|
|
35
|
+
"express": "^4.18.0",
|
|
36
|
+
"next": "12.1.5",
|
|
37
|
+
"react": "18.1.0",
|
|
38
|
+
"react-dom": "18.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"eslint": "8.
|
|
42
|
-
"eslint-config-next": "12.1.
|
|
41
|
+
"eslint": "8.14.0",
|
|
42
|
+
"eslint-config-next": "12.1.5",
|
|
43
43
|
"husky": "^7.0.4",
|
|
44
|
-
"lint-staged": "^12.
|
|
45
|
-
"nodemon": "^2.0.
|
|
44
|
+
"lint-staged": "^12.4.1",
|
|
45
|
+
"nodemon": "^2.0.16",
|
|
46
46
|
"npm-run-all": "^4.1.5"
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -20,13 +20,8 @@ app.use(express.urlencoded({ extended: true, limit: '1 mb' }));
|
|
|
20
20
|
const router = express.Router();
|
|
21
21
|
router.use('/api', require('./routes'));
|
|
22
22
|
|
|
23
|
-
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
24
23
|
const isProduction = process.env.NODE_ENV === 'production' || process.env.ABT_NODE_SERVICE_ENV === 'production';
|
|
25
24
|
|
|
26
|
-
if (isDevelopment) {
|
|
27
|
-
process.env.BLOCKLET_PORT = 3030;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
if (isProduction) {
|
|
31
26
|
app.use(cors());
|
|
32
27
|
app.use(compression());
|
|
@@ -47,7 +42,7 @@ if (isProduction) {
|
|
|
47
42
|
app.use(router);
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
const port = parseInt(process.env.
|
|
45
|
+
const port = parseInt(process.env.API_PORT, 10) || 3030;
|
|
51
46
|
|
|
52
47
|
app.listen(port, (err) => {
|
|
53
48
|
if (err) throw err;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
require('dotenv-flow').config();
|
|
2
|
+
|
|
3
|
+
const port = process.env.BLOCKLET_PORT || process.env.PORT || 3000;
|
|
4
|
+
const apiPort = process.env.API_PORT || 3030;
|
|
3
5
|
|
|
4
6
|
module.exports = {
|
|
5
7
|
devServer: {
|
|
@@ -10,7 +12,7 @@ module.exports = {
|
|
|
10
12
|
},
|
|
11
13
|
proxy: {
|
|
12
14
|
'/api': {
|
|
13
|
-
target: `http://127.0.0.1:${
|
|
15
|
+
target: `http://127.0.0.1:${apiPort}`,
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
},
|
|
@@ -39,25 +39,25 @@
|
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@arcblock/did-auth": "^1.16.
|
|
42
|
+
"@arcblock/did-auth": "^1.16.4",
|
|
43
43
|
"@arcblock/did-auth-storage-nedb": "^1.6.3",
|
|
44
|
-
"@blocklet/sdk": "^1.7.
|
|
44
|
+
"@blocklet/sdk": "^1.7.9",
|
|
45
45
|
"@craco/craco": "^6.4.3",
|
|
46
|
-
"@ocap/client": "^1.16.
|
|
47
|
-
"@ocap/mcrypto": "^1.16.
|
|
48
|
-
"@ocap/wallet": "^1.16.
|
|
49
|
-
"axios": "^0.
|
|
46
|
+
"@ocap/client": "^1.16.4",
|
|
47
|
+
"@ocap/mcrypto": "^1.16.4",
|
|
48
|
+
"@ocap/wallet": "^1.16.4",
|
|
49
|
+
"axios": "^0.27.2",
|
|
50
50
|
"compression": "^1.7.4",
|
|
51
51
|
"cookie-parser": "^1.4.6",
|
|
52
52
|
"cors": "^2.8.5",
|
|
53
53
|
"dotenv-flow": "^3.2.0",
|
|
54
|
-
"express": "^4.
|
|
54
|
+
"express": "^4.18.0",
|
|
55
55
|
"express-async-errors": "^3.1.1",
|
|
56
56
|
"express-history-api-fallback": "^2.2.1",
|
|
57
57
|
"react": "^17.0.2",
|
|
58
58
|
"react-dom": "^17.0.2",
|
|
59
|
-
"react-router-dom": "^6.
|
|
60
|
-
"react-scripts": "5.0.
|
|
59
|
+
"react-router-dom": "^6.3.0",
|
|
60
|
+
"react-scripts": "5.0.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@arcblock/eslint-config": "^0.1.8",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
73
73
|
"eslint-plugin-unicorn": "^34.0.1",
|
|
74
74
|
"husky": "^7.0.4",
|
|
75
|
-
"lint-staged": "^12.
|
|
76
|
-
"nodemon": "^2.0.
|
|
75
|
+
"lint-staged": "^12.4.1",
|
|
76
|
+
"nodemon": "^2.0.16",
|
|
77
77
|
"npm-run-all": "^4.1.5",
|
|
78
78
|
"prettier": "^2.6.0"
|
|
79
79
|
}
|