pob 19.2.0 → 20.0.0
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 +11 -0
- package/lib/generators/app/PobAppGenerator.js +120 -120
- package/lib/generators/app/e2e-testing/AppE2ETestingGenerator.js +11 -11
- package/lib/generators/app/ignorePaths.js +24 -24
- package/lib/generators/app/nextjs/AppNextjsGenerator.js +9 -9
- package/lib/generators/app/remix/AppRemixGenerator.js +7 -7
- package/lib/generators/common/babel/CommonBabelGenerator.js +146 -146
- package/lib/generators/common/format-lint/CommonLintGenerator.js +185 -185
- package/lib/generators/common/format-lint/updateEslintConfig.js +13 -13
- package/lib/generators/common/husky/CommonHuskyGenerator.js +44 -44
- package/lib/generators/common/old-dependencies/CommonRemoveOldDependenciesGenerator.js +44 -44
- package/lib/generators/common/release/CommonReleaseGenerator.js +40 -40
- package/lib/generators/common/testing/CommonTestingGenerator.js +190 -190
- package/lib/generators/common/testing/templates/index.js +3 -3
- package/lib/generators/common/transpiler/CommonTranspilerGenerator.js +163 -163
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +79 -79
- package/lib/generators/core/ci/CoreCIGenerator.js +72 -72
- package/lib/generators/core/clean/CoreCleanGenerator.js +4 -4
- package/lib/generators/core/editorconfig/CoreEditorConfigGenerator.js +3 -3
- package/lib/generators/core/git/CoreGitGenerator.js +43 -43
- package/lib/generators/core/git/generators/github/CoreGitGithubGenerator.js +43 -43
- package/lib/generators/core/gitignore/CoreGitignoreGenerator.js +19 -19
- package/lib/generators/core/npm/CoreNpmGenerator.js +20 -20
- package/lib/generators/core/package/CorePackageGenerator.js +98 -98
- package/lib/generators/core/package/askName.js +4 -4
- package/lib/generators/core/renovate/CoreRenovateGenerator.js +28 -28
- package/lib/generators/core/sort-package/CoreSortPackageGenerator.js +6 -6
- package/lib/generators/core/vscode/CoreVSCodeGenerator.js +43 -43
- package/lib/generators/core/yarn/CoreYarnGenerator.js +70 -70
- package/lib/generators/lib/PobLibGenerator.js +111 -111
- package/lib/generators/lib/doc/LibDocGenerator.js +45 -45
- package/lib/generators/lib/readme/LibReadmeGenerator.js +21 -21
- package/lib/generators/monorepo/PobMonorepoGenerator.js +89 -89
- package/lib/generators/monorepo/lerna/MonorepoLernaGenerator.js +47 -47
- package/lib/generators/monorepo/typescript/MonorepoTypescriptGenerator.js +38 -38
- package/lib/generators/monorepo/workspaces/MonorepoWorkspacesGenerator.js +57 -57
- package/lib/generators/pob/PobBaseGenerator.js +81 -81
- package/lib/pob-dirname.cjs +1 -1
- package/lib/pob.js +143 -143
- package/lib/utils/dependenciesPackages.cjs +4 -4
- package/lib/utils/ensureJsonFileFormatted.js +5 -5
- package/lib/utils/inMonorepo.js +8 -8
- package/lib/utils/json5.js +1 -1
- package/lib/utils/package.js +43 -43
- package/lib/utils/packagejson.cjs +2 -2
- package/lib/utils/templateUtils.js +1 -1
- package/lib/utils/writeAndFormat.js +9 -10
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [20.0.0](https://github.com/christophehurpeau/pob/compare/pob@19.2.0...pob@20.0.0) (2024-05-05)
|
|
7
|
+
|
|
8
|
+
Note: no notable changes
|
|
9
|
+
|
|
10
|
+
Version bump for dependency: sort-eslint-config
|
|
11
|
+
Version bump for dependency: sort-object
|
|
12
|
+
Version bump for dependency: sort-pkg
|
|
13
|
+
Version bump for dependency: yarn-workspace-utils
|
|
14
|
+
Version bump for dependency: root
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [19.2.0](https://github.com/christophehurpeau/pob/compare/pob@19.1.1...pob@19.2.0) (2024-05-05)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
import { execSync } from
|
|
2
|
-
import { platform } from
|
|
3
|
-
import Generator from
|
|
4
|
-
import inMonorepo from
|
|
5
|
-
import * as packageUtils from
|
|
6
|
-
import { appIgnorePaths } from
|
|
1
|
+
import { execSync } from "node:child_process";
|
|
2
|
+
import { platform } from "node:process";
|
|
3
|
+
import Generator from "yeoman-generator";
|
|
4
|
+
import inMonorepo from "../../utils/inMonorepo.js";
|
|
5
|
+
import * as packageUtils from "../../utils/package.js";
|
|
6
|
+
import { appIgnorePaths } from "./ignorePaths.js";
|
|
7
7
|
|
|
8
8
|
const appsWithTypescript = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
"alp",
|
|
10
|
+
"next.js",
|
|
11
|
+
"remix",
|
|
12
|
+
"pobpack",
|
|
13
|
+
"expo",
|
|
14
|
+
"yarn-plugin",
|
|
15
15
|
];
|
|
16
|
-
const appsWithBrowser = [
|
|
16
|
+
const appsWithBrowser = ["alp", "next.js", "remix"];
|
|
17
17
|
|
|
18
18
|
export default class PobAppGenerator extends Generator {
|
|
19
19
|
constructor(args, opts) {
|
|
20
20
|
super(args, opts);
|
|
21
21
|
|
|
22
|
-
this.option(
|
|
22
|
+
this.option("updateOnly", {
|
|
23
23
|
type: Boolean,
|
|
24
24
|
required: false,
|
|
25
25
|
default: false,
|
|
26
|
-
desc:
|
|
26
|
+
desc: "Avoid asking questions",
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
this.option(
|
|
29
|
+
this.option("fromPob", {
|
|
30
30
|
type: Boolean,
|
|
31
31
|
required: false,
|
|
32
32
|
default: false,
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
this.option(
|
|
35
|
+
this.option("packageManager", {
|
|
36
36
|
type: String,
|
|
37
|
-
default:
|
|
38
|
-
desc:
|
|
37
|
+
default: "yarn",
|
|
38
|
+
desc: "yarn or npm",
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
this.option(
|
|
41
|
+
this.option("yarnNodeLinker", {
|
|
42
42
|
type: String,
|
|
43
43
|
required: false,
|
|
44
|
-
default:
|
|
45
|
-
desc:
|
|
44
|
+
default: "node-modules",
|
|
45
|
+
desc: "Defines what linker should be used for installing Node packages (useful to enable the node-modules plugin), one of: pnp, node-modules.",
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
this.option(
|
|
48
|
+
this.option("disableYarnGitCache", {
|
|
49
49
|
type: Boolean,
|
|
50
50
|
required: false,
|
|
51
51
|
default: false,
|
|
52
|
-
desc:
|
|
52
|
+
desc: "Disable git cache. See https://yarnpkg.com/features/caching#offline-mirror.",
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
initializing() {
|
|
57
57
|
this.appConfig =
|
|
58
|
-
this.config.get(
|
|
58
|
+
this.config.get("app") || this.config.get("pob-app-config");
|
|
59
59
|
|
|
60
|
-
this.config.delete(
|
|
60
|
+
this.config.delete("pob-app-config"); // deprecated
|
|
61
61
|
|
|
62
62
|
// see lib, in case the app migrating from a lib when app were not available
|
|
63
|
-
this.config.delete(
|
|
64
|
-
this.config.delete(
|
|
65
|
-
this.fs.delete(
|
|
66
|
-
this.config.delete(
|
|
63
|
+
this.config.delete("pob"); // deprecated
|
|
64
|
+
this.config.delete("pob-config"); // deprecated
|
|
65
|
+
this.fs.delete(".pob.json"); // deprecated
|
|
66
|
+
this.config.delete("pob-lib-config"); // in case coming from lib
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
async prompting() {
|
|
70
70
|
const config = this.appConfig;
|
|
71
71
|
|
|
72
72
|
if (config && this.options.updateOnly) {
|
|
73
|
-
this.config.set(
|
|
73
|
+
this.config.set("app", this.appConfig);
|
|
74
74
|
this.config.save();
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
this.appConfig = await this.prompt([
|
|
79
79
|
{
|
|
80
|
-
type:
|
|
81
|
-
name:
|
|
82
|
-
message:
|
|
83
|
-
default: (config && config.type) ||
|
|
80
|
+
type: "list",
|
|
81
|
+
name: "type",
|
|
82
|
+
message: "What kind of app is this ?",
|
|
83
|
+
default: (config && config.type) || "alp",
|
|
84
84
|
choices: [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
"alp",
|
|
86
|
+
"pobpack",
|
|
87
|
+
"next.js",
|
|
88
|
+
"remix",
|
|
89
|
+
"node",
|
|
90
|
+
"node-library", // monorepo library for app. Not a real library
|
|
91
|
+
"untranspiled-library", // monorepo library for app. Not a real library
|
|
92
|
+
"alp-node",
|
|
93
|
+
"expo",
|
|
94
|
+
"other",
|
|
95
95
|
],
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
|
-
type:
|
|
99
|
-
name:
|
|
100
|
-
message:
|
|
98
|
+
type: "confirm",
|
|
99
|
+
name: "export",
|
|
100
|
+
message: "Use next export ?",
|
|
101
101
|
default: false,
|
|
102
|
-
when: (values) => values.type ===
|
|
102
|
+
when: (values) => values.type === "next.js",
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
type:
|
|
106
|
-
name:
|
|
107
|
-
message:
|
|
105
|
+
type: "confirm",
|
|
106
|
+
name: "testing",
|
|
107
|
+
message: "Do you want testing ?",
|
|
108
108
|
default:
|
|
109
109
|
!config || config.testing === undefined ? false : config.testing,
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
type:
|
|
113
|
-
name:
|
|
114
|
-
message:
|
|
112
|
+
type: "confirm",
|
|
113
|
+
name: "codecov",
|
|
114
|
+
message: "Do you want codecov ?",
|
|
115
115
|
default: !config || false,
|
|
116
116
|
when: (values) => values.testing,
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
type:
|
|
120
|
-
name:
|
|
121
|
-
message:
|
|
119
|
+
type: "confirm",
|
|
120
|
+
name: "ci",
|
|
121
|
+
message: "Do you want ci ?",
|
|
122
122
|
default: !config || config.ci === undefined ? true : config.ci,
|
|
123
123
|
when: () => !inMonorepo,
|
|
124
124
|
},
|
|
125
125
|
]);
|
|
126
126
|
|
|
127
|
-
this.config.set(
|
|
127
|
+
this.config.set("app", this.appConfig);
|
|
128
128
|
this.config.save();
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
default() {
|
|
132
132
|
const srcDirectory =
|
|
133
|
-
this.appConfig.type ===
|
|
133
|
+
this.appConfig.type === "yarn-plugin" ? "sources" : "src";
|
|
134
134
|
const isAppLibrary =
|
|
135
|
-
this.appConfig.type ===
|
|
136
|
-
this.appConfig.type ===
|
|
135
|
+
this.appConfig.type === "node-library" ||
|
|
136
|
+
this.appConfig.type === "untranspiled-library";
|
|
137
137
|
|
|
138
138
|
if (
|
|
139
|
-
this.appConfig.type ===
|
|
140
|
-
this.appConfig.type ===
|
|
141
|
-
this.appConfig.type ===
|
|
139
|
+
this.appConfig.type === "node" ||
|
|
140
|
+
this.appConfig.type === "node-library" ||
|
|
141
|
+
this.appConfig.type === "alp-node"
|
|
142
142
|
) {
|
|
143
|
-
this.composeWith(
|
|
143
|
+
this.composeWith("pob:common:babel", {
|
|
144
144
|
updateOnly: this.options.updateOnly,
|
|
145
145
|
onlyLatestLTS: true,
|
|
146
146
|
isApp: true,
|
|
147
147
|
isAppLibrary,
|
|
148
|
-
useAppConfig: this.appConfig.type ===
|
|
148
|
+
useAppConfig: this.appConfig.type === "alp-node",
|
|
149
149
|
testing: this.appConfig.testing,
|
|
150
150
|
documentation: false,
|
|
151
151
|
fromPob: this.options.fromPob,
|
|
152
|
-
buildDirectory:
|
|
152
|
+
buildDirectory: "build",
|
|
153
153
|
});
|
|
154
|
-
this.composeWith(
|
|
154
|
+
this.composeWith("pob:common:transpiler", {
|
|
155
155
|
updateOnly: this.options.updateOnly,
|
|
156
156
|
onlyLatestLTS: true,
|
|
157
157
|
isApp: true,
|
|
158
158
|
isAppLibrary,
|
|
159
|
-
useAppConfig: this.appConfig.type ===
|
|
159
|
+
useAppConfig: this.appConfig.type === "alp-node",
|
|
160
160
|
testing: this.appConfig.testing,
|
|
161
161
|
documentation: false,
|
|
162
162
|
fromPob: this.options.fromPob,
|
|
163
163
|
srcDirectory,
|
|
164
|
-
buildDirectory:
|
|
164
|
+
buildDirectory: "build",
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
const pkg = this.fs.readJSON(this.destinationPath(
|
|
168
|
+
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
169
169
|
|
|
170
170
|
if (!inMonorepo || inMonorepo.root) {
|
|
171
|
-
this.composeWith(
|
|
171
|
+
this.composeWith("pob:common:husky", {});
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
const babelEnvs = (pkg.pob && pkg.pob.babelEnvs) || [];
|
|
@@ -178,7 +178,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
178
178
|
const node = true;
|
|
179
179
|
const browser =
|
|
180
180
|
appsWithBrowser.includes(this.appConfig.type) ||
|
|
181
|
-
(babel && babelEnvs.some((env) => env.target ===
|
|
181
|
+
(babel && babelEnvs.some((env) => env.target === "browser"));
|
|
182
182
|
const jsx =
|
|
183
183
|
babelEnvs.length > 0 && pkg.pob.jsx !== undefined
|
|
184
184
|
? pkg.pob.jsx
|
|
@@ -190,61 +190,61 @@ export default class PobAppGenerator extends Generator {
|
|
|
190
190
|
|
|
191
191
|
const ignorePaths = appIgnorePaths[this.appConfig.type](
|
|
192
192
|
this.appConfig,
|
|
193
|
-
pkg
|
|
193
|
+
pkg
|
|
194
194
|
).filter(Boolean);
|
|
195
195
|
|
|
196
|
-
this.composeWith(
|
|
196
|
+
this.composeWith("pob:common:typescript", {
|
|
197
197
|
enable: typescript,
|
|
198
198
|
isApp: true,
|
|
199
199
|
isAppLibrary,
|
|
200
|
-
nextConfig: this.appConfig.type ===
|
|
200
|
+
nextConfig: this.appConfig.type === "next.js",
|
|
201
201
|
// nextjs now supports src
|
|
202
|
-
rootDir: this.appConfig.type ===
|
|
202
|
+
rootDir: this.appConfig.type === "expo" ? "." : srcDirectory,
|
|
203
203
|
srcDirectory,
|
|
204
204
|
builddefs: false,
|
|
205
205
|
dom: browser,
|
|
206
206
|
jsx,
|
|
207
|
-
jsxPreserve: this.appConfig.type ===
|
|
208
|
-
forceExcludeNodeModules: this.appConfig.type ===
|
|
209
|
-
forceAllowJs: this.appConfig.type ===
|
|
207
|
+
jsxPreserve: this.appConfig.type === "next.js",
|
|
208
|
+
forceExcludeNodeModules: this.appConfig.type === "next.js",
|
|
209
|
+
forceAllowJs: this.appConfig.type === "next.js",
|
|
210
210
|
updateOnly: this.options.updateOnly,
|
|
211
211
|
resolveJsonModule: true,
|
|
212
212
|
onlyLatestLTS: true,
|
|
213
213
|
baseUrl: (() => {
|
|
214
214
|
if (
|
|
215
|
-
this.appConfig.type ===
|
|
216
|
-
this.appConfig.type ===
|
|
217
|
-
this.appConfig.type ===
|
|
218
|
-
this.appConfig.type ===
|
|
215
|
+
this.appConfig.type === "alp" ||
|
|
216
|
+
this.appConfig.type === "pobpack" ||
|
|
217
|
+
this.appConfig.type === "alp-node" ||
|
|
218
|
+
this.appConfig.type === "next.js"
|
|
219
219
|
) {
|
|
220
220
|
return `./${srcDirectory}`;
|
|
221
221
|
}
|
|
222
|
-
if (this.appConfig.type ===
|
|
223
|
-
return
|
|
222
|
+
if (this.appConfig.type === "remix") {
|
|
223
|
+
return ".";
|
|
224
224
|
}
|
|
225
|
-
return
|
|
225
|
+
return "";
|
|
226
226
|
})(),
|
|
227
227
|
plugins: (() => {
|
|
228
|
-
if (this.appConfig.type ===
|
|
229
|
-
return
|
|
228
|
+
if (this.appConfig.type === "next.js") {
|
|
229
|
+
return "next";
|
|
230
230
|
}
|
|
231
|
-
return
|
|
231
|
+
return "";
|
|
232
232
|
})(),
|
|
233
233
|
additionalIncludes: (() => {
|
|
234
234
|
// if (this.appConfig.type === 'next.js') {
|
|
235
235
|
// return '.next/types/**/*.ts';
|
|
236
236
|
// }
|
|
237
|
-
return
|
|
237
|
+
return "";
|
|
238
238
|
})(),
|
|
239
239
|
});
|
|
240
240
|
|
|
241
|
-
this.composeWith(
|
|
241
|
+
this.composeWith("pob:common:remove-old-dependencies");
|
|
242
242
|
|
|
243
243
|
const enableReleasePlease =
|
|
244
244
|
!inMonorepo && this.appConfig.testing && this.appConfig.ci;
|
|
245
245
|
|
|
246
|
-
if (this.appConfig.type !==
|
|
247
|
-
this.composeWith(
|
|
246
|
+
if (this.appConfig.type !== "remix") {
|
|
247
|
+
this.composeWith("pob:common:testing", {
|
|
248
248
|
enable: this.appConfig.testing,
|
|
249
249
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
250
250
|
enableReleasePlease,
|
|
@@ -252,11 +252,11 @@ export default class PobAppGenerator extends Generator {
|
|
|
252
252
|
runner: this.appConfig.testing
|
|
253
253
|
? (inMonorepo
|
|
254
254
|
? inMonorepo.pobMonorepoConfig.testRunner
|
|
255
|
-
: this.appConfig.testRunner) ||
|
|
255
|
+
: this.appConfig.testRunner) || "jest"
|
|
256
256
|
: undefined,
|
|
257
|
-
e2eTesting: this.appConfig.e2e ?
|
|
257
|
+
e2eTesting: this.appConfig.e2e ? "." : "",
|
|
258
258
|
typescript,
|
|
259
|
-
build: typescript && this.appConfig.type !==
|
|
259
|
+
build: typescript && this.appConfig.type !== "expo",
|
|
260
260
|
documentation: false,
|
|
261
261
|
codecov: this.appConfig.codecov,
|
|
262
262
|
ci: this.appConfig.ci,
|
|
@@ -267,11 +267,11 @@ export default class PobAppGenerator extends Generator {
|
|
|
267
267
|
srcDirectory,
|
|
268
268
|
});
|
|
269
269
|
|
|
270
|
-
this.composeWith(
|
|
270
|
+
this.composeWith("pob:app:e2e-testing", {
|
|
271
271
|
enable: this.appConfig.e2e,
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
-
this.composeWith(
|
|
274
|
+
this.composeWith("pob:common:format-lint", {
|
|
275
275
|
isApp: true,
|
|
276
276
|
documentation: false,
|
|
277
277
|
testing: this.appConfig.testing,
|
|
@@ -284,16 +284,16 @@ export default class PobAppGenerator extends Generator {
|
|
|
284
284
|
enableSrcResolver: true,
|
|
285
285
|
packageManager: this.options.packageManager,
|
|
286
286
|
yarnNodeLinker: this.options.yarnNodeLinker,
|
|
287
|
-
rootIgnorePaths: ignorePaths.join(
|
|
287
|
+
rootIgnorePaths: ignorePaths.join("\n"),
|
|
288
288
|
srcDirectory,
|
|
289
|
-
buildDirectory: this.appConfig.type ===
|
|
289
|
+
buildDirectory: this.appConfig.type === "expo" ? ".expo" : "build",
|
|
290
290
|
});
|
|
291
291
|
|
|
292
|
-
this.composeWith(
|
|
292
|
+
this.composeWith("pob:common:release", {
|
|
293
293
|
enable:
|
|
294
294
|
!inMonorepo &&
|
|
295
295
|
this.appConfig.testing &&
|
|
296
|
-
pkg.name !==
|
|
296
|
+
pkg.name !== "yarn-plugin-conventional-version",
|
|
297
297
|
enablePublish: false,
|
|
298
298
|
withBabel: babel,
|
|
299
299
|
isMonorepo: false,
|
|
@@ -304,7 +304,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
this.composeWith(
|
|
307
|
+
this.composeWith("pob:core:vscode", {
|
|
308
308
|
root: !inMonorepo,
|
|
309
309
|
monorepo: false,
|
|
310
310
|
packageManager: this.options.packageManager,
|
|
@@ -315,45 +315,45 @@ export default class PobAppGenerator extends Generator {
|
|
|
315
315
|
});
|
|
316
316
|
|
|
317
317
|
// only for gitignore
|
|
318
|
-
if (this.fs.exists(
|
|
319
|
-
ignorePaths.push(
|
|
318
|
+
if (this.fs.exists(".env.example")) {
|
|
319
|
+
ignorePaths.push("/.env*", "!/.env.example");
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
this.composeWith(
|
|
322
|
+
this.composeWith("pob:core:gitignore", {
|
|
323
323
|
root: !inMonorepo || inMonorepo.root,
|
|
324
324
|
documentation: false,
|
|
325
325
|
testing: this.appConfig.testing,
|
|
326
326
|
withBabel: babel,
|
|
327
|
-
paths: ignorePaths.join(
|
|
327
|
+
paths: ignorePaths.join("\n"),
|
|
328
328
|
buildInGit: false,
|
|
329
329
|
});
|
|
330
330
|
|
|
331
|
-
this.composeWith(
|
|
331
|
+
this.composeWith("pob:core:npm", { enable: false });
|
|
332
332
|
|
|
333
333
|
switch (this.appConfig.type) {
|
|
334
|
-
case
|
|
335
|
-
this.composeWith(
|
|
334
|
+
case "next.js":
|
|
335
|
+
this.composeWith("pob:app:nextjs", {
|
|
336
336
|
export: this.appConfig.export,
|
|
337
337
|
});
|
|
338
338
|
break;
|
|
339
|
-
case
|
|
340
|
-
this.composeWith(
|
|
339
|
+
case "remix":
|
|
340
|
+
this.composeWith("pob:app:remix", {});
|
|
341
341
|
break;
|
|
342
342
|
// no default
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
if (platform !==
|
|
345
|
+
if (platform !== "win32") {
|
|
346
346
|
execSync(
|
|
347
|
-
`rm -Rf ${[
|
|
347
|
+
`rm -Rf ${["lib-*", "coverage", "docs", "dist"]
|
|
348
348
|
.filter(Boolean)
|
|
349
|
-
.join(
|
|
349
|
+
.join(" ")}`
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
writing() {
|
|
355
355
|
// Re-read the content at this point because a composed generator might modify it.
|
|
356
|
-
const pkg = this.fs.readJSON(this.destinationPath(
|
|
356
|
+
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
357
357
|
|
|
358
358
|
// if (isNpm) {
|
|
359
359
|
// if (!pkg.engines) pkg.engines = {};
|
|
@@ -363,8 +363,8 @@ export default class PobAppGenerator extends Generator {
|
|
|
363
363
|
delete pkg.engines.yarn;
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
this.fs.writeJSON(this.destinationPath(
|
|
366
|
+
this.fs.writeJSON(this.destinationPath("package.json"), pkg);
|
|
367
367
|
|
|
368
|
-
this.composeWith(
|
|
368
|
+
this.composeWith("pob:core:sort-package");
|
|
369
369
|
}
|
|
370
370
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import Generator from
|
|
2
|
-
import * as packageUtils from
|
|
1
|
+
import Generator from "yeoman-generator";
|
|
2
|
+
import * as packageUtils from "../../../utils/package.js";
|
|
3
3
|
// import * as templateUtils from '../../../utils/templateUtils.js';
|
|
4
|
-
import { writeAndFormatJson } from
|
|
4
|
+
import { writeAndFormatJson } from "../../../utils/writeAndFormat.js";
|
|
5
5
|
|
|
6
6
|
export default class AppE2ETestingGenerator extends Generator {
|
|
7
7
|
constructor(args, opts) {
|
|
8
8
|
super(args, opts);
|
|
9
9
|
|
|
10
|
-
this.option(
|
|
10
|
+
this.option("enable", {
|
|
11
11
|
type: Boolean,
|
|
12
12
|
default: true,
|
|
13
|
-
desc:
|
|
13
|
+
desc: "enable e2e testing",
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
this.option(
|
|
16
|
+
this.option("ci", {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
required: true,
|
|
19
|
-
desc:
|
|
19
|
+
desc: "ci",
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
writing() {
|
|
24
|
-
const pkg = this.fs.readJSON(this.destinationPath(
|
|
24
|
+
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
25
25
|
|
|
26
26
|
packageUtils.addOrRemoveDevDependencies(pkg, this.options.enable, [
|
|
27
|
-
|
|
27
|
+
"@playwright/test",
|
|
28
28
|
]);
|
|
29
29
|
|
|
30
30
|
packageUtils.addOrRemoveScripts(pkg, this.options.enable, {
|
|
31
|
-
|
|
31
|
+
"test:e2e": "playwright test",
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
// templateUtils.addOrRemoveTemplate(
|
|
@@ -40,6 +40,6 @@ export default class AppE2ETestingGenerator extends Generator {
|
|
|
40
40
|
if (this.options.enable) {
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
writeAndFormatJson(this.fs, this.destinationPath(
|
|
43
|
+
writeAndFormatJson(this.fs, this.destinationPath("package.json"), pkg);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export const appIgnorePaths = {
|
|
2
|
-
alp: (config) => [
|
|
3
|
-
|
|
2
|
+
alp: (config) => ["# alp paths", "/build", "/public", "/data"],
|
|
3
|
+
"next.js": (config, pkg) =>
|
|
4
4
|
[
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
pkg?.dependencies?.tamagui ?
|
|
11
|
-
pkg?.dependencies?.tamagui ?
|
|
5
|
+
"# next.js paths",
|
|
6
|
+
"/.next",
|
|
7
|
+
"/out",
|
|
8
|
+
"/build",
|
|
9
|
+
"/.env.local",
|
|
10
|
+
pkg?.dependencies?.tamagui ? "# tamagui" : undefined,
|
|
11
|
+
pkg?.dependencies?.tamagui ? "/.tamagui" : undefined,
|
|
12
12
|
].filter(Boolean),
|
|
13
|
-
remix: (config) => [
|
|
14
|
-
pobpack: (config) => [
|
|
15
|
-
node: (config) => [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
remix: (config) => ["# remix paths", "/.cache", "/build", "/public/build"],
|
|
14
|
+
pobpack: (config) => ["/build", "/public"],
|
|
15
|
+
node: (config) => ["/build"],
|
|
16
|
+
"node-library": (config) => ["/build"],
|
|
17
|
+
"untranspiled-library": (config) => [],
|
|
18
|
+
"alp-node": (config) => ["/build"],
|
|
19
19
|
other: (config) => [],
|
|
20
20
|
expo: (config) => [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
"/.expo/",
|
|
22
|
+
"*.jks",
|
|
23
|
+
"*.p8",
|
|
24
|
+
"*.p12",
|
|
25
|
+
"*.key",
|
|
26
|
+
"*.mobileprovision",
|
|
27
|
+
"*.orig.*",
|
|
28
|
+
"/web-build/",
|
|
29
29
|
|
|
30
30
|
// only if option is enabled which is not by default
|
|
31
31
|
// '# Temporary files created by Metro to check the health of the file watcher',
|
|
32
32
|
// '/.metro-health-check*',
|
|
33
33
|
],
|
|
34
|
-
|
|
34
|
+
"yarn-plugin": (config) => [],
|
|
35
35
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import Generator from
|
|
2
|
-
import * as packageUtils from
|
|
1
|
+
import Generator from "yeoman-generator";
|
|
2
|
+
import * as packageUtils from "../../../utils/package.js";
|
|
3
3
|
|
|
4
4
|
export default class AppNextjsGenerator extends Generator {
|
|
5
5
|
constructor(args, opts) {
|
|
6
6
|
super(args, opts);
|
|
7
7
|
|
|
8
|
-
this.option(
|
|
8
|
+
this.option("export", {
|
|
9
9
|
type: Boolean,
|
|
10
10
|
required: false,
|
|
11
11
|
default: true,
|
|
12
|
-
desc:
|
|
12
|
+
desc: "Use next export.",
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
writing() {
|
|
17
|
-
const pkg = this.fs.readJSON(this.destinationPath(
|
|
17
|
+
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
18
18
|
|
|
19
19
|
packageUtils.addScripts(pkg, {
|
|
20
|
-
start:
|
|
21
|
-
|
|
20
|
+
start: "next dev",
|
|
21
|
+
"start:prod": "next start",
|
|
22
22
|
// NODE_ENV=production is for tamagui
|
|
23
|
-
build:
|
|
23
|
+
build: "NODE_ENV=production next build",
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
this.fs.writeJSON(this.destinationPath(
|
|
26
|
+
this.fs.writeJSON(this.destinationPath("package.json"), pkg);
|
|
27
27
|
}
|
|
28
28
|
}
|