fabrique 1.1.1 → 1.1.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fabrique",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"bin": "./src/index.js",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"packageManager": "yarn@4.12.0",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"
|
|
25
|
-
"prettier": "^3.7.4",
|
|
24
|
+
"prettier": "^3.8.1",
|
|
26
25
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
27
26
|
"typescript": "^5.9.3"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
29
|
+
"@inquirer/prompts": "^8.2.0",
|
|
30
30
|
"chalk": "^5.6.2",
|
|
31
31
|
"commander": "^14.0.2"
|
|
32
32
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NPM_TOKEN="npm_XXX"
|
|
@@ -2,36 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
This projet is open to everyone. Feel free to test the library, share it, improve it, and create merge requests.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Getting started
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Tools
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
#### [nvm](https://github.com/nvm-sh/nvm)
|
|
10
|
+
|
|
11
|
+
We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your Node.js versions.
|
|
10
12
|
|
|
11
13
|
```shell
|
|
12
|
-
nvm
|
|
14
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Then, we have to use the proper package manager (here `yarn`):
|
|
17
|
+
#### [Node](https://nodejs.org)
|
|
18
18
|
|
|
19
19
|
```shell
|
|
20
|
-
|
|
20
|
+
nvm use
|
|
21
|
+
|
|
22
|
+
# Verify the Node.js version:
|
|
23
|
+
node -v
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
#### [Yarn](https://yarnpkg.com)
|
|
24
27
|
|
|
25
28
|
```shell
|
|
26
|
-
|
|
29
|
+
corepack enable yarn
|
|
30
|
+
|
|
31
|
+
# Verify Yarn version:
|
|
32
|
+
yarn -v
|
|
33
|
+
|
|
34
|
+
# Install the dependencies:
|
|
35
|
+
yarn install
|
|
27
36
|
```
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
### Environment variables
|
|
30
39
|
|
|
31
40
|
```shell
|
|
32
|
-
|
|
41
|
+
# Copy the example file into .env:
|
|
42
|
+
cp .env.example .env
|
|
33
43
|
```
|
|
34
44
|
|
|
45
|
+
And replace the corresponding variables:
|
|
46
|
+
|
|
47
|
+
- [NPM_TOKEN](https://docs.npmjs.com/creating-and-viewing-access-tokens)
|
|
48
|
+
|
|
35
49
|
### Code
|
|
36
50
|
|
|
37
51
|
- The source code is located in the `src` directory.
|
|
@@ -18,6 +18,7 @@ export async function publish({ mode = 'prod' } = {}) {
|
|
|
18
18
|
* registry?: string;
|
|
19
19
|
* access?: 'public';
|
|
20
20
|
* tag?: string;
|
|
21
|
+
* extra?: any;
|
|
21
22
|
* }}
|
|
22
23
|
*/
|
|
23
24
|
const options = {};
|
|
@@ -32,8 +33,12 @@ export async function publish({ mode = 'prod' } = {}) {
|
|
|
32
33
|
options.registry = 'http://localhost:4873';
|
|
33
34
|
options.tag = 'dev';
|
|
34
35
|
} else {
|
|
36
|
+
args.unshift(`--//registry.npmjs.org/:_authToken=$NPM_TOKEN`);
|
|
35
37
|
options.registry = 'https://registry.npmjs.org';
|
|
36
38
|
options.access = 'public';
|
|
39
|
+
options.extra = {
|
|
40
|
+
shell: true,
|
|
41
|
+
};
|
|
37
42
|
|
|
38
43
|
if (mode === 'rc') {
|
|
39
44
|
options.tag = 'rc';
|
|
@@ -56,7 +61,10 @@ export async function publish({ mode = 'prod' } = {}) {
|
|
|
56
61
|
args.push('--tag', options.tag);
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
await cmd('npm', args, {
|
|
64
|
+
await cmd('npm', args, {
|
|
65
|
+
...options.extra,
|
|
66
|
+
cwd: resolve(packagePath),
|
|
67
|
+
});
|
|
60
68
|
|
|
61
69
|
console.log('Library published with success !');
|
|
62
70
|
}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"fb:test:coverage": "vitest run --coverage",
|
|
11
11
|
"fb:bench": "vitest bench",
|
|
12
12
|
"fb:typedoc": "typedoc --options typedoc.json --tsconfig tsconfig.json",
|
|
13
|
-
"fb:prod": "node fabrique/actions/cli/build-and-publish.cli.js --mode prod",
|
|
13
|
+
"fb:prod": "node --env-file='.env' fabrique/actions/cli/build-and-publish.cli.js --mode prod",
|
|
14
14
|
"fb:dev": "node fabrique/actions/cli/build-and-publish.cli.js --mode dev",
|
|
15
|
-
"fb:rc": "node fabrique/actions/cli/build-and-publish.cli.js --mode rc",
|
|
15
|
+
"fb:rc": "node --env-file='.env' fabrique/actions/cli/build-and-publish.cli.js --mode rc",
|
|
16
16
|
"fb:node:dev": "node --experimental-strip-types --watch src/main.ts",
|
|
17
17
|
"fb:node:dev:inspect": "node --experimental-strip-types --watch --inspect src/main.ts"
|
|
18
18
|
},
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"url": "{{giturl}}"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "^25.0.
|
|
30
|
-
"@vitest/coverage-istanbul": "^4.0.
|
|
31
|
-
"prettier": "^3.
|
|
29
|
+
"@types/node": "^25.0.10",
|
|
30
|
+
"@vitest/coverage-istanbul": "^4.0.18",
|
|
31
|
+
"prettier": "^3.8.1",
|
|
32
32
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
33
33
|
"typedoc": "^0.28.16",
|
|
34
34
|
"typescript": "^5.9.3",
|
|
35
|
-
"vitest": "^4.0.
|
|
35
|
+
"vitest": "^4.0.18"
|
|
36
36
|
},
|
|
37
37
|
"packageManager": "yarn@4.12.0"
|
|
38
38
|
}
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
"name": "Documentation",
|
|
3
3
|
"entryPoints": ["src/**/*.ts"],
|
|
4
4
|
"readme": "README.md",
|
|
5
|
-
"exclude": [
|
|
6
|
-
"src/**/*.{test,bench,protected,private}.ts",
|
|
7
|
-
"src/**/*.{protected,private}/**/*.ts"
|
|
8
|
-
],
|
|
5
|
+
"exclude": ["src/**/*.{test,bench,protected,private}.ts", "src/**/*.{protected,private}/**/*.ts"],
|
|
9
6
|
"compilerOptions": {
|
|
10
7
|
"skipLibCheck": true
|
|
11
8
|
},
|
|
9
|
+
"sort": ["static-first", "source-order"],
|
|
12
10
|
"outputs": [
|
|
13
11
|
{
|
|
14
12
|
"name": "html",
|