@d-zero/create-frontend 5.0.0-beta.0 → 5.0.0-beta.10
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 +51 -0
- package/README.md +51 -0
- package/index.spec.js +45 -35
- package/libraries.js +53 -0
- package/package.json +6 -6
- package/plopfile.js +83 -32
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,57 @@
|
|
|
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-beta.10](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.9...v5.0.0-beta.10) (2025-10-20)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **create-frontend:** correct file extension from .cjs to .js in blocks data path ([b425f76](https://github.com/d-zero-dev/frontend-env/commit/b425f76b9fb51302a0b26f0149407787679f33ac))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **create-frontend:** add gitignore rewrite functionality ([e2a6e75](https://github.com/d-zero-dev/frontend-env/commit/e2a6e75ad6d58416cee8b35642ccdc542532ab73))
|
|
15
|
+
- **create-frontend:** add library copying functionality for baserCMS projects ([8e73300](https://github.com/d-zero-dev/frontend-env/commit/8e73300a730aa7dcdcc2f19bb57b99eb5f4d561c))
|
|
16
|
+
- **create-frontend:** update project type options and remove unused blocks.html ([b003628](https://github.com/d-zero-dev/frontend-env/commit/b00362847c11493ab14f8c87c01f9577563f2e07))
|
|
17
|
+
- **scaffold:** add baserCMS-specific meta template and conditional inclusion ([885fe35](https://github.com/d-zero-dev/frontend-env/commit/885fe352ecb692cd1ccf3ca4ee1d82749193a60d))
|
|
18
|
+
|
|
19
|
+
# [5.0.0-beta.9](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.8...v5.0.0-beta.9) (2025-10-05)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
22
|
+
|
|
23
|
+
# [5.0.0-beta.8](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.7...v5.0.0-beta.8) (2025-10-05)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
26
|
+
|
|
27
|
+
# [5.0.0-beta.7](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.6...v5.0.0-beta.7) (2025-10-03)
|
|
28
|
+
|
|
29
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
30
|
+
|
|
31
|
+
# [5.0.0-beta.6](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.5...v5.0.0-beta.6) (2025-10-03)
|
|
32
|
+
|
|
33
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
34
|
+
|
|
35
|
+
# [5.0.0-beta.5](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.4...v5.0.0-beta.5) (2025-09-17)
|
|
36
|
+
|
|
37
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
38
|
+
|
|
39
|
+
# [5.0.0-beta.4](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.3...v5.0.0-beta.4) (2025-08-14)
|
|
40
|
+
|
|
41
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
42
|
+
|
|
43
|
+
# [5.0.0-beta.3](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.2...v5.0.0-beta.3) (2025-07-11)
|
|
44
|
+
|
|
45
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
46
|
+
|
|
47
|
+
# [5.0.0-beta.2](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.1...v5.0.0-beta.2) (2025-07-11)
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
- **scaffold:** introduce @burger-editor/local for local development ([1524937](https://github.com/d-zero-dev/frontend-env/commit/15249370d68aeeb9c5b20d7c29dd4c8dfc0d000e))
|
|
52
|
+
|
|
53
|
+
# [5.0.0-beta.1](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2025-07-01)
|
|
54
|
+
|
|
55
|
+
**Note:** Version bump only for package @d-zero/create-frontend
|
|
56
|
+
|
|
6
57
|
# [5.0.0-beta.0](https://github.com/d-zero-dev/frontend-env/compare/v5.0.0-alpha.46...v5.0.0-beta.0) (2025-06-20)
|
|
7
58
|
|
|
8
59
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -14,4 +14,55 @@ npx @d-zero/create-frontend
|
|
|
14
14
|
yarn create @d-zero/frontend
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
### オプション
|
|
18
|
+
|
|
19
|
+
| オプション | 短縮形 | 説明 | デフォルト値 |
|
|
20
|
+
| ----------- | ------ | ------------------------------------------------------------------------------ | ------------------------- |
|
|
21
|
+
| `--type` | `-t` | プロジェクトのタイプを指定します。指定した場合、対話モードはスキップされます。 | `static` |
|
|
22
|
+
| `--dir` | `-d` | 出力先ディレクトリを指定します。 | `.`(現在のディレクトリ) |
|
|
23
|
+
| `--install` | - | スキャフォールディング後にyarnで依存関係をインストールします。 | `true` |
|
|
24
|
+
|
|
25
|
+
#### プロジェクトタイプ
|
|
26
|
+
|
|
27
|
+
##### `static` - 静的サイト
|
|
28
|
+
|
|
29
|
+
- **用途**: 静的なWebサイトの開発
|
|
30
|
+
- **特徴**:
|
|
31
|
+
- [BurgerEditor Local App](https://github.com/d-zero-dev/BurgerEditor) v4 が組み込まれており、ローカル環境でのビジュアル編集が可能
|
|
32
|
+
- [Eleventy](https://www.11ty.dev/) による静的サイトジェネレーター
|
|
33
|
+
- **開発コマンド**:
|
|
34
|
+
- `yarn dev`: 開発サーバー起動(http://localhost:8080/)
|
|
35
|
+
- `yarn bge`: BurgerEditor Local App 起動(http://localhost:8100/)
|
|
36
|
+
- `yarn build`: 本番用ビルド
|
|
37
|
+
|
|
38
|
+
##### `basercms4` - baserCMS v4
|
|
39
|
+
|
|
40
|
+
- **用途**: [baserCMS](https://basercms.net/) v4 のテーマ開発
|
|
41
|
+
- **特徴**:
|
|
42
|
+
- BurgerEditor v2 対応のテーマファイル
|
|
43
|
+
- baserCMS 固有のテンプレート構造
|
|
44
|
+
- jQuery および関連ライブラリが自動で依存関係に追加
|
|
45
|
+
- baserCMS のテンプレート変数やヘルパー関数に対応
|
|
46
|
+
- BurgerEditor のブロック定義ファイル(`bge-blocks-v2.html`)を使用
|
|
47
|
+
- **追加される依存関係**:
|
|
48
|
+
- `jquery`: 最新版
|
|
49
|
+
- `jquery-colorbox`: v1.5
|
|
50
|
+
|
|
51
|
+
### 使用例
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
# 対話モードで実行
|
|
55
|
+
npx @d-zero/create-frontend
|
|
56
|
+
|
|
57
|
+
# 静的サイトプロジェクトを指定ディレクトリに作成し、依存関係をインストール
|
|
58
|
+
npx @d-zero/create-frontend --type static --dir ./my-project --install
|
|
59
|
+
|
|
60
|
+
# baserCMS v4プロジェクトを作成(依存関係のインストールはスキップ)
|
|
61
|
+
yarn create @d-zero/frontend --type basercms4 --dir ./my-cms --no-install
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 注意事項
|
|
65
|
+
|
|
66
|
+
オプションを指定せずにコマンドを実行すると、対話モードが開始され、プロジェクトを段階的に設定できます。
|
|
67
|
+
|
|
17
68
|
インストールで展開されるファイルは[`@d-zero/scaffold`](https://github.com/d-zero-dev/frontend-env/blob/main/packages/%40d-zero/scaffold/)に格納されています。
|
package/index.spec.js
CHANGED
|
@@ -56,6 +56,7 @@ describe('CLI', () => {
|
|
|
56
56
|
`✔ ++ ${dir}/eslint.config.js`,
|
|
57
57
|
`✔ ++ ${dir}/eleventy.config.mjs`,
|
|
58
58
|
`✔ ++ ${dir}/cspell.json`,
|
|
59
|
+
`✔ ++ ${dir}/burgereditor.config.js`,
|
|
59
60
|
`✔ ++ ${dir}/README.md`,
|
|
60
61
|
`✔ ++ ${dir}/CHANGELOG.md`,
|
|
61
62
|
`✔ ++ ${dir}/.yarnrc.yml`,
|
|
@@ -68,25 +69,12 @@ describe('CLI', () => {
|
|
|
68
69
|
`✔ ++ ${dir}/.npmignore`,
|
|
69
70
|
`✔ ++ ${dir}/.gitignore`,
|
|
70
71
|
`✔ ++ ${dir}/.editorconfig`,
|
|
71
|
-
`✔ ++ ${dir}
|
|
72
|
-
`✔ ++ ${dir}/.clineignore`,
|
|
73
|
-
`✔ ++ ${dir}/ai-tasks/page-to-burger.md`,
|
|
74
|
-
`✔ ++ ${dir}/ai-tasks/create-page.md`,
|
|
75
|
-
`✔ ++ ${dir}/ai-tasks/create-component.md`,
|
|
72
|
+
`✔ ++ ${dir}/htdocs/files/images/sample.png`,
|
|
76
73
|
`✔ ++ ${dir}/__info/print.txt`,
|
|
77
74
|
`✔ ++ ${dir}/__assets/htdocs/index.pug`,
|
|
75
|
+
`✔ ++ ${dir}/__assets/htdocs/sample/index.html`,
|
|
78
76
|
`✔ ++ ${dir}/__assets/htdocs/js/script.ts`,
|
|
79
77
|
`✔ ++ ${dir}/__assets/htdocs/css/style.css`,
|
|
80
|
-
`✔ ++ ${dir}/__assets/htdocs/css/bge_style.css`,
|
|
81
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/index.pug`,
|
|
82
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/302_form_complete.pug`,
|
|
83
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/301_form_confirm.pug`,
|
|
84
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/300_form_input.pug`,
|
|
85
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/210_blog_index.pug`,
|
|
86
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/200_blog_index.pug`,
|
|
87
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/100_sub.pug`,
|
|
88
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/000_home.pug`,
|
|
89
|
-
`✔ ++ ${dir}/__assets/htdocs/__tmpl/.markuplintrc`,
|
|
90
78
|
`✔ ++ ${dir}/__assets/_libs/.markuplintrc`,
|
|
91
79
|
`✔ ++ ${dir}/__assets/_libs/style/general/img.css`,
|
|
92
80
|
`✔ ++ ${dir}/__assets/_libs/style/general/button.css`,
|
|
@@ -95,12 +83,17 @@ describe('CLI', () => {
|
|
|
95
83
|
`✔ ++ ${dir}/__assets/_libs/style/base/root.css`,
|
|
96
84
|
`✔ ++ ${dir}/__assets/_libs/script/index.ts`,
|
|
97
85
|
`✔ ++ ${dir}/__assets/_libs/mixin/meta.pug`,
|
|
86
|
+
`✔ ++ ${dir}/__assets/_libs/mixin/meta-basercms.pug`,
|
|
87
|
+
`✔ ++ ${dir}/__assets/_libs/layouts/sub.pug`,
|
|
88
|
+
`✔ ++ ${dir}/__assets/_libs/layouts/home.pug`,
|
|
98
89
|
`✔ ++ ${dir}/__assets/_libs/img/bg-repeat-01.gif`,
|
|
99
90
|
`✔ ++ ${dir}/__assets/_libs/img/bg-arrow.svg`,
|
|
91
|
+
`✔ ++ ${dir}/__assets/_libs/data/titlelist.js`,
|
|
100
92
|
`✔ ++ ${dir}/__assets/_libs/data/data.yml`,
|
|
93
|
+
`✔ ++ ${dir}/__assets/_libs/data/breadcrumbs.js`,
|
|
101
94
|
`✔ ++ ${dir}/__assets/_libs/data/blocks.js`,
|
|
102
|
-
`✔ ++ ${dir}/__assets/_libs/data/blocks.html`,
|
|
103
95
|
`✔ ++ ${dir}/__assets/_libs/data/bge-blocks.html`,
|
|
96
|
+
`✔ ++ ${dir}/__assets/_libs/data/bge-blocks-v2.html`,
|
|
104
97
|
`✔ ++ ${dir}/__assets/_libs/data/.markuplintrc`,
|
|
105
98
|
`✔ ++ ${dir}/__assets/_libs/component/c-title-page.pug`,
|
|
106
99
|
`✔ ++ ${dir}/__assets/_libs/component/c-title-page.css`,
|
|
@@ -126,17 +119,17 @@ describe('CLI', () => {
|
|
|
126
119
|
`✔ ++ ${dir}/__assets/_libs/component/c-card.pug`,
|
|
127
120
|
`✔ ++ ${dir}/__assets/_libs/component/c-card.css`,
|
|
128
121
|
`✔ ++ ${dir}/__assets/_libs/component/c-card-list.css`,
|
|
129
|
-
`✔ ++ ${dir}/__assets/_libs/component/bge-contents.css`,
|
|
130
122
|
`✔ ++ ${dir}/.vscode/settings.json`,
|
|
131
123
|
`✔ ++ ${dir}/.vscode/extensions.json`,
|
|
132
124
|
`✔ ++ ${dir}/.husky/pre-commit`,
|
|
133
|
-
'✔ Install dependencies
|
|
125
|
+
'✔ Install dependencies skipped',
|
|
126
|
+
'✔ Finalize finalized',
|
|
134
127
|
]);
|
|
135
128
|
});
|
|
136
129
|
|
|
137
|
-
test('npx --type
|
|
130
|
+
test('npx --type basercms4', async ({ tmpDir, task }) => {
|
|
138
131
|
const dir = path.join(tmpDir, getName(task));
|
|
139
|
-
const actual = await cliTest(dir, '
|
|
132
|
+
const actual = await cliTest(dir, 'basercms4');
|
|
140
133
|
expect(actual).toStrictEqual([
|
|
141
134
|
`✔ ++ ${dir}/tsconfig.json`,
|
|
142
135
|
`✔ ++ ${dir}/prh.yaml`,
|
|
@@ -146,6 +139,7 @@ describe('CLI', () => {
|
|
|
146
139
|
`✔ ++ ${dir}/eslint.config.js`,
|
|
147
140
|
`✔ ++ ${dir}/eleventy.config.mjs`,
|
|
148
141
|
`✔ ++ ${dir}/cspell.json`,
|
|
142
|
+
`✔ ++ ${dir}/burgereditor.config.js`,
|
|
149
143
|
`✔ ++ ${dir}/README.md`,
|
|
150
144
|
`✔ ++ ${dir}/CHANGELOG.md`,
|
|
151
145
|
`✔ ++ ${dir}/.yarnrc.yml`,
|
|
@@ -158,24 +152,30 @@ describe('CLI', () => {
|
|
|
158
152
|
`✔ ++ ${dir}/.npmignore`,
|
|
159
153
|
`✔ ++ ${dir}/.gitignore`,
|
|
160
154
|
`✔ ++ ${dir}/.editorconfig`,
|
|
161
|
-
`✔ ++ ${dir}
|
|
162
|
-
`✔ ++ ${dir}
|
|
163
|
-
`✔ ++ ${dir}/
|
|
164
|
-
`✔ ++ ${dir}/ai-tasks/create-page.md`,
|
|
165
|
-
`✔ ++ ${dir}/ai-tasks/create-component.md`,
|
|
155
|
+
`✔ ++ ${dir}/htdocs/files/images/sample.png`,
|
|
156
|
+
`✔ ++ ${dir}/htdocs/__tmpl/__burger_editor/js/bge_modules/bge_functions.min.js`,
|
|
157
|
+
`✔ ++ ${dir}/htdocs/__tmpl/__burger_editor/img/bg-sample.png`,
|
|
166
158
|
`✔ ++ ${dir}/__info/print.txt`,
|
|
167
159
|
`✔ ++ ${dir}/__assets/htdocs/index.pug`,
|
|
160
|
+
`✔ ++ ${dir}/__assets/htdocs/sample/index.html`,
|
|
168
161
|
`✔ ++ ${dir}/__assets/htdocs/js/script.ts`,
|
|
169
162
|
`✔ ++ ${dir}/__assets/htdocs/css/style.css`,
|
|
170
163
|
`✔ ++ ${dir}/__assets/htdocs/css/bge_style.css`,
|
|
171
164
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/index.pug`,
|
|
172
165
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/302_form_complete.pug`,
|
|
166
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/302_form_complete.json`,
|
|
173
167
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/301_form_confirm.pug`,
|
|
168
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/301_form_confirm.json`,
|
|
174
169
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/300_form_input.pug`,
|
|
170
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/300_form_input.json`,
|
|
175
171
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/210_blog_index.pug`,
|
|
172
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/210_blog_index.json`,
|
|
176
173
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/200_blog_index.pug`,
|
|
174
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/200_blog_index.json`,
|
|
177
175
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/100_sub.pug`,
|
|
176
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/100_sub.json`,
|
|
178
177
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/000_home.pug`,
|
|
178
|
+
`✔ ++ ${dir}/__assets/htdocs/__tmpl/000_home.json`,
|
|
179
179
|
`✔ ++ ${dir}/__assets/htdocs/__tmpl/.markuplintrc`,
|
|
180
180
|
`✔ ++ ${dir}/__assets/_libs/.markuplintrc`,
|
|
181
181
|
`✔ ++ ${dir}/__assets/_libs/style/general/img.css`,
|
|
@@ -185,12 +185,17 @@ describe('CLI', () => {
|
|
|
185
185
|
`✔ ++ ${dir}/__assets/_libs/style/base/root.css`,
|
|
186
186
|
`✔ ++ ${dir}/__assets/_libs/script/index.ts`,
|
|
187
187
|
`✔ ++ ${dir}/__assets/_libs/mixin/meta.pug`,
|
|
188
|
+
`✔ ++ ${dir}/__assets/_libs/mixin/meta-basercms.pug`,
|
|
189
|
+
`✔ ++ ${dir}/__assets/_libs/layouts/sub.pug`,
|
|
190
|
+
`✔ ++ ${dir}/__assets/_libs/layouts/home.pug`,
|
|
188
191
|
`✔ ++ ${dir}/__assets/_libs/img/bg-repeat-01.gif`,
|
|
189
192
|
`✔ ++ ${dir}/__assets/_libs/img/bg-arrow.svg`,
|
|
193
|
+
`✔ ++ ${dir}/__assets/_libs/data/titlelist.js`,
|
|
190
194
|
`✔ ++ ${dir}/__assets/_libs/data/data.yml`,
|
|
195
|
+
`✔ ++ ${dir}/__assets/_libs/data/breadcrumbs.js`,
|
|
191
196
|
`✔ ++ ${dir}/__assets/_libs/data/blocks.js`,
|
|
192
|
-
`✔ ++ ${dir}/__assets/_libs/data/blocks.html`,
|
|
193
197
|
`✔ ++ ${dir}/__assets/_libs/data/bge-blocks.html`,
|
|
198
|
+
`✔ ++ ${dir}/__assets/_libs/data/bge-blocks-v2.html`,
|
|
194
199
|
`✔ ++ ${dir}/__assets/_libs/data/.markuplintrc`,
|
|
195
200
|
`✔ ++ ${dir}/__assets/_libs/component/c-title-page.pug`,
|
|
196
201
|
`✔ ++ ${dir}/__assets/_libs/component/c-title-page.css`,
|
|
@@ -216,11 +221,11 @@ describe('CLI', () => {
|
|
|
216
221
|
`✔ ++ ${dir}/__assets/_libs/component/c-card.pug`,
|
|
217
222
|
`✔ ++ ${dir}/__assets/_libs/component/c-card.css`,
|
|
218
223
|
`✔ ++ ${dir}/__assets/_libs/component/c-card-list.css`,
|
|
219
|
-
`✔ ++ ${dir}/__assets/_libs/component/bge-contents.css`,
|
|
220
224
|
`✔ ++ ${dir}/.vscode/settings.json`,
|
|
221
225
|
`✔ ++ ${dir}/.vscode/extensions.json`,
|
|
222
226
|
`✔ ++ ${dir}/.husky/pre-commit`,
|
|
223
|
-
'✔ Install dependencies
|
|
227
|
+
'✔ Install dependencies skipped',
|
|
228
|
+
'✔ Finalize finalized',
|
|
224
229
|
]);
|
|
225
230
|
});
|
|
226
231
|
|
|
@@ -236,6 +241,7 @@ describe('CLI', () => {
|
|
|
236
241
|
`✔ ++ ${dir}/eslint.config.js`,
|
|
237
242
|
`✔ ++ ${dir}/eleventy.config.mjs`,
|
|
238
243
|
`✔ ++ ${dir}/cspell.json`,
|
|
244
|
+
`✔ ++ ${dir}/burgereditor.config.js`,
|
|
239
245
|
`✔ ++ ${dir}/README.md`,
|
|
240
246
|
`✔ ++ ${dir}/CHANGELOG.md`,
|
|
241
247
|
`✔ ++ ${dir}/.yarnrc.yml`,
|
|
@@ -248,13 +254,10 @@ describe('CLI', () => {
|
|
|
248
254
|
`✔ ++ ${dir}/.npmignore`,
|
|
249
255
|
`✔ ++ ${dir}/.gitignore`,
|
|
250
256
|
`✔ ++ ${dir}/.editorconfig`,
|
|
251
|
-
`✔ ++ ${dir}
|
|
252
|
-
`✔ ++ ${dir}/.clineignore`,
|
|
253
|
-
`✔ ++ ${dir}/ai-tasks/page-to-burger.md`,
|
|
254
|
-
`✔ ++ ${dir}/ai-tasks/create-page.md`,
|
|
255
|
-
`✔ ++ ${dir}/ai-tasks/create-component.md`,
|
|
257
|
+
`✔ ++ ${dir}/htdocs/files/images/sample.png`,
|
|
256
258
|
`✔ ++ ${dir}/__info/print.txt`,
|
|
257
259
|
`✔ ++ ${dir}/__assets/htdocs/index.pug`,
|
|
260
|
+
`✔ ++ ${dir}/__assets/htdocs/sample/index.html`,
|
|
258
261
|
`✔ ++ ${dir}/__assets/htdocs/js/script.ts`,
|
|
259
262
|
`✔ ++ ${dir}/__assets/htdocs/css/style.css`,
|
|
260
263
|
`✔ ++ ${dir}/__assets/_libs/.markuplintrc`,
|
|
@@ -265,11 +268,17 @@ describe('CLI', () => {
|
|
|
265
268
|
`✔ ++ ${dir}/__assets/_libs/style/base/root.css`,
|
|
266
269
|
`✔ ++ ${dir}/__assets/_libs/script/index.ts`,
|
|
267
270
|
`✔ ++ ${dir}/__assets/_libs/mixin/meta.pug`,
|
|
271
|
+
`✔ ++ ${dir}/__assets/_libs/mixin/meta-basercms.pug`,
|
|
272
|
+
`✔ ++ ${dir}/__assets/_libs/layouts/sub.pug`,
|
|
273
|
+
`✔ ++ ${dir}/__assets/_libs/layouts/home.pug`,
|
|
268
274
|
`✔ ++ ${dir}/__assets/_libs/img/bg-repeat-01.gif`,
|
|
269
275
|
`✔ ++ ${dir}/__assets/_libs/img/bg-arrow.svg`,
|
|
276
|
+
`✔ ++ ${dir}/__assets/_libs/data/titlelist.js`,
|
|
270
277
|
`✔ ++ ${dir}/__assets/_libs/data/data.yml`,
|
|
278
|
+
`✔ ++ ${dir}/__assets/_libs/data/breadcrumbs.js`,
|
|
271
279
|
`✔ ++ ${dir}/__assets/_libs/data/blocks.js`,
|
|
272
|
-
`✔ ++ ${dir}/__assets/_libs/data/blocks.html`,
|
|
280
|
+
`✔ ++ ${dir}/__assets/_libs/data/bge-blocks.html`,
|
|
281
|
+
`✔ ++ ${dir}/__assets/_libs/data/bge-blocks-v2.html`,
|
|
273
282
|
`✔ ++ ${dir}/__assets/_libs/data/.markuplintrc`,
|
|
274
283
|
`✔ ++ ${dir}/__assets/_libs/component/c-title-page.pug`,
|
|
275
284
|
`✔ ++ ${dir}/__assets/_libs/component/c-title-page.css`,
|
|
@@ -298,7 +307,8 @@ describe('CLI', () => {
|
|
|
298
307
|
`✔ ++ ${dir}/.vscode/settings.json`,
|
|
299
308
|
`✔ ++ ${dir}/.vscode/extensions.json`,
|
|
300
309
|
`✔ ++ ${dir}/.husky/pre-commit`,
|
|
301
|
-
'✔ Install dependencies
|
|
310
|
+
'✔ Install dependencies skipped',
|
|
311
|
+
'✔ Finalize finalized',
|
|
302
312
|
]);
|
|
303
313
|
});
|
|
304
314
|
});
|
package/libraries.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const basercms4Libraries = [
|
|
5
|
+
{
|
|
6
|
+
from: 'node_modules/jquery/dist/jquery.min.js',
|
|
7
|
+
to: 'htdocs/js/jquery.min.js',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
from: 'node_modules/jquery-colorbox/example3/colorbox.css',
|
|
11
|
+
to: 'htdocs/__tmpl/__burger_editor/css/colorbox.css',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
from: 'node_modules/jquery-colorbox/example3/images/loading.gif',
|
|
15
|
+
to: 'htdocs/__tmpl/__burger_editor/css/images/loading.gif',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
from: 'node_modules/jquery-colorbox/example3/images/controls.png',
|
|
19
|
+
to: 'htdocs/__tmpl/__burger_editor/css/images/controls.png',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
from: 'node_modules/jquery-colorbox/jquery.colorbox-min.js',
|
|
23
|
+
to: 'htdocs/__tmpl/__burger_editor/js/bge_modules/jquery.colorbox-min.js',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param type
|
|
30
|
+
* @param dest
|
|
31
|
+
*/
|
|
32
|
+
export async function copyLibraries(type, dest) {
|
|
33
|
+
dest = path.isAbsolute(dest) ? dest : path.resolve(process.cwd(), dest);
|
|
34
|
+
let libraries = [];
|
|
35
|
+
switch (type) {
|
|
36
|
+
case 'basercms4': {
|
|
37
|
+
libraries = basercms4Libraries;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (const library of libraries) {
|
|
43
|
+
const from = path.join(dest, library.from);
|
|
44
|
+
const dist = path.join(dest, library.to);
|
|
45
|
+
const dir = path.dirname(dist);
|
|
46
|
+
const stats = await fs.stat(from).catch(() => null);
|
|
47
|
+
if (!stats?.isFile()) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
await fs.mkdir(dir, { recursive: true });
|
|
51
|
+
await fs.copyFile(from, dist);
|
|
52
|
+
}
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/create-frontend",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.10",
|
|
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.",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"create-dzero-frontend": "./index.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@d-zero/scaffold": "5.0.0-beta.
|
|
16
|
+
"@d-zero/scaffold": "5.0.0-beta.10",
|
|
17
17
|
"glob": "11.0.3",
|
|
18
18
|
"i18n-js": "4.5.1",
|
|
19
19
|
"ignore": "7.0.5",
|
|
20
|
-
"meow": "
|
|
21
|
-
"plop": "4.0.
|
|
20
|
+
"meow": "14.0.0",
|
|
21
|
+
"plop": "4.0.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/glob": "
|
|
24
|
+
"@types/glob": "9.0.0",
|
|
25
25
|
"execa": "9.6.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "cc5fe9c8a233c40a471e6014552122d2e12b1d4f"
|
|
28
28
|
}
|
package/plopfile.js
CHANGED
|
@@ -7,6 +7,7 @@ import { globSync } from 'glob';
|
|
|
7
7
|
import ignore from 'ignore';
|
|
8
8
|
import meow from 'meow';
|
|
9
9
|
|
|
10
|
+
import { copyLibraries } from './libraries.js';
|
|
10
11
|
import { t } from './locale.js';
|
|
11
12
|
import { readFileSafe } from './read-file-safe.js';
|
|
12
13
|
|
|
@@ -35,7 +36,7 @@ const cli = meow(
|
|
|
35
36
|
type: {
|
|
36
37
|
type: 'string',
|
|
37
38
|
shortFlag: 't',
|
|
38
|
-
default: '
|
|
39
|
+
default: 'static',
|
|
39
40
|
},
|
|
40
41
|
dir: {
|
|
41
42
|
type: 'string',
|
|
@@ -78,8 +79,8 @@ export default function (plop) {
|
|
|
78
79
|
'*.test.*',
|
|
79
80
|
])
|
|
80
81
|
.add(
|
|
81
|
-
// BurgerEditor
|
|
82
|
-
cli.flags.type
|
|
82
|
+
// BurgerEditor for baserCMS
|
|
83
|
+
cli.flags.type.startsWith('basercms') ? [] : ['**/bge_style.css'],
|
|
83
84
|
)
|
|
84
85
|
.add(
|
|
85
86
|
// static
|
|
@@ -94,33 +95,25 @@ export default function (plop) {
|
|
|
94
95
|
}),
|
|
95
96
|
);
|
|
96
97
|
|
|
97
|
-
plop.setActionType('Install dependencies', (answers) => {
|
|
98
|
+
plop.setActionType('Install dependencies', async (answers) => {
|
|
98
99
|
const { dest, doInstall } = answerToConfig(answers);
|
|
100
|
+
if (doInstall) {
|
|
101
|
+
await installDependencies(dest);
|
|
102
|
+
return 'success';
|
|
103
|
+
}
|
|
104
|
+
return 'skipped';
|
|
105
|
+
});
|
|
99
106
|
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
plop.setActionType('Finalize', async (answers) => {
|
|
108
|
+
const { dest, type, doInstall } = answerToConfig(answers);
|
|
102
109
|
if (doInstall) {
|
|
103
|
-
|
|
104
|
-
cwd: path.resolve(process.cwd(), dest),
|
|
105
|
-
stdio: 'inherit',
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
child.on('exit', (code) => {
|
|
109
|
-
if (code === 0) {
|
|
110
|
-
resolve(': success');
|
|
111
|
-
} else {
|
|
112
|
-
reject(new Error('Failed to install dependencies'));
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
process.on('SIGINT', () => {
|
|
117
|
-
child.kill('SIGINT');
|
|
118
|
-
});
|
|
119
|
-
} else {
|
|
120
|
-
resolve(': skipped');
|
|
110
|
+
rewriteDotGitignore(dest);
|
|
121
111
|
}
|
|
122
112
|
|
|
123
|
-
|
|
113
|
+
if (type.startsWith('basercms')) {
|
|
114
|
+
await copyLibraries(type, dest);
|
|
115
|
+
}
|
|
116
|
+
return 'finalized';
|
|
124
117
|
});
|
|
125
118
|
|
|
126
119
|
plop.setGenerator('basic', {
|
|
@@ -132,13 +125,12 @@ export default function (plop) {
|
|
|
132
125
|
message: t`What's the type of project?`,
|
|
133
126
|
choices: [
|
|
134
127
|
{
|
|
135
|
-
name: 'Static',
|
|
128
|
+
name: 'Static Site (with BurgerEditor Local App)',
|
|
136
129
|
value: 'static',
|
|
137
130
|
},
|
|
138
|
-
'CMS (WordPress etc.)',
|
|
139
131
|
{
|
|
140
|
-
name: '
|
|
141
|
-
value: '
|
|
132
|
+
name: 'baserCMS v4 (with BurgerEditor v2)',
|
|
133
|
+
value: 'basercms4',
|
|
142
134
|
},
|
|
143
135
|
],
|
|
144
136
|
default: cli.flags.type,
|
|
@@ -195,12 +187,22 @@ export default function (plop) {
|
|
|
195
187
|
delete pkg.license;
|
|
196
188
|
delete pkg.publishConfig;
|
|
197
189
|
delete pkg.files;
|
|
190
|
+
if (config.type.startsWith('basercms')) {
|
|
191
|
+
pkg.dependencies['jquery'] = 'latest';
|
|
192
|
+
pkg.dependencies['jquery-colorbox'] = '1.5';
|
|
193
|
+
}
|
|
198
194
|
content = JSON.stringify(pkg, null, '\t');
|
|
199
195
|
break;
|
|
200
196
|
}
|
|
201
|
-
case '__assets/_libs/data/blocks.
|
|
202
|
-
if (config.type === '
|
|
203
|
-
content = content.replace(
|
|
197
|
+
case '__assets/_libs/data/blocks.js': {
|
|
198
|
+
if (config.type === 'basercms4') {
|
|
199
|
+
content = content.replace('bge-blocks.html', 'bge-blocks-v2.html');
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case '__assets/_libs/mixin/meta.pug': {
|
|
204
|
+
if (!config.type.startsWith('basercms')) {
|
|
205
|
+
content = content.replace('\ninclude meta-basercms.pug', '');
|
|
204
206
|
}
|
|
205
207
|
break;
|
|
206
208
|
}
|
|
@@ -221,6 +223,9 @@ export default function (plop) {
|
|
|
221
223
|
{
|
|
222
224
|
type: 'Install dependencies',
|
|
223
225
|
},
|
|
226
|
+
{
|
|
227
|
+
type: 'Finalize',
|
|
228
|
+
},
|
|
224
229
|
];
|
|
225
230
|
},
|
|
226
231
|
});
|
|
@@ -237,3 +242,49 @@ function answerToConfig(answers) {
|
|
|
237
242
|
|
|
238
243
|
return { type, dest, doInstall };
|
|
239
244
|
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
*
|
|
248
|
+
* @param dest
|
|
249
|
+
*/
|
|
250
|
+
function installDependencies(dest) {
|
|
251
|
+
const { promise, resolve, reject } = Promise.withResolvers();
|
|
252
|
+
|
|
253
|
+
const child = spawn('yarn', ['install'], {
|
|
254
|
+
cwd: path.resolve(process.cwd(), dest),
|
|
255
|
+
stdio: 'inherit',
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
child.on('exit', (code) => {
|
|
259
|
+
if (code === 0) {
|
|
260
|
+
resolve(true);
|
|
261
|
+
} else {
|
|
262
|
+
reject(new Error('Failed to install dependencies'));
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
process.on('SIGINT', () => {
|
|
267
|
+
child.kill('SIGINT');
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
return promise;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
*
|
|
275
|
+
* @param dest
|
|
276
|
+
*/
|
|
277
|
+
function rewriteDotGitignore(dest) {
|
|
278
|
+
let gitignore = readFileSafe(path.resolve(dest, '.gitignore'));
|
|
279
|
+
if (gitignore == null) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Remove after `# Document Root` section
|
|
284
|
+
const documentRootSection = gitignore.indexOf('\n# Document Root\n');
|
|
285
|
+
if (documentRootSection !== -1) {
|
|
286
|
+
gitignore = gitignore.slice(0, documentRootSection);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return fs.writeFileSync(path.resolve(dest, '.gitignore'), gitignore);
|
|
290
|
+
}
|