create-blocklet 0.4.71 → 0.4.72
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/{_editorconfig → .editorconfig} +0 -0
- package/common/{_prettierrc → .prettierrc} +0 -0
- package/index.js +7 -17
- package/package.json +1 -1
- package/templates/react-dapp/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/vue-dapp/package.json +1 -1
- package/templates/vue-static/package.json +1 -1
- package/common/_gitignore +0 -28
- package/common/_npmrc +0 -3
|
File without changes
|
|
File without changes
|
package/index.js
CHANGED
|
@@ -16,7 +16,6 @@ import { checkServerInstalled, checkServerRunning, checkSatisfiedVersion, getSer
|
|
|
16
16
|
import { toBlockletDid } from './lib/did.js';
|
|
17
17
|
import { initGitRepo } from './lib/git.js';
|
|
18
18
|
import {
|
|
19
|
-
copy,
|
|
20
19
|
emptyDir,
|
|
21
20
|
isEmpty,
|
|
22
21
|
isValidPackageName,
|
|
@@ -115,12 +114,7 @@ const templates = [
|
|
|
115
114
|
},
|
|
116
115
|
];
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
_gitignore: '.gitignore',
|
|
120
|
-
_npmrc: '.npmrc',
|
|
121
|
-
_editorconfig: '.editorconfig',
|
|
122
|
-
_prettierrc: '.prettierrc',
|
|
123
|
-
};
|
|
117
|
+
|
|
124
118
|
|
|
125
119
|
async function init() {
|
|
126
120
|
const { version } = await fs.readJSONSync(path.resolve(__dirname, 'package.json'));
|
|
@@ -266,7 +260,7 @@ async function init() {
|
|
|
266
260
|
if (mainBlocklet) {
|
|
267
261
|
await checkLerna();
|
|
268
262
|
await checkYarn();
|
|
269
|
-
|
|
263
|
+
fs.copySync(path.join(__dirname, 'templates', 'monorepo'), root);
|
|
270
264
|
}
|
|
271
265
|
|
|
272
266
|
for (const templateName of templateNames) {
|
|
@@ -279,7 +273,7 @@ async function init() {
|
|
|
279
273
|
const commonFiles = fs.readdirSync(commonDir);
|
|
280
274
|
for (const file of commonFiles) {
|
|
281
275
|
// 如果选择多个模板,每个子 package 中 只会包含必要的 文件
|
|
282
|
-
if (mainBlocklet && !['screenshots', 'public', 'logo.png', '
|
|
276
|
+
if (mainBlocklet && !['screenshots', 'public', 'logo.png', '.prettierrc'].includes(file)) {
|
|
283
277
|
continue;
|
|
284
278
|
}
|
|
285
279
|
// xmark 相关的模板不添加 .husky
|
|
@@ -287,11 +281,9 @@ async function init() {
|
|
|
287
281
|
// eslint-disable-next-line no-continue
|
|
288
282
|
continue;
|
|
289
283
|
}
|
|
290
|
-
const targetPath =
|
|
291
|
-
? path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', renameFiles[file])
|
|
292
|
-
: path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', file);
|
|
284
|
+
const targetPath = path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', file);
|
|
293
285
|
|
|
294
|
-
|
|
286
|
+
fs.copySync(path.join(commonDir, file), targetPath);
|
|
295
287
|
}
|
|
296
288
|
})();
|
|
297
289
|
|
|
@@ -518,13 +510,11 @@ async function init() {
|
|
|
518
510
|
|
|
519
511
|
// inside functions
|
|
520
512
|
function write(file, content, templateDir, templateName) {
|
|
521
|
-
const targetPath =
|
|
522
|
-
? path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', renameFiles[file])
|
|
523
|
-
: path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', file);
|
|
513
|
+
const targetPath = path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', file);
|
|
524
514
|
if (content) {
|
|
525
515
|
fs.writeFileSync(targetPath, content);
|
|
526
516
|
} else {
|
|
527
|
-
|
|
517
|
+
fs.copySync(path.join(templateDir, file), targetPath);
|
|
528
518
|
}
|
|
529
519
|
}
|
|
530
520
|
function read(file, templateName) {
|
package/package.json
CHANGED
package/common/_gitignore
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
.pnp
|
|
5
|
-
.pnp.js
|
|
6
|
-
.DS_Store
|
|
7
|
-
node_modules
|
|
8
|
-
|
|
9
|
-
# testing
|
|
10
|
-
coverage
|
|
11
|
-
|
|
12
|
-
# production
|
|
13
|
-
build
|
|
14
|
-
dist
|
|
15
|
-
dist-ssr
|
|
16
|
-
.blocklet
|
|
17
|
-
|
|
18
|
-
# local env files
|
|
19
|
-
*.local
|
|
20
|
-
|
|
21
|
-
# Log files
|
|
22
|
-
logs
|
|
23
|
-
*.log
|
|
24
|
-
npm-debug.log*
|
|
25
|
-
yarn-debug.log*
|
|
26
|
-
yarn-error.log*
|
|
27
|
-
pnpm-debug.log*
|
|
28
|
-
lerna-debug.log*
|
package/common/_npmrc
DELETED