fabrique 2.0.3 → 2.0.6

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.
@@ -2,6 +2,7 @@ nodeLinker: node-modules
2
2
 
3
3
  npmMinimalAgeGate: 1d
4
4
 
5
- npmPreapprovedPackages: ["fabrique"]
5
+ npmPreapprovedPackages:
6
+ - fabrique
6
7
 
7
- yarnPath: .yarn/releases/yarn-4.16.0.cjs
8
+ yarnPath: .yarn/releases/yarn-4.17.0.cjs
@@ -35,17 +35,6 @@ yarn -v
35
35
  yarn install
36
36
  ```
37
37
 
38
- ### Environment variables
39
-
40
- ```shell
41
- # Copy the example file into .env:
42
- cp .env.example .env
43
- ```
44
-
45
- And replace the corresponding variables:
46
-
47
- - [NPM_AUTH_TOKEN](https://docs.npmjs.com/creating-and-viewing-access-tokens)
48
-
49
38
  ### Code
50
39
 
51
40
  - The source code is located in the `src` directory.
@@ -68,22 +57,70 @@ And replace the corresponding variables:
68
57
  - `fb:bench`: runs the bench tests.
69
58
  - `fb:typedoc`: generates the documentation.
70
59
  - if the library exposes publicly only a few and/or simple parts, the documentation may be defined in the `README.md` instead.
71
- - `fb:prod`: builds the lib in `prod` mode.
72
- - builds and publishes the lib on npm as a _prod_ version.
73
- - `fb:dev`: builds the lib in `dev` mode.
74
- - builds and publishes the lib on a local `verdaccio` with a `dev` tag.
75
- - a local `verdaccio` is used to debug/test your library in another project:
76
- - it is better than `npm link`, as it enforce a specific version, and allows some dependencies to be `dev` too.
77
- - `fb:rc`: builds the lib in `rc` mode.
78
- - builds and publishes the lib on npm with a `rc` tag.
79
- - to test before production and final release
80
-
81
- ### To create an MR
60
+
61
+ ### To create a PR
82
62
 
83
63
  1. fork the repository
84
64
  1. add the feature/fix by modifying the code in the `src/` directory
85
65
  1. add/write some tests until 100% code coverage is reached (run the tests with `yarn fb:test:coverage`)
86
66
  1. format the code, using the command `yarn fb:format`
87
67
  1. commit and push your work following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) convention
88
- 1. create an MR from your repository to the upstream repository, explaining clearly what was added/fixed.
68
+ 1. create a PR from your repository to the upstream repository, explaining clearly what was added/fixed.
69
+
70
+ ## Release Workflow
71
+
72
+ ### 1. Pull Request to `main` or `develop`
73
+
74
+ - The `release.yml` workflow runs on `pull_request`
75
+ - The `yarn fb:ci:release` step runs **only if** the PR has the `dev` label
76
+ - Impacted packages are published as:
77
+ - `x.y.z-dev.<timestamp>`
78
+ - npm dist-tag: `dev`
79
+
80
+ ### 2. Push to `develop`
81
+
82
+ - Impacted packages are published as:
83
+ - `x.y.z-rc.<timestamp>`
84
+ - npm dist-tag: `rc`
85
+
86
+ ### 3. Push to `main`
87
+
88
+ - Stable publication:
89
+ - `x.y.z`
90
+ - npm dist-tag: `latest`
91
+ - Only if `name@x.y.z` does not already exist on npm
92
+
93
+ ### Graph
94
+
95
+ ```mermaid
96
+ flowchart LR
97
+ EVENT("EVENT")
98
+ HAS_DEV_TAG{"has &quotdev&quot tag ?"}
99
+ SKIP_BUILD(["skip build"])
100
+ BUILD_DEV_PACKAGES["build &quotdev&quot package"]
101
+ PUBLISH_DEV_PACKAGES["publish &quotdev&quot package"]
102
+ BUILD_RC_PACKAGES["build &quotrc&quot package"]
103
+ PUBLISH_RC_PACKAGES["publish &quotrc&quot package"]
104
+ BUILD_PROD_PACKAGES["build &quotprod&quot package"]
105
+ PUBLISH_PROD_PACKAGES["publish &quotprod&quot package"]
106
+ TARGET_BRANCH{"branch"}
107
+
108
+ EVENT -- "pull_request" --> HAS_DEV_TAG
109
+ HAS_DEV_TAG -- "no" --> SKIP_BUILD
110
+ HAS_DEV_TAG -- "yes" --> BUILD_DEV_PACKAGES
111
+ BUILD_DEV_PACKAGES --> PUBLISH_DEV_PACKAGES
112
+
113
+ EVENT -- "push" --> TARGET_BRANCH
114
+
115
+ TARGET_BRANCH -- "develop" --> BUILD_RC_PACKAGES
116
+ BUILD_RC_PACKAGES --> PUBLISH_RC_PACKAGES
117
+
118
+ TARGET_BRANCH -- "main" --> BUILD_PROD_PACKAGES
119
+ BUILD_PROD_PACKAGES --> PUBLISH_PROD_PACKAGES
120
+ ```
121
+
122
+ ## Important Rules
89
123
 
124
+ - if the version already exists on npm: the release is skipped
125
+ - the `package.json` file in the repo must keep stable versions (`x.y.z`)
126
+ - `-dev` / `-rc` suffixes are generated in CI
@@ -7,7 +7,7 @@
7
7
  "=== FB: BUILD ===": "",
8
8
  "fb:build": "fabrique build",
9
9
  "=== FB: CODE QUALITY ===": "",
10
- "fb:format": "yarn format:fix",
10
+ "fb:format": "yarn fb:format:fix",
11
11
  "fb:format:check": "prettier --check --ignore-unknown --config .prettierrc \"./**/*.{js,jsx,ts,tsx,html,css,scss,json,md}\"",
12
12
  "fb:format:fix": "prettier --write --ignore-unknown --config .prettierrc \"./**/*.{js,jsx,ts,tsx,html,css,scss,json,md}\"",
13
13
  "fb:check": "yarn fb:check:types && yarn fb:format:check",
@@ -31,13 +31,13 @@
31
31
  "url": "{{giturl}}"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/node": "^25.9.3",
35
- "@vitest/coverage-istanbul": "^4.1.8",
36
- "prettier": "^3.8.4",
34
+ "@types/node": "^26.1.0",
35
+ "@vitest/coverage-istanbul": "^4.1.9",
36
+ "prettier": "^3.9.4",
37
37
  "prettier-plugin-organize-imports": "^4.3.0",
38
38
  "typedoc": "^0.28.19",
39
39
  "typescript": "^6.0.3",
40
- "vitest": "^4.1.8"
40
+ "vitest": "^4.1.9"
41
41
  },
42
- "packageManager": "yarn@4.16.0"
42
+ "packageManager": "yarn@4.17.0"
43
43
  }