@vidavidorra/create-project 2.0.25 → 2.0.27
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/dist/options.js +5 -5
- package/package.json +3 -3
package/dist/options.js
CHANGED
|
@@ -4,11 +4,11 @@ import validatePackageName from 'validate-npm-package-name';
|
|
|
4
4
|
const schema = z
|
|
5
5
|
.object({
|
|
6
6
|
project: z.string().min(1),
|
|
7
|
-
package: z.string().superRefine((value,
|
|
7
|
+
package: z.string().superRefine((value, context) => {
|
|
8
8
|
const { validForNewPackages, errors, warnings } = validatePackageName(value);
|
|
9
9
|
if (!validForNewPackages) {
|
|
10
10
|
for (const message of [...(errors ?? []), ...(warnings ?? [])]) {
|
|
11
|
-
|
|
11
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message });
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}),
|
|
@@ -23,11 +23,11 @@ const schema = z
|
|
|
23
23
|
path: z
|
|
24
24
|
.string()
|
|
25
25
|
.min(1)
|
|
26
|
-
.superRefine((value,
|
|
26
|
+
.superRefine((value, context) => {
|
|
27
27
|
const exists = fs.existsSync(value);
|
|
28
28
|
if (exists) {
|
|
29
29
|
if (!fs.statSync(value).isDirectory()) {
|
|
30
|
-
|
|
30
|
+
context.addIssue({
|
|
31
31
|
code: z.ZodIssueCode.custom,
|
|
32
32
|
message: 'Expected an empty directory, received a file.',
|
|
33
33
|
});
|
|
@@ -35,7 +35,7 @@ const schema = z
|
|
|
35
35
|
}
|
|
36
36
|
const { files } = fs.statfsSync(value);
|
|
37
37
|
if (files !== 0) {
|
|
38
|
-
|
|
38
|
+
context.addIssue({
|
|
39
39
|
code: z.ZodIssueCode.custom,
|
|
40
40
|
message: [
|
|
41
41
|
'Expected an empty directory, received a directory with',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vidavidorra/create-project",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Interactively create a GitHub project",
|
|
6
6
|
"keywords": [
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
},
|
|
211
211
|
"devDependencies": {
|
|
212
212
|
"@ava/typescript": "4.1.0",
|
|
213
|
-
"@commitlint/cli": "18.6.
|
|
213
|
+
"@commitlint/cli": "18.6.1",
|
|
214
214
|
"@semantic-release/changelog": "6.0.3",
|
|
215
215
|
"@semantic-release/exec": "6.0.3",
|
|
216
216
|
"@semantic-release/git": "10.0.1",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
"lint-staged": "15.2.2",
|
|
226
226
|
"semantic-release": "23.0.2",
|
|
227
227
|
"sinon": "17.0.1",
|
|
228
|
-
"xo": "0.
|
|
228
|
+
"xo": "0.57.0"
|
|
229
229
|
},
|
|
230
230
|
"engines": {
|
|
231
231
|
"node": ">=18"
|