create-blocklet 0.9.27 → 0.9.28
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/index.js +2 -2
- package/package.json +1 -1
- package/templates/component-studio/biome.json +2 -19
- package/templates/component-studio/package.json +4 -2
- package/templates/component-studio/scripts/init-component-studio.mjs +15 -0
- package/templates/did-connect-dapp/package.json +1 -1
- package/templates/did-wallet-dapp/package.json +1 -1
- package/templates/react-aigne-dapp/package.json +1 -1
- package/templates/react-dapp/package.json +1 -1
- package/templates/react-dapp-ts/package.json +1 -1
- package/templates/react-gun-dapp/package.json +1 -1
- package/templates/react-static/package.json +1 -1
- package/templates/solidjs-dapp/package.json +1 -1
- package/templates/solidjs-static/package.json +1 -1
- package/templates/svelte-dapp/package.json +1 -1
- package/templates/svelte-static/package.json +1 -1
- package/templates/todo-list-example/package.json +1 -1
- package/templates/vue-dapp/package.json +1 -1
- package/templates/vue-static/package.json +1 -1
- package/templates/vue-ts-static/package.json +1 -1
- package/templates/vue2-dapp/package.json +1 -1
- package/templates/vue2-static/package.json +1 -1
package/index.js
CHANGED
|
@@ -609,7 +609,7 @@ async function init() {
|
|
|
609
609
|
|
|
610
610
|
await initGitRepo(root);
|
|
611
611
|
|
|
612
|
-
let defaultAgent = '
|
|
612
|
+
let defaultAgent = 'pnpm';
|
|
613
613
|
const agentList = ['npm', 'yarn', 'pnpm'];
|
|
614
614
|
|
|
615
615
|
// switch (templateNames) {
|
|
@@ -686,7 +686,7 @@ async function init() {
|
|
|
686
686
|
|
|
687
687
|
if (!hasStart) {
|
|
688
688
|
// console.log(dim('\n start it later by:\n'));
|
|
689
|
-
if (root !== cwd) console.log(blue(`
|
|
689
|
+
if (root !== cwd) console.log(blue(`cd ${bold(related)}`));
|
|
690
690
|
if (mainBlocklet) {
|
|
691
691
|
console.log(blue('npm run init'));
|
|
692
692
|
} else {
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"useKeyWithClickEvents": "off",
|
|
23
23
|
"useValidAnchor": "off",
|
|
24
24
|
"noSvgWithoutTitle": "off",
|
|
25
|
-
"
|
|
25
|
+
"useKeyWithMouseEvents": "off"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"ignore": ["**/node_modules/**", "*.md"]
|
|
@@ -31,23 +31,6 @@
|
|
|
31
31
|
"enabled": true,
|
|
32
32
|
"indentStyle": "space",
|
|
33
33
|
"indentWidth": 2,
|
|
34
|
-
"lineWidth": 100
|
|
35
|
-
"include": ["**/*.{js,jsx,ts,tsx,json,css,less,scss,graphql}"]
|
|
36
|
-
},
|
|
37
|
-
"javascript": {
|
|
38
|
-
"formatter": {
|
|
39
|
-
"quoteStyle": "single",
|
|
40
|
-
"trailingComma": "es5",
|
|
41
|
-
"semicolons": "always"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"json": {
|
|
45
|
-
"parser": {
|
|
46
|
-
"allowComments": true,
|
|
47
|
-
"allowTrailingCommas": true
|
|
48
|
-
},
|
|
49
|
-
"formatter": {
|
|
50
|
-
"enabled": true
|
|
51
|
-
}
|
|
34
|
+
"lineWidth": 100
|
|
52
35
|
}
|
|
53
36
|
}
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"express-async-errors": "^3.1.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@biomejs/biome": "1.
|
|
74
|
+
"@biomejs/biome": "^1.9.4",
|
|
75
75
|
"@blocklet/js-sdk": "^1.16.40",
|
|
76
76
|
"@types/cookie-parser": "^1.4.8",
|
|
77
77
|
"@types/cors": "^2.8.17",
|
|
@@ -81,8 +81,10 @@
|
|
|
81
81
|
"@types/react": "^18.3.18",
|
|
82
82
|
"@types/react-dom": "^18.3.5",
|
|
83
83
|
"@vitejs/plugin-react": "^4.3.4",
|
|
84
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
84
85
|
"bumpp": "^9.9.3",
|
|
85
86
|
"cross-env": "^7.0.3",
|
|
87
|
+
"get-port": "^5.1.1",
|
|
86
88
|
"import-sort-style-module": "^6.0.0",
|
|
87
89
|
"lint-staged": "^15.3.0",
|
|
88
90
|
"nodemon": "^3.1.9",
|
|
@@ -95,7 +97,7 @@
|
|
|
95
97
|
"typescript": "^5.7.2",
|
|
96
98
|
"vite": "^5.4.11",
|
|
97
99
|
"vite-node": "^2.1.8",
|
|
98
|
-
"vite-plugin-blocklet": "^0.9.
|
|
100
|
+
"vite-plugin-blocklet": "^0.9.28",
|
|
99
101
|
"vite-plugin-require": "^1.2.14",
|
|
100
102
|
"vite-plugin-svgr": "^4.3.0",
|
|
101
103
|
"vite-tsconfig-paths": "^4.3.2",
|
|
@@ -2,17 +2,32 @@
|
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
|
+
import getPort from 'get-port';
|
|
5
6
|
|
|
6
7
|
const flagFile = path.join(process.cwd(), '.init-component-studio');
|
|
7
8
|
|
|
9
|
+
// write the BLOCKLET_PORT to .env.development.local
|
|
10
|
+
async function ensureBlockletPortToDevEnv() {
|
|
11
|
+
if (fs.existsSync(path.join(process.cwd(), '.env.development.local'))) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const port = await getPort({ port: 8118 });
|
|
16
|
+
fs.writeFileSync(path.join(process.cwd(), '.env.development.local'), `BLOCKLET_PORT=${port}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
// check the flag file is exists
|
|
9
20
|
if (fs.existsSync(flagFile)) {
|
|
10
21
|
try {
|
|
11
22
|
// remove flag file to avoid infinite loop
|
|
12
23
|
fs.unlinkSync(flagFile);
|
|
24
|
+
|
|
13
25
|
// execute update:deps script
|
|
14
26
|
console.log('auto updating dependencies...');
|
|
15
27
|
execSync('pnpm run update:deps', { stdio: 'inherit' });
|
|
28
|
+
|
|
29
|
+
// write the BLOCKLET_PORT to .env.development.local
|
|
30
|
+
ensureBlockletPortToDevEnv();
|
|
16
31
|
} catch (error) {
|
|
17
32
|
process.exit(1);
|
|
18
33
|
}
|