fabrique 1.0.4 → 1.0.21
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/.yarn/releases/{yarn-4.9.4.cjs → yarn-4.12.0.cjs} +331 -331
- package/.yarnrc.yml +1 -1
- package/LICENSE +1 -1
- package/package.json +8 -8
- package/src/actions/create.js +21 -1
- package/templates/lib/.yarn/releases/{yarn-4.9.4.cjs → yarn-4.12.0.cjs} +331 -331
- package/templates/lib/.yarnrc.yml +1 -1
- package/templates/lib/fabrique/test/tools.ts +21 -2
- package/templates/lib/package.json +11 -9
- package/templates/lib/vitest.config.ts +3 -2
package/.yarnrc.yml
CHANGED
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fabrique",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"bin": "./src/index.js",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/lifaon74/fabrique"
|
|
21
21
|
},
|
|
22
|
-
"packageManager": "yarn@4.
|
|
22
|
+
"packageManager": "yarn@4.12.0",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@inquirer/prompts": "^
|
|
25
|
-
"prettier": "^3.
|
|
26
|
-
"prettier-plugin-organize-imports": "^4.
|
|
27
|
-
"typescript": "^5.9.
|
|
24
|
+
"@inquirer/prompts": "^8.0.2",
|
|
25
|
+
"prettier": "^3.7.4",
|
|
26
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
27
|
+
"typescript": "^5.9.3"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"chalk": "^5.6.
|
|
31
|
-
"commander": "^14.0.
|
|
30
|
+
"chalk": "^5.6.2",
|
|
31
|
+
"commander": "^14.0.2"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/actions/create.js
CHANGED
|
@@ -46,7 +46,7 @@ export async function create(type, name) {
|
|
|
46
46
|
libname: await input({ message: 'Library name', default: name, required: true }),
|
|
47
47
|
description: await input({ message: 'Description' }),
|
|
48
48
|
author: await input({ message: 'Author' }),
|
|
49
|
-
giturl: await input({ message: 'Git url' }),
|
|
49
|
+
giturl: normalizeGitUrl(await input({ message: 'Git url' })),
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
console.log(chalk.magentaBright('Initializing the library...'));
|
|
@@ -70,6 +70,26 @@ export async function create(type, name) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/*---*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Transform a git url into a valid one.
|
|
76
|
+
* @param {string} input
|
|
77
|
+
* @return {string}
|
|
78
|
+
*/
|
|
79
|
+
function normalizeGitUrl(input) {
|
|
80
|
+
const gitUrl = new URL(input);
|
|
81
|
+
|
|
82
|
+
if (!gitUrl.pathname.endsWith('.git')) {
|
|
83
|
+
input = `${input}.git`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!gitUrl.protocol.startsWith('git+')) {
|
|
87
|
+
input = `git+${input}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return input;
|
|
91
|
+
}
|
|
92
|
+
|
|
73
93
|
/**
|
|
74
94
|
* Replaces the patterns `{{name}}` from all the files found inside `cwd`.
|
|
75
95
|
*
|