@whook/create 12.1.0 → 13.1.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/README.md +2 -2
- package/dist/index.js +8 -10
- package/dist/index.js.map +1 -1
- package/dist/services/author.js.map +1 -1
- package/dist/services/author.test.js +1 -0
- package/dist/services/author.test.js.map +1 -1
- package/dist/services/createWhook.js +4 -0
- package/dist/services/createWhook.js.map +1 -1
- package/dist/services/createWhook.test.js +503 -481
- package/dist/services/createWhook.test.js.map +1 -1
- package/dist/services/project.js.map +1 -1
- package/dist/services/project.test.js +1 -0
- package/dist/services/project.test.js.map +1 -1
- package/package.json +52 -50
- package/src/index.ts +11 -10
- package/src/services/__snapshots__/createWhook.test.ts.snap +217 -152
- package/src/services/author.test.ts +1 -0
- package/src/services/author.ts +1 -1
- package/src/services/createWhook.test.ts +505 -482
- package/src/services/createWhook.ts +18 -12
- package/src/services/project.test.ts +1 -0
- package/src/services/project.ts +1 -1
|
@@ -100,6 +100,7 @@ export default autoService(async function initCreateWhook({
|
|
|
100
100
|
path.join(SOURCE_DIR, 'package-lock.json'),
|
|
101
101
|
path.join(SOURCE_DIR, 'LICENSE'),
|
|
102
102
|
path.join(SOURCE_DIR, 'README.md'),
|
|
103
|
+
path.join(SOURCE_DIR, 'src/watch.ts'),
|
|
103
104
|
].includes(src)
|
|
104
105
|
) {
|
|
105
106
|
log(
|
|
@@ -128,20 +129,25 @@ ${author.name}
|
|
|
128
129
|
`,
|
|
129
130
|
),
|
|
130
131
|
),
|
|
131
|
-
...(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
),
|
|
132
|
+
...(await readdir(path.join(SOURCE_DIR, 'src', 'config'))).map(
|
|
133
|
+
(environment) =>
|
|
134
|
+
environment === 'common'
|
|
135
|
+
? Promise.resolve()
|
|
136
|
+
: writeFile(
|
|
137
|
+
path.join(project.directory, `.env.${environment}`),
|
|
138
|
+
'JWT_SECRET=oudelali\n',
|
|
139
|
+
),
|
|
140
140
|
),
|
|
141
141
|
writeFile(
|
|
142
142
|
path.join(project.directory, 'package.json'),
|
|
143
143
|
JSON.stringify(finalPackageJSON, null, 2),
|
|
144
144
|
),
|
|
145
|
+
readFile(path.join(SOURCE_DIR, 'src/watch.ts')).then((data) => {
|
|
146
|
+
return writeFile(
|
|
147
|
+
path.join(SOURCE_DIR, 'src/watch.ts'),
|
|
148
|
+
data.toString().replace('../../', './'),
|
|
149
|
+
);
|
|
150
|
+
}),
|
|
145
151
|
writeFile(
|
|
146
152
|
path.join(project.directory, 'tsconfig.json'),
|
|
147
153
|
JSON.stringify(
|
|
@@ -187,7 +193,7 @@ ${author.name}
|
|
|
187
193
|
'error',
|
|
188
194
|
`⚠️ - Could not retrieve the \`.gitignore\` file contents from: "${GIT_IGNORE_URL}"`,
|
|
189
195
|
);
|
|
190
|
-
log('error-stack', printStackTrace(err));
|
|
196
|
+
log('error-stack', printStackTrace(err as Error));
|
|
191
197
|
}),
|
|
192
198
|
new Promise((resolve, reject) =>
|
|
193
199
|
exec(
|
|
@@ -206,7 +212,7 @@ ${author.name}
|
|
|
206
212
|
),
|
|
207
213
|
).catch((err) => {
|
|
208
214
|
log('error', '⚠️ - Could not initialize the git project!');
|
|
209
|
-
log('error-stack', printStackTrace(err));
|
|
215
|
+
log('error-stack', printStackTrace(err as Error));
|
|
210
216
|
}),
|
|
211
217
|
]);
|
|
212
218
|
|
|
@@ -242,7 +248,7 @@ ${author.name}
|
|
|
242
248
|
symbol: '❌',
|
|
243
249
|
text: 'Failed to install dependencies',
|
|
244
250
|
});
|
|
245
|
-
log('error-stack', printStackTrace(err));
|
|
251
|
+
log('error-stack', printStackTrace(err as Error));
|
|
246
252
|
}
|
|
247
253
|
|
|
248
254
|
log(
|
package/src/services/project.ts
CHANGED
|
@@ -54,7 +54,7 @@ export default autoService(async function initProject({
|
|
|
54
54
|
'error',
|
|
55
55
|
`Cannot create the project's directory: "${projectDirectory}"`,
|
|
56
56
|
);
|
|
57
|
-
log('error-stack', printStackTrace(err));
|
|
57
|
+
log('error-stack', printStackTrace(err as Error));
|
|
58
58
|
throw YError.wrap(err as Error, 'E_PROJECT_DIR', projectDirectory);
|
|
59
59
|
}
|
|
60
60
|
|