create-blocklet 0.5.0 → 0.5.2

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.
Files changed (280) hide show
  1. package/{templates/docsite → common}/.editorconfig +0 -0
  2. package/{templates/docsite → common}/.github/workflows/main.yml +0 -0
  3. package/{templates/docsite → common}/.github/workflows/pr-title.yml +0 -0
  4. package/{templates/docsite → common}/.github/workflows/version-check.yml +0 -0
  5. package/{templates/express-api → common}/.husky/pre-commit +0 -0
  6. package/{templates/docsite → common}/.prettierrc +0 -0
  7. package/{templates/docsite → common}/LICENSE +0 -0
  8. package/{templates/docsite → common}/_gitignore +0 -0
  9. package/{templates/docsite → common}/_npmrc +0 -0
  10. package/{templates/docsite → common}/logo.png +0 -0
  11. package/{templates/docsite → common}/public/favicon.ico +0 -0
  12. package/{templates/docsite → common}/public/robots.txt +0 -0
  13. package/{templates/docsite → common}/screenshots/.gitkeep +0 -0
  14. package/{templates/express-api → common}/scripts/build-clean.js +0 -0
  15. package/{templates/docsite → common}/scripts/bump-version.mjs +6 -4
  16. package/{templates/docsite → common}/version +0 -0
  17. package/index.js +28 -12
  18. package/package.json +4 -4
  19. package/templates/express-api/package.json +1 -1
  20. package/templates/html-static/package.json +1 -1
  21. package/templates/monorepo/scripts/bump-version.mjs +13 -17
  22. package/templates/nextjs-dapp/package.json +4 -4
  23. package/templates/react-dapp/api/dev.js +2 -2
  24. package/templates/react-dapp/package.json +5 -5
  25. package/templates/react-gun-dapp/api/dev.js +2 -2
  26. package/templates/react-gun-dapp/package.json +5 -5
  27. package/templates/react-gun-dapp/src/pages/home.jsx +1 -1
  28. package/templates/react-static/package.json +1 -1
  29. package/templates/solidjs-dapp/api/dev.js +2 -2
  30. package/templates/solidjs-dapp/package.json +5 -5
  31. package/templates/solidjs-static/package.json +1 -1
  32. package/templates/svelte-dapp/api/dev.js +2 -2
  33. package/templates/svelte-dapp/package.json +5 -5
  34. package/templates/svelte-static/package.json +1 -1
  35. package/templates/vue-dapp/api/dev.js +2 -2
  36. package/templates/vue-dapp/package.json +5 -5
  37. package/templates/vue-static/package.json +1 -1
  38. package/templates/vue2-dapp/api/dev.js +2 -2
  39. package/templates/vue2-dapp/package.json +5 -5
  40. package/templates/vue2-static/package.json +1 -1
  41. package/templates/docsite/scripts/build-clean.js +0 -6
  42. package/templates/express-api/.editorconfig +0 -23
  43. package/templates/express-api/.github/workflows/main.yml +0 -36
  44. package/templates/express-api/.github/workflows/pr-title.yml +0 -21
  45. package/templates/express-api/.github/workflows/version-check.yml +0 -20
  46. package/templates/express-api/.prettierrc +0 -9
  47. package/templates/express-api/LICENSE +0 -13
  48. package/templates/express-api/_gitignore +0 -28
  49. package/templates/express-api/_npmrc +0 -3
  50. package/templates/express-api/logo.png +0 -0
  51. package/templates/express-api/public/favicon.ico +0 -0
  52. package/templates/express-api/public/robots.txt +0 -3
  53. package/templates/express-api/screenshots/.gitkeep +0 -0
  54. package/templates/express-api/scripts/bump-version.mjs +0 -33
  55. package/templates/express-api/version +0 -1
  56. package/templates/html-static/.editorconfig +0 -23
  57. package/templates/html-static/.github/workflows/main.yml +0 -36
  58. package/templates/html-static/.github/workflows/pr-title.yml +0 -21
  59. package/templates/html-static/.github/workflows/version-check.yml +0 -20
  60. package/templates/html-static/.prettierrc +0 -9
  61. package/templates/html-static/LICENSE +0 -13
  62. package/templates/html-static/_gitignore +0 -28
  63. package/templates/html-static/_npmrc +0 -3
  64. package/templates/html-static/logo.png +0 -0
  65. package/templates/html-static/public/favicon.ico +0 -0
  66. package/templates/html-static/public/robots.txt +0 -3
  67. package/templates/html-static/screenshots/.gitkeep +0 -0
  68. package/templates/html-static/scripts/build-clean.js +0 -5
  69. package/templates/html-static/scripts/bump-version.mjs +0 -33
  70. package/templates/html-static/version +0 -1
  71. package/templates/nextjs-dapp/.editorconfig +0 -23
  72. package/templates/nextjs-dapp/.github/workflows/main.yml +0 -36
  73. package/templates/nextjs-dapp/.github/workflows/pr-title.yml +0 -21
  74. package/templates/nextjs-dapp/.github/workflows/version-check.yml +0 -20
  75. package/templates/nextjs-dapp/.husky/pre-commit +0 -4
  76. package/templates/nextjs-dapp/.prettierrc +0 -9
  77. package/templates/nextjs-dapp/LICENSE +0 -13
  78. package/templates/nextjs-dapp/_gitignore +0 -28
  79. package/templates/nextjs-dapp/_npmrc +0 -3
  80. package/templates/nextjs-dapp/logo.png +0 -0
  81. package/templates/nextjs-dapp/public/favicon.ico +0 -0
  82. package/templates/nextjs-dapp/public/robots.txt +0 -3
  83. package/templates/nextjs-dapp/screenshots/.gitkeep +0 -0
  84. package/templates/nextjs-dapp/scripts/build-clean.js +0 -5
  85. package/templates/nextjs-dapp/scripts/bump-version.mjs +0 -33
  86. package/templates/nextjs-dapp/version +0 -1
  87. package/templates/react-dapp/.editorconfig +0 -23
  88. package/templates/react-dapp/.github/workflows/main.yml +0 -36
  89. package/templates/react-dapp/.github/workflows/pr-title.yml +0 -21
  90. package/templates/react-dapp/.github/workflows/version-check.yml +0 -20
  91. package/templates/react-dapp/.husky/pre-commit +0 -4
  92. package/templates/react-dapp/.prettierrc +0 -9
  93. package/templates/react-dapp/LICENSE +0 -13
  94. package/templates/react-dapp/_gitignore +0 -28
  95. package/templates/react-dapp/_npmrc +0 -3
  96. package/templates/react-dapp/logo.png +0 -0
  97. package/templates/react-dapp/public/favicon.ico +0 -0
  98. package/templates/react-dapp/public/robots.txt +0 -3
  99. package/templates/react-dapp/screenshots/.gitkeep +0 -0
  100. package/templates/react-dapp/scripts/build-clean.js +0 -5
  101. package/templates/react-dapp/scripts/bump-version.mjs +0 -33
  102. package/templates/react-dapp/version +0 -1
  103. package/templates/react-gun-dapp/.editorconfig +0 -23
  104. package/templates/react-gun-dapp/.github/workflows/main.yml +0 -36
  105. package/templates/react-gun-dapp/.github/workflows/pr-title.yml +0 -21
  106. package/templates/react-gun-dapp/.github/workflows/version-check.yml +0 -20
  107. package/templates/react-gun-dapp/.husky/pre-commit +0 -4
  108. package/templates/react-gun-dapp/.prettierrc +0 -9
  109. package/templates/react-gun-dapp/LICENSE +0 -13
  110. package/templates/react-gun-dapp/_gitignore +0 -28
  111. package/templates/react-gun-dapp/_npmrc +0 -3
  112. package/templates/react-gun-dapp/logo.png +0 -0
  113. package/templates/react-gun-dapp/public/favicon.ico +0 -0
  114. package/templates/react-gun-dapp/public/robots.txt +0 -3
  115. package/templates/react-gun-dapp/screenshots/.gitkeep +0 -0
  116. package/templates/react-gun-dapp/scripts/build-clean.js +0 -5
  117. package/templates/react-gun-dapp/scripts/bump-version.mjs +0 -33
  118. package/templates/react-gun-dapp/version +0 -1
  119. package/templates/react-static/.editorconfig +0 -23
  120. package/templates/react-static/.github/workflows/main.yml +0 -36
  121. package/templates/react-static/.github/workflows/pr-title.yml +0 -21
  122. package/templates/react-static/.github/workflows/version-check.yml +0 -20
  123. package/templates/react-static/.husky/pre-commit +0 -4
  124. package/templates/react-static/.prettierrc +0 -9
  125. package/templates/react-static/LICENSE +0 -13
  126. package/templates/react-static/_gitignore +0 -28
  127. package/templates/react-static/_npmrc +0 -3
  128. package/templates/react-static/logo.png +0 -0
  129. package/templates/react-static/public/favicon.ico +0 -0
  130. package/templates/react-static/public/robots.txt +0 -3
  131. package/templates/react-static/screenshots/.gitkeep +0 -0
  132. package/templates/react-static/scripts/build-clean.js +0 -5
  133. package/templates/react-static/scripts/bump-version.mjs +0 -33
  134. package/templates/react-static/version +0 -1
  135. package/templates/solidjs-dapp/.editorconfig +0 -23
  136. package/templates/solidjs-dapp/.github/workflows/main.yml +0 -36
  137. package/templates/solidjs-dapp/.github/workflows/pr-title.yml +0 -21
  138. package/templates/solidjs-dapp/.github/workflows/version-check.yml +0 -20
  139. package/templates/solidjs-dapp/.husky/pre-commit +0 -4
  140. package/templates/solidjs-dapp/.prettierrc +0 -9
  141. package/templates/solidjs-dapp/LICENSE +0 -13
  142. package/templates/solidjs-dapp/_gitignore +0 -28
  143. package/templates/solidjs-dapp/_npmrc +0 -3
  144. package/templates/solidjs-dapp/logo.png +0 -0
  145. package/templates/solidjs-dapp/public/favicon.ico +0 -0
  146. package/templates/solidjs-dapp/public/robots.txt +0 -3
  147. package/templates/solidjs-dapp/screenshots/.gitkeep +0 -0
  148. package/templates/solidjs-dapp/scripts/build-clean.js +0 -5
  149. package/templates/solidjs-dapp/scripts/bump-version.mjs +0 -33
  150. package/templates/solidjs-dapp/version +0 -1
  151. package/templates/solidjs-static/.editorconfig +0 -23
  152. package/templates/solidjs-static/.github/workflows/main.yml +0 -36
  153. package/templates/solidjs-static/.github/workflows/pr-title.yml +0 -21
  154. package/templates/solidjs-static/.github/workflows/version-check.yml +0 -20
  155. package/templates/solidjs-static/.husky/pre-commit +0 -4
  156. package/templates/solidjs-static/.prettierrc +0 -9
  157. package/templates/solidjs-static/LICENSE +0 -13
  158. package/templates/solidjs-static/_gitignore +0 -28
  159. package/templates/solidjs-static/_npmrc +0 -3
  160. package/templates/solidjs-static/logo.png +0 -0
  161. package/templates/solidjs-static/public/favicon.ico +0 -0
  162. package/templates/solidjs-static/public/robots.txt +0 -3
  163. package/templates/solidjs-static/screenshots/.gitkeep +0 -0
  164. package/templates/solidjs-static/scripts/build-clean.js +0 -5
  165. package/templates/solidjs-static/scripts/bump-version.mjs +0 -33
  166. package/templates/solidjs-static/version +0 -1
  167. package/templates/svelte-dapp/.editorconfig +0 -23
  168. package/templates/svelte-dapp/.github/workflows/main.yml +0 -36
  169. package/templates/svelte-dapp/.github/workflows/pr-title.yml +0 -21
  170. package/templates/svelte-dapp/.github/workflows/version-check.yml +0 -20
  171. package/templates/svelte-dapp/.husky/pre-commit +0 -4
  172. package/templates/svelte-dapp/.prettierrc +0 -9
  173. package/templates/svelte-dapp/.vscode/extensions.json +0 -3
  174. package/templates/svelte-dapp/LICENSE +0 -13
  175. package/templates/svelte-dapp/_gitignore +0 -28
  176. package/templates/svelte-dapp/_npmrc +0 -3
  177. package/templates/svelte-dapp/logo.png +0 -0
  178. package/templates/svelte-dapp/public/favicon.ico +0 -0
  179. package/templates/svelte-dapp/public/robots.txt +0 -3
  180. package/templates/svelte-dapp/screenshots/.gitkeep +0 -0
  181. package/templates/svelte-dapp/scripts/build-clean.js +0 -5
  182. package/templates/svelte-dapp/scripts/bump-version.mjs +0 -33
  183. package/templates/svelte-dapp/version +0 -1
  184. package/templates/svelte-static/.editorconfig +0 -23
  185. package/templates/svelte-static/.github/workflows/main.yml +0 -36
  186. package/templates/svelte-static/.github/workflows/pr-title.yml +0 -21
  187. package/templates/svelte-static/.github/workflows/version-check.yml +0 -20
  188. package/templates/svelte-static/.husky/pre-commit +0 -4
  189. package/templates/svelte-static/.prettierrc +0 -9
  190. package/templates/svelte-static/.vscode/extensions.json +0 -3
  191. package/templates/svelte-static/LICENSE +0 -13
  192. package/templates/svelte-static/_gitignore +0 -28
  193. package/templates/svelte-static/_npmrc +0 -3
  194. package/templates/svelte-static/logo.png +0 -0
  195. package/templates/svelte-static/public/favicon.ico +0 -0
  196. package/templates/svelte-static/public/robots.txt +0 -3
  197. package/templates/svelte-static/screenshots/.gitkeep +0 -0
  198. package/templates/svelte-static/scripts/build-clean.js +0 -5
  199. package/templates/svelte-static/scripts/bump-version.mjs +0 -33
  200. package/templates/svelte-static/version +0 -1
  201. package/templates/vue-dapp/.editorconfig +0 -23
  202. package/templates/vue-dapp/.github/workflows/main.yml +0 -36
  203. package/templates/vue-dapp/.github/workflows/pr-title.yml +0 -21
  204. package/templates/vue-dapp/.github/workflows/version-check.yml +0 -20
  205. package/templates/vue-dapp/.husky/pre-commit +0 -4
  206. package/templates/vue-dapp/.prettierrc +0 -9
  207. package/templates/vue-dapp/LICENSE +0 -13
  208. package/templates/vue-dapp/_gitignore +0 -28
  209. package/templates/vue-dapp/_npmrc +0 -3
  210. package/templates/vue-dapp/logo.png +0 -0
  211. package/templates/vue-dapp/public/favicon.ico +0 -0
  212. package/templates/vue-dapp/public/robots.txt +0 -3
  213. package/templates/vue-dapp/screenshots/.gitkeep +0 -0
  214. package/templates/vue-dapp/scripts/build-clean.js +0 -5
  215. package/templates/vue-dapp/scripts/bump-version.mjs +0 -33
  216. package/templates/vue-dapp/version +0 -1
  217. package/templates/vue-static/.editorconfig +0 -23
  218. package/templates/vue-static/.github/workflows/main.yml +0 -36
  219. package/templates/vue-static/.github/workflows/pr-title.yml +0 -21
  220. package/templates/vue-static/.github/workflows/version-check.yml +0 -20
  221. package/templates/vue-static/.husky/pre-commit +0 -4
  222. package/templates/vue-static/.prettierrc +0 -9
  223. package/templates/vue-static/LICENSE +0 -13
  224. package/templates/vue-static/_gitignore +0 -28
  225. package/templates/vue-static/_npmrc +0 -3
  226. package/templates/vue-static/logo.png +0 -0
  227. package/templates/vue-static/public/favicon.ico +0 -0
  228. package/templates/vue-static/public/robots.txt +0 -3
  229. package/templates/vue-static/screenshots/.gitkeep +0 -0
  230. package/templates/vue-static/scripts/build-clean.js +0 -5
  231. package/templates/vue-static/scripts/bump-version.mjs +0 -33
  232. package/templates/vue-static/version +0 -1
  233. package/templates/vue2-dapp/.editorconfig +0 -23
  234. package/templates/vue2-dapp/.github/workflows/main.yml +0 -36
  235. package/templates/vue2-dapp/.github/workflows/pr-title.yml +0 -21
  236. package/templates/vue2-dapp/.github/workflows/version-check.yml +0 -20
  237. package/templates/vue2-dapp/.husky/pre-commit +0 -4
  238. package/templates/vue2-dapp/.prettierrc +0 -9
  239. package/templates/vue2-dapp/LICENSE +0 -13
  240. package/templates/vue2-dapp/_gitignore +0 -28
  241. package/templates/vue2-dapp/_npmrc +0 -3
  242. package/templates/vue2-dapp/logo.png +0 -0
  243. package/templates/vue2-dapp/public/favicon.ico +0 -0
  244. package/templates/vue2-dapp/public/robots.txt +0 -3
  245. package/templates/vue2-dapp/screenshots/.gitkeep +0 -0
  246. package/templates/vue2-dapp/scripts/build-clean.js +0 -5
  247. package/templates/vue2-dapp/scripts/bump-version.mjs +0 -33
  248. package/templates/vue2-dapp/version +0 -1
  249. package/templates/vue2-static/.editorconfig +0 -23
  250. package/templates/vue2-static/.github/workflows/main.yml +0 -36
  251. package/templates/vue2-static/.github/workflows/pr-title.yml +0 -21
  252. package/templates/vue2-static/.github/workflows/version-check.yml +0 -20
  253. package/templates/vue2-static/.husky/pre-commit +0 -4
  254. package/templates/vue2-static/.prettierrc +0 -9
  255. package/templates/vue2-static/LICENSE +0 -13
  256. package/templates/vue2-static/_gitignore +0 -28
  257. package/templates/vue2-static/_npmrc +0 -3
  258. package/templates/vue2-static/logo.png +0 -0
  259. package/templates/vue2-static/public/favicon.ico +0 -0
  260. package/templates/vue2-static/public/index.html +0 -17
  261. package/templates/vue2-static/public/robots.txt +0 -3
  262. package/templates/vue2-static/screenshots/.gitkeep +0 -0
  263. package/templates/vue2-static/scripts/build-clean.js +0 -5
  264. package/templates/vue2-static/scripts/bump-version.mjs +0 -33
  265. package/templates/vue2-static/version +0 -1
  266. package/templates/website/.editorconfig +0 -23
  267. package/templates/website/.github/workflows/main.yml +0 -36
  268. package/templates/website/.github/workflows/pr-title.yml +0 -21
  269. package/templates/website/.github/workflows/version-check.yml +0 -20
  270. package/templates/website/.prettierrc +0 -9
  271. package/templates/website/LICENSE +0 -13
  272. package/templates/website/_gitignore +0 -28
  273. package/templates/website/_npmrc +0 -3
  274. package/templates/website/logo.png +0 -0
  275. package/templates/website/public/favicon.ico +0 -0
  276. package/templates/website/public/robots.txt +0 -3
  277. package/templates/website/screenshots/.gitkeep +0 -0
  278. package/templates/website/scripts/build-clean.js +0 -6
  279. package/templates/website/scripts/bump-version.mjs +0 -33
  280. package/templates/website/version +0 -1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,11 +5,15 @@ import { $, chalk, fs } from 'zx';
5
5
  execSync('bumpp --no-tag --no-commit --no-push package.json', { stdio: 'inherit' });
6
6
 
7
7
  const { version } = await fs.readJSON('package.json');
8
+ await fs.writeFileSync('version', version);
8
9
 
9
- let newChangelog = '';
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.'));
10
13
 
14
+ let newChangelog = '';
11
15
  try {
12
- const gitRes = await $`git log --pretty=format:"- %s" "master"...HEAD`;
16
+ const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
13
17
  newChangelog = gitRes.stdout.trim();
14
18
  } catch {
15
19
  console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
@@ -29,5 +33,3 @@ console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Th
29
33
  process.stdin.setRawMode(true);
30
34
  process.stdin.resume();
31
35
  process.stdin.on('data', process.exit.bind(process, 0));
32
-
33
- await fs.writeFileSync('version', version);
File without changes
package/index.js CHANGED
@@ -62,12 +62,11 @@ const templates = [
62
62
  display: '[dapp] next.js',
63
63
  color: blue,
64
64
  },
65
- // 暂时不用这个模板
66
- // {
67
- // name: 'react-gun-dapp',
68
- // display: '[dapp] react + gun.js + express.js',
69
- // color: blue,
70
- // },
65
+ {
66
+ name: 'react-gun-dapp',
67
+ display: '[dapp] react + gun.js + express.js',
68
+ color: blue,
69
+ },
71
70
  {
72
71
  name: 'react-static',
73
72
  display: '[static] react',
@@ -121,8 +120,6 @@ const renameFiles = {
121
120
  _npmrc: '.npmrc',
122
121
  };
123
122
 
124
- const excludeFiles = ['.github', '.husky', '.vscode', '.editorconfig', '_gitignore', '_npmrc', 'version'];
125
-
126
123
  async function init() {
127
124
  const { version } = await fs.readJSONSync(path.resolve(__dirname, 'package.json'));
128
125
  await echoBrand({ version });
@@ -286,17 +283,36 @@ async function init() {
286
283
  for (const templateName of templateNames) {
287
284
  const templateDir = path.join(__dirname, `templates/${templateName}`);
288
285
  const finalTemplateName = `${name}-${templateName}`;
286
+ // TODO: 需要把 common file copy 的逻辑移除,不同的 template 之间的差异越来越多,就会需要越来越多特殊处理的代码,违背了初衷,移除这部分逻辑可能是更好的选择
287
+ // copy common files
288
+ (() => {
289
+ const commonDir = path.join(__dirname, 'common');
290
+ const commonFiles = fs.readdirSync(commonDir);
291
+ for (const file of commonFiles) {
292
+ // 如果选择多个模板,每个子 package 中 只会包含必要的 文件
293
+ if (mainBlocklet && !['screenshots', 'public', 'logo.png', '.prettierrc', 'LICENSE'].includes(file)) {
294
+ continue;
295
+ }
296
+ // html-staic 和 xmark 相关的模板不添加 .husky
297
+ if (fuzzyQuery(['html-static', 'website', 'docsite'], templateName) && ['.husky'].includes(file)) {
298
+ // eslint-disable-next-line no-continue
299
+ continue;
300
+ }
301
+ const targetPath = renameFiles[file]
302
+ ? path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', renameFiles[file])
303
+ : path.join(root, mainBlocklet ? `blocklets/${templateName}` : '', file);
304
+
305
+ copy(path.join(commonDir, file), targetPath);
306
+ }
307
+ })();
289
308
  // copy template files
290
309
  (() => {
291
310
  // 过滤掉 template-info.json 文件
292
311
  let files = fs.readdirSync(templateDir).filter((file) => file !== 'template-info.json');
293
- // 如果选择了多个模板,每个子 package 中应该过滤掉一些文件
294
- if (mainBlocklet) {
295
- files = files.filter((file) => !fuzzyQuery(excludeFiles, file));
296
- }
297
312
  for (const file of files) {
298
313
  write(file, null, templateDir, templateName);
299
314
  }
315
+ // 如果选择了多个模板,每个子 package 中的 bump-version.mjs 文件
300
316
  if (mainBlocklet) {
301
317
  fs.removeSync(path.join(root, `blocklets/${templateName}`, 'scripts/bump-version.mjs'));
302
318
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-blocklet",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "exports": "./index.js",
5
5
  "type": "module",
6
6
  "repository": "git@github.com:blocklet/create-blocklet.git",
@@ -29,9 +29,9 @@
29
29
  "test:run": "vitest run"
30
30
  },
31
31
  "dependencies": {
32
- "@arcblock/did": "^1.18.6",
33
- "@ocap/mcrypto": "^1.18.6",
34
- "@ocap/util": "^1.18.6",
32
+ "@arcblock/did": "^1.18.11",
33
+ "@ocap/mcrypto": "^1.18.11",
34
+ "@ocap/util": "^1.18.11",
35
35
  "boxen": "^6.2.1",
36
36
  "ejs": "^3.1.8",
37
37
  "envfile": "^6.18.0",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
34
34
  "@blocklet/sdk": "^1.8.33",
35
- "@ocap/client": "^1.18.6",
35
+ "@ocap/client": "^1.18.11",
36
36
  "dotenv-flow": "^3.2.0",
37
37
  "express": "^4.18.2"
38
38
  },
@@ -5,7 +5,7 @@
5
5
  "dev": "blocklet dev",
6
6
  "clean": "node scripts/build-clean.js",
7
7
  "bundle": "npm run clean && blocklet bundle --zip --create-release",
8
- "deploy": "npm run bundle && blocklet deploy .blocklet/bundle --skip-hooks",
8
+ "deploy": "npm run bundle && blocklet deploy .blocklet/bundle",
9
9
  "deploy:child": "npm run bundle && blocklet deploy .blocklet/bundle --app-did=<%= did %>",
10
10
  "dev:child": "blocklet dev --component --app-did=<%= did %>",
11
11
  "upload": "npm run bundle && blocklet upload .blocklet/release/blocklet.json",
@@ -1,27 +1,25 @@
1
1
  /* eslint-disable no-console */
2
2
  import { execSync } from 'child_process';
3
- import { $, chalk, fs, path, YAML } from 'zx';
3
+ import { $, chalk, fs, path } from 'zx';
4
+
5
+ const cwd = process.cwd(); // 获取脚本执行目录
4
6
 
5
7
  // or use pnpm to bump version: `pnpm -r --filter {packages/*, themes/*} -- pnpm version`
6
8
  execSync('bumpp package.json blocklets/*/package.json', { stdio: 'inherit' });
7
9
 
8
10
  const { version } = await fs.readJSON('package.json');
11
+ await fs.writeFileSync('version', version);
9
12
 
10
- (async () => {
11
- console.log(chalk.greenBright(`[info]: start to modify blocklets version to ${version}`));
12
- const dirPath = path.join(__dirname, '../blocklets');
13
- let pathList = await fs.readdirSync(dirPath);
14
- pathList = pathList.map((item) => `${dirPath}/${item}/blocklet.yml`);
15
- for (const ymlPath of pathList) {
16
- const blockletYaml = await fs.readFileSync(ymlPath, 'utf8');
17
- const yamlConfig = YAML.parse(blockletYaml);
18
- yamlConfig.version = version;
19
- fs.writeFileSync(ymlPath, YAML.stringify(yamlConfig, 2));
20
- }
21
- console.log(chalk.greenBright('[info]: all blocklets version modified.'));
22
- })();
13
+ console.log(chalk.greenBright(`[info]: start to modify blocklets version to ${version}`));
14
+ const dirPath = path.join(__dirname, '../blocklets');
15
+ let pathList = await fs.readdirSync(dirPath);
16
+ pathList = pathList.map((item) => `${dirPath}/${item}`);
17
+ for (const ymlDir of pathList) {
18
+ await $`cd ${ymlDir} && blocklet version ${version}`;
19
+ }
20
+ console.log(chalk.greenBright('[info]: all blocklets version modified.'));
23
21
 
24
- console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Then press enter to continue.`);
22
+ await $`cd ${cwd}`;
25
23
 
26
24
  let newChangelog = '';
27
25
 
@@ -47,5 +45,3 @@ console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Th
47
45
  process.stdin.setRawMode(true);
48
46
  process.stdin.resume();
49
47
  process.stdin.on('data', process.exit.bind(process, 0));
50
-
51
- await fs.writeFileSync('version', version);
@@ -28,12 +28,12 @@
28
28
  ]
29
29
  },
30
30
  "dependencies": {
31
- "@arcblock/did-auth": "^1.18.6",
31
+ "@arcblock/did-auth": "^1.18.11",
32
32
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
33
33
  "@blocklet/sdk": "^1.8.33",
34
- "@ocap/client": "^1.18.6",
35
- "@ocap/mcrypto": "^1.18.6",
36
- "@ocap/wallet": "^1.18.6",
34
+ "@ocap/client": "^1.18.11",
35
+ "@ocap/mcrypto": "^1.18.11",
36
+ "@ocap/wallet": "^1.18.11",
37
37
  "dotenv-flow": "^3.2.0",
38
38
  "express": "^4.18.2",
39
39
  "next": "12.2.3",
@@ -1,4 +1,4 @@
1
1
  const { setupClient } = require('vite-plugin-blocklet');
2
- const { server, app } = require('./index');
2
+ const { app } = require('./index');
3
3
 
4
- setupClient(app, server);
4
+ setupClient(app);
@@ -40,12 +40,12 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@arcblock/did-auth": "^1.18.6",
43
+ "@arcblock/did-auth": "^1.18.11",
44
44
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
45
45
  "@blocklet/sdk": "^1.8.33",
46
- "@ocap/client": "^1.18.6",
47
- "@ocap/mcrypto": "^1.18.6",
48
- "@ocap/wallet": "^1.18.6",
46
+ "@ocap/client": "^1.18.11",
47
+ "@ocap/mcrypto": "^1.18.11",
48
+ "@ocap/wallet": "^1.18.11",
49
49
  "axios": "^0.27.2",
50
50
  "compression": "^1.7.4",
51
51
  "cookie-parser": "^1.4.6",
@@ -72,7 +72,7 @@
72
72
  "npm-run-all": "^4.1.5",
73
73
  "prettier": "^2.7.1",
74
74
  "vite": "^3.2.2",
75
- "vite-plugin-blocklet": "^0.5.0",
75
+ "vite-plugin-blocklet": "^0.5.2",
76
76
  "vite-plugin-svgr": "^2.2.2",
77
77
  "zx": "^7.1.1"
78
78
  }
@@ -1,4 +1,4 @@
1
1
  const { setupClient } = require('vite-plugin-blocklet');
2
- const { server, app } = require('./index');
2
+ const { app } = require('./index');
3
3
 
4
- setupClient(app, server);
4
+ setupClient(app);
@@ -40,12 +40,12 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@arcblock/did-auth": "^1.18.6",
43
+ "@arcblock/did-auth": "^1.18.11",
44
44
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
45
45
  "@blocklet/sdk": "^1.8.33",
46
- "@ocap/client": "^1.18.6",
47
- "@ocap/mcrypto": "^1.18.6",
48
- "@ocap/wallet": "^1.18.6",
46
+ "@ocap/client": "^1.18.11",
47
+ "@ocap/mcrypto": "^1.18.11",
48
+ "@ocap/wallet": "^1.18.11",
49
49
  "axios": "^0.27.2",
50
50
  "compression": "^1.7.4",
51
51
  "cookie-parser": "^1.4.6",
@@ -72,7 +72,7 @@
72
72
  "prettier": "^2.7.1",
73
73
  "rimraf": "^3.0.2",
74
74
  "vite": "^3.2.2",
75
- "vite-plugin-blocklet": "^0.5.0",
75
+ "vite-plugin-blocklet": "^0.5.2",
76
76
  "vite-plugin-svgr": "^2.2.2",
77
77
  "zx": "^7.1.1"
78
78
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-console */
2
2
  import { useEffect, useState } from 'react';
3
- import Gun from 'gun';
3
+ import Gun from 'gun/browser';
4
4
 
5
5
  import { Link } from 'react-router-dom';
6
6
 
@@ -53,7 +53,7 @@
53
53
  "prettier": "^2.7.1",
54
54
  "rimraf": "^3.0.2",
55
55
  "vite": "^3.2.2",
56
- "vite-plugin-blocklet": "^0.5.0",
56
+ "vite-plugin-blocklet": "^0.5.2",
57
57
  "vite-plugin-svgr": "^2.2.2",
58
58
  "zx": "^7.1.1"
59
59
  }
@@ -1,4 +1,4 @@
1
1
  const { setupClient } = require('vite-plugin-blocklet');
2
- const { server, app } = require('./index');
2
+ const { app } = require('./index');
3
3
 
4
- setupClient(app, server);
4
+ setupClient(app);
@@ -33,17 +33,17 @@
33
33
  "prettier": "^2.7.1",
34
34
  "rimraf": "^3.0.2",
35
35
  "vite": "^3.2.2",
36
- "vite-plugin-blocklet": "^0.5.0",
36
+ "vite-plugin-blocklet": "^0.5.2",
37
37
  "vite-plugin-solid": "^2.3.10",
38
38
  "zx": "^7.1.1"
39
39
  },
40
40
  "dependencies": {
41
- "@arcblock/did-auth": "^1.18.6",
41
+ "@arcblock/did-auth": "^1.18.11",
42
42
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
43
43
  "@blocklet/sdk": "^1.8.33",
44
- "@ocap/client": "^1.18.6",
45
- "@ocap/mcrypto": "^1.18.6",
46
- "@ocap/wallet": "^1.18.6",
44
+ "@ocap/client": "^1.18.11",
45
+ "@ocap/mcrypto": "^1.18.11",
46
+ "@ocap/wallet": "^1.18.11",
47
47
  "axios": "^0.27.2",
48
48
  "compression": "^1.7.4",
49
49
  "cookie-parser": "^1.4.6",
@@ -29,7 +29,7 @@
29
29
  "prettier": "^2.7.1",
30
30
  "rimraf": "^3.0.2",
31
31
  "vite": "^3.2.2",
32
- "vite-plugin-blocklet": "^0.5.0",
32
+ "vite-plugin-blocklet": "^0.5.2",
33
33
  "vite-plugin-solid": "^2.3.10",
34
34
  "zx": "^7.1.1"
35
35
  },
@@ -1,4 +1,4 @@
1
1
  const { setupClient } = require('vite-plugin-blocklet');
2
- const { server, app } = require('./index');
2
+ const { app } = require('./index');
3
3
 
4
- setupClient(app, server);
4
+ setupClient(app);
@@ -17,12 +17,12 @@
17
17
  "bump-version": "zx scripts/bump-version.mjs"
18
18
  },
19
19
  "dependencies": {
20
- "@arcblock/did-auth": "^1.18.6",
20
+ "@arcblock/did-auth": "^1.18.11",
21
21
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
22
22
  "@blocklet/sdk": "^1.8.33",
23
- "@ocap/client": "^1.18.6",
24
- "@ocap/mcrypto": "^1.18.6",
25
- "@ocap/wallet": "^1.18.6",
23
+ "@ocap/client": "^1.18.11",
24
+ "@ocap/mcrypto": "^1.18.11",
25
+ "@ocap/wallet": "^1.18.11",
26
26
  "axios": "^0.27.2",
27
27
  "compression": "^1.7.4",
28
28
  "cookie-parser": "^1.4.6",
@@ -47,7 +47,7 @@
47
47
  "rimraf": "^3.0.2",
48
48
  "svelte": "^3.52.0",
49
49
  "vite": "^3.2.2",
50
- "vite-plugin-blocklet": "^0.5.0",
50
+ "vite-plugin-blocklet": "^0.5.2",
51
51
  "vite-plugin-html": "^3.2.0",
52
52
  "zx": "^7.1.1"
53
53
  },
@@ -30,7 +30,7 @@
30
30
  "rimraf": "^3.0.2",
31
31
  "svelte": "^3.52.0",
32
32
  "vite": "^3.2.2",
33
- "vite-plugin-blocklet": "^0.5.0",
33
+ "vite-plugin-blocklet": "^0.5.2",
34
34
  "zx": "^7.1.1"
35
35
  },
36
36
  "lint-staged": {
@@ -1,4 +1,4 @@
1
1
  const { setupClient } = require('vite-plugin-blocklet');
2
- const { server, app } = require('./index');
2
+ const { app } = require('./index');
3
3
 
4
- setupClient(app, server);
4
+ setupClient(app);
@@ -18,12 +18,12 @@
18
18
  "bump-version": "zx scripts/bump-version.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/did-auth": "^1.18.6",
21
+ "@arcblock/did-auth": "^1.18.11",
22
22
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
23
23
  "@blocklet/sdk": "^1.8.33",
24
- "@ocap/client": "^1.18.6",
25
- "@ocap/mcrypto": "^1.18.6",
26
- "@ocap/wallet": "^1.18.6",
24
+ "@ocap/client": "^1.18.11",
25
+ "@ocap/mcrypto": "^1.18.11",
26
+ "@ocap/wallet": "^1.18.11",
27
27
  "axios": "^0.27.2",
28
28
  "compression": "^1.7.4",
29
29
  "cookie-parser": "^1.4.6",
@@ -49,7 +49,7 @@
49
49
  "prettier": "^2.7.1",
50
50
  "rimraf": "^3.0.2",
51
51
  "vite": "^3.2.2",
52
- "vite-plugin-blocklet": "^0.5.0",
52
+ "vite-plugin-blocklet": "^0.5.2",
53
53
  "zx": "^7.1.1"
54
54
  },
55
55
  "lint-staged": {
@@ -31,7 +31,7 @@
31
31
  "prettier": "^2.7.1",
32
32
  "rimraf": "^3.0.2",
33
33
  "vite": "^3.2.2",
34
- "vite-plugin-blocklet": "^0.5.0",
34
+ "vite-plugin-blocklet": "^0.5.2",
35
35
  "zx": "^7.1.1"
36
36
  },
37
37
  "lint-staged": {
@@ -1,4 +1,4 @@
1
1
  const { setupClient } = require('vite-plugin-blocklet');
2
- const { server, app } = require('./index');
2
+ const { app } = require('./index');
3
3
 
4
- setupClient(app, server);
4
+ setupClient(app);
@@ -18,12 +18,12 @@
18
18
  "bump-version": "zx scripts/bump-version.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/did-auth": "^1.18.6",
21
+ "@arcblock/did-auth": "^1.18.11",
22
22
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
23
23
  "@blocklet/sdk": "^1.8.33",
24
- "@ocap/client": "^1.18.6",
25
- "@ocap/mcrypto": "^1.18.6",
26
- "@ocap/wallet": "^1.18.6",
24
+ "@ocap/client": "^1.18.11",
25
+ "@ocap/mcrypto": "^1.18.11",
26
+ "@ocap/wallet": "^1.18.11",
27
27
  "axios": "^0.27.2",
28
28
  "compression": "^1.7.4",
29
29
  "cookie-parser": "^1.4.6",
@@ -49,7 +49,7 @@
49
49
  "prettier": "^2.7.1",
50
50
  "rimraf": "^3.0.2",
51
51
  "vite": "^3.2.2",
52
- "vite-plugin-blocklet": "^0.5.0",
52
+ "vite-plugin-blocklet": "^0.5.2",
53
53
  "zx": "^7.1.1"
54
54
  },
55
55
  "lint-staged": {
@@ -31,7 +31,7 @@
31
31
  "prettier": "^2.7.1",
32
32
  "rimraf": "^3.0.2",
33
33
  "vite": "^3.2.2",
34
- "vite-plugin-blocklet": "^0.5.0",
34
+ "vite-plugin-blocklet": "^0.5.2",
35
35
  "zx": "^7.1.1"
36
36
  },
37
37
  "lint-staged": {
@@ -1,6 +0,0 @@
1
- const rimraf = require('rimraf');
2
-
3
- console.log('clean .blocklet folder && node_modules/.vite');
4
- rimraf.sync('.blocklet');
5
- rimraf.sync('node_modules/.vite');
6
- console.log('clean .blocklet folder && node_modules/.vite done!');
@@ -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(toJSON(github.event.commits.*.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 }}
@@ -1,9 +0,0 @@
1
- {
2
- "printWidth": 120,
3
- "useTabs": false,
4
- "tabWidth": 2,
5
- "trailingComma": "es5",
6
- "bracketSameLine": true,
7
- "semi": true,
8
- "singleQuote": true
9
- }
@@ -1,13 +0,0 @@
1
- Copyright 2018-2020 ArcBlock
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.