@d-zero/create-frontend 5.0.0-alpha.6 → 5.0.0-alpha.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-alpha.8](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-alpha.7...v5.0.0-alpha.8) (2024-05-23)
7
+
8
+ **Note:** Version bump only for package @d-zero/create-frontend
9
+
10
+ # [5.0.0-alpha.7](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-alpha.6...v5.0.0-alpha.7) (2024-05-14)
11
+
12
+ **Note:** Version bump only for package @d-zero/create-frontend
13
+
6
14
  # [5.0.0-alpha.6](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-alpha.5...v5.0.0-alpha.6) (2024-05-14)
7
15
 
8
16
  ### Bug Fixes
package/index.spec.js ADDED
@@ -0,0 +1,116 @@
1
+ import fs from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+
5
+ import { execa } from 'execa';
6
+ import { describe, test, expect, beforeEach } from 'vitest';
7
+
8
+ function getName(task) {
9
+ return encodeURIComponent(`${task.suite.name}_${task.name}`.toLowerCase());
10
+ }
11
+
12
+ beforeEach((ctx) => {
13
+ ctx.tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'test-'));
14
+ });
15
+
16
+ describe('CLI', () => {
17
+ test('npx', async ({ tmpDir, task }) => {
18
+ const dir = path.join(tmpDir, getName(task));
19
+ const { stdout } = await execa(
20
+ 'npx',
21
+ [
22
+ '@d-zero/create-frontend',
23
+ '--type',
24
+ 'burger',
25
+ '--dir',
26
+ dir,
27
+ '--no-install',
28
+ '--silent',
29
+ ],
30
+ {
31
+ failed: true,
32
+ env: {
33
+ NODE_NO_WARNINGS: '1',
34
+ },
35
+ },
36
+ );
37
+ expect(stdout.replaceAll(path.sep, '/').split('\n')).toStrictEqual([
38
+ `✔ ++ ${dir}/tsconfig.json`,
39
+ `✔ ++ ${dir}/package.json`,
40
+ `✔ ++ ${dir}/lint-staged.config.mjs`,
41
+ `✔ ++ ${dir}/eleventy.config.cjs`,
42
+ `✔ ++ ${dir}/cspell.json`,
43
+ `✔ ++ ${dir}/README.md`,
44
+ `✔ ++ ${dir}/CHANGELOG.md`,
45
+ `✔ ++ ${dir}/.textlintrc.js`,
46
+ `✔ ++ ${dir}/.stylelintrc`,
47
+ `✔ ++ ${dir}/.pug-lintrc`,
48
+ `✔ ++ ${dir}/.prettierrc.mjs`,
49
+ `✔ ++ ${dir}/.postcssrc.js`,
50
+ `✔ ++ ${dir}/.npmignore`,
51
+ `✔ ++ ${dir}/.markuplintrc`,
52
+ `✔ ++ ${dir}/.gitignore`,
53
+ `✔ ++ ${dir}/.eslintrc.cjs`,
54
+ `✔ ++ ${dir}/.editorconfig`,
55
+ `✔ ++ ${dir}/__assets/htdocs/index.pug`,
56
+ `✔ ++ ${dir}/__assets/htdocs/.eslintrc`,
57
+ `✔ ++ ${dir}/__assets/htdocs/js/script.ts`,
58
+ `✔ ++ ${dir}/__assets/htdocs/css/style.scss`,
59
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/index.pug`,
60
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/302_form_complete.pug`,
61
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/301_form_confirm.pug`,
62
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/300_form_input.pug`,
63
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/210_blog_index.pug`,
64
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/200_blog_index.pug`,
65
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/100_sub.pug`,
66
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/000_home.pug`,
67
+ `✔ ++ ${dir}/__assets/htdocs/__tmpl/.markuplintrc`,
68
+ `✔ ++ ${dir}/__assets/_libs/.markuplintrc`,
69
+ `✔ ++ ${dir}/__assets/_libs/style/theme/_index.scss`,
70
+ `✔ ++ ${dir}/__assets/_libs/style/theme/_font.scss`,
71
+ `✔ ++ ${dir}/__assets/_libs/style/theme/_dimension.scss`,
72
+ `✔ ++ ${dir}/__assets/_libs/style/theme/_color.scss`,
73
+ `✔ ++ ${dir}/__assets/_libs/style/general/_img.scss`,
74
+ `✔ ++ ${dir}/__assets/_libs/style/general/_button.scss`,
75
+ `✔ ++ ${dir}/__assets/_libs/style/general/_body.scss`,
76
+ `✔ ++ ${dir}/__assets/_libs/style/general/_all.scss`,
77
+ `✔ ++ ${dir}/__assets/_libs/style/base/_root.scss`,
78
+ `✔ ++ ${dir}/__assets/_libs/script/index.ts`,
79
+ `✔ ++ ${dir}/__assets/_libs/mixin/meta.pug`,
80
+ `✔ ++ ${dir}/__assets/_libs/img/bg-repeat-01.gif`,
81
+ `✔ ++ ${dir}/__assets/_libs/img/bg-arrow.svg`,
82
+ `✔ ++ ${dir}/__assets/_libs/data/data.yml`,
83
+ `✔ ++ ${dir}/__assets/_libs/data/blocks.html`,
84
+ `✔ ++ ${dir}/__assets/_libs/data/blocks.cjs`,
85
+ `✔ ++ ${dir}/__assets/_libs/data/blocks-burger.html`,
86
+ `✔ ++ ${dir}/__assets/_libs/data/.markuplintrc`,
87
+ `✔ ++ ${dir}/__assets/_libs/component/_c-title-page.scss`,
88
+ `✔ ++ ${dir}/__assets/_libs/component/_c-title-page.pug`,
89
+ `✔ ++ ${dir}/__assets/_libs/component/_c-pagination.scss`,
90
+ `✔ ++ ${dir}/__assets/_libs/component/_c-pagination.pug`,
91
+ `✔ ++ ${dir}/__assets/_libs/component/_c-page-sub.scss`,
92
+ `✔ ++ ${dir}/__assets/_libs/component/_c-page-home.scss`,
93
+ `✔ ++ ${dir}/__assets/_libs/component/_c-nav-sitemap.scss`,
94
+ `✔ ++ ${dir}/__assets/_libs/component/_c-nav-sitemap.pug`,
95
+ `✔ ++ ${dir}/__assets/_libs/component/_c-nav-global.scss`,
96
+ `✔ ++ ${dir}/__assets/_libs/component/_c-nav-global.pug`,
97
+ `✔ ++ ${dir}/__assets/_libs/component/_c-nav-breadcrumb.scss`,
98
+ `✔ ++ ${dir}/__assets/_libs/component/_c-nav-breadcrumb.pug`,
99
+ `✔ ++ ${dir}/__assets/_libs/component/_c-media.scss`,
100
+ `✔ ++ ${dir}/__assets/_libs/component/_c-media.pug`,
101
+ `✔ ++ ${dir}/__assets/_libs/component/_c-media-list.scss`,
102
+ `✔ ++ ${dir}/__assets/_libs/component/_c-header.scss`,
103
+ `✔ ++ ${dir}/__assets/_libs/component/_c-header.pug`,
104
+ `✔ ++ ${dir}/__assets/_libs/component/_c-footer.scss`,
105
+ `✔ ++ ${dir}/__assets/_libs/component/_c-footer.pug`,
106
+ `✔ ++ ${dir}/__assets/_libs/component/_c-content-main.scss`,
107
+ `✔ ++ ${dir}/__assets/_libs/component/_c-content-index.scss`,
108
+ `✔ ++ ${dir}/__assets/_libs/component/_c-card.scss`,
109
+ `✔ ++ ${dir}/__assets/_libs/component/_c-card.pug`,
110
+ `✔ ++ ${dir}/__assets/_libs/component/_c-card-list.scss`,
111
+ `✔ ++ ${dir}/.vscode/settings.json`,
112
+ `✔ ++ ${dir}/.vscode/extensions.json`,
113
+ '✔ Install dependencies : skipped',
114
+ ]);
115
+ });
116
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-zero/create-frontend",
3
- "version": "5.0.0-alpha.6",
3
+ "version": "5.0.0-alpha.8",
4
4
  "description": "Create a new frontend project from a scaffolding template",
5
5
  "repository": "https://github.com/d-zero-dev/frontend-env.git",
6
6
  "author": "D-ZERO Co., Ltd.",
@@ -14,8 +14,8 @@
14
14
  "create-dzero-frontend": "./index.js"
15
15
  },
16
16
  "dependencies": {
17
- "@d-zero/scaffold": "5.0.0-alpha.6",
18
- "glob": "10.3.15",
17
+ "@d-zero/scaffold": "5.0.0-alpha.8",
18
+ "glob": "10.3.16",
19
19
  "i18n-js": "4.4.3",
20
20
  "ignore": "5.3.1",
21
21
  "meow": "13.2.0",
@@ -24,5 +24,5 @@
24
24
  "devDependencies": {
25
25
  "@types/glob": "8.1.0"
26
26
  },
27
- "gitHead": "ed5f41e8a08610524c8e586bb4172edf58faf862"
27
+ "gitHead": "54795ac0cc526ff91b6fba685240b1578a43bd4d"
28
28
  }
package/plopfile.js CHANGED
@@ -75,16 +75,31 @@ export default function (plop) {
75
75
  const dest = answers['__d-zero_scaffold_dest__'] ?? cli.flags.dir ?? '.';
76
76
  const doInstall =
77
77
  answers['__d-zero_scaffold_yarn_install__'] ?? cli.flags.install ?? true;
78
+
79
+ const { promise, resolve, reject } = Promise.withResolvers();
80
+
78
81
  if (doInstall) {
79
82
  const child = spawn('yarn', ['install'], {
80
83
  cwd: path.resolve(process.cwd(), dest),
81
84
  stdio: 'inherit',
82
85
  });
83
86
 
87
+ child.on('exit', (code) => {
88
+ if (code === 0) {
89
+ resolve(': success');
90
+ } else {
91
+ reject(new Error('Failed to install dependencies'));
92
+ }
93
+ });
94
+
84
95
  process.on('SIGINT', () => {
85
96
  child.kill('SIGINT');
86
97
  });
98
+ } else {
99
+ resolve(': skipped');
87
100
  }
101
+
102
+ return promise;
88
103
  });
89
104
 
90
105
  plop.setGenerator('basic', {