emilsoftware-utilities 2.0.0-dev.72 → 2.0.0-dev.73
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 +42 -0
- package/dist/accessi-module/Console/console.js +2 -0
- package/dist/accessi-module/Console/wiki.js +2 -0
- package/dist/accessi-module/Console/wiki.js.map +1 -1
- package/dist/emilsoftware-utilities-2.0.0-dev.73.tgz +0 -0
- package/docs/accessi-openapi-baseline.json +4500 -0
- package/docs/accessi-openapi-breaking-allowlist.json +1 -0
- package/docs/adr/0001-split-package.md +79 -0
- package/package.json +19 -4
- package/dist/emilsoftware-utilities-2.0.0-dev.72.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# ADR 0001 — Split in pacchetti separati: contracts, client, resource-server, server
|
|
2
|
+
|
|
3
|
+
- **Stato:** accettato
|
|
4
|
+
- **Data:** 2026-10-30
|
|
5
|
+
- **Issue:** #9
|
|
6
|
+
- **Ambito:** packaging e rilascio di `emilsoftware-utilities`
|
|
7
|
+
|
|
8
|
+
## Contesto
|
|
9
|
+
|
|
10
|
+
Il package espone gia entry point separati (`accessi/server`, `accessi/resource-server`,
|
|
11
|
+
`accessi/client` con gli scope `public`/`admin`/`service`, `accessi/contracts`, `accessi/openapi`,
|
|
12
|
+
`accessi/console`, `accessi/ui`). Hanno però un unico `package.json`, un unico numero di versione e
|
|
13
|
+
un unico ciclo di rilascio, mentre i consumer reali hanno esigenze diverse:
|
|
14
|
+
|
|
15
|
+
- i frontend usano solo `contracts` e `client/public` e non devono scaricare Nest, Firebird o SMTP;
|
|
16
|
+
- i backend fratelli usano `resource-server` e `client/service`;
|
|
17
|
+
- solo il backend proprietario usa `server` (database, migrazioni, console).
|
|
18
|
+
|
|
19
|
+
Oggi il tarball contiene tutto (~950 KB) e una modifica server-side obbliga un bump che i frontend
|
|
20
|
+
devono comunque recepire. Lo split è però un cambio invasivo per i consumer e per la release.
|
|
21
|
+
|
|
22
|
+
## Opzioni valutate
|
|
23
|
+
|
|
24
|
+
| Opzione | Pro | Contro |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| **A. Pacchetto singolo con entry point per scope (attuale)** | Zero migrazioni; un solo `npm ci`; types condivisi per costruzione; release unica e semplice; il tree-shaking elimina il codice non importato | Il tarball contiene dipendenze server anche per i frontend; versione unica per domini diversi |
|
|
27
|
+
| **B. Monorepo npm workspaces con 4 pacchetti** | Versioning indipendente; dipendenze minime per pacchetto; build/publish selettivi | Richiede cambiare toolchain, CI e release; 4 tarball da pubblicare; gestione versioni incrociate (`contracts` → `client`); migrazione dei consumer |
|
|
28
|
+
| **C. Pacchetti in repository separati** | Massima indipendenza | Frammentazione, PR incrociate, release coordinate manualmente, overhead alto per un team piccolo |
|
|
29
|
+
|
|
30
|
+
## Decisione
|
|
31
|
+
|
|
32
|
+
Si adotta **l'opzione A** nel breve periodo, rafforzata dagli entry point per scope introdotti
|
|
33
|
+
nell'issue #7 e verificati dal test `npm run test:pack`.
|
|
34
|
+
|
|
35
|
+
Motivazioni:
|
|
36
|
+
|
|
37
|
+
1. **Nessuna regressione:** gli import esistenti (`emilsoftware-utilities`,
|
|
38
|
+
`.../accessi/client`, ...) restano identici; una migrazione forzata avrebbe costo alto e
|
|
39
|
+
beneficio non dimostrato.
|
|
40
|
+
2. **Tipi condivisi per costruzione:** un solo set di modelli generati da OpenAPI evita divergenze
|
|
41
|
+
tra client e contracts, che con pacchetti separati andrebbero versionati insieme.
|
|
42
|
+
3. **Bundle:** i consumer browser usano `accessi/client/public` e `accessi/contracts`; con
|
|
43
|
+
`sideEffects` limitato ai soli moduli con effetti, i bundler eliminano il resto.
|
|
44
|
+
4. **Release riproducibile:** `npm ci && npm run build && npm run test:pack` produce e verifica lo
|
|
45
|
+
stesso tarball; semantic-release pubblica un solo artefatto.
|
|
46
|
+
|
|
47
|
+
Lo split resta un'opzione futura, non un rifiuto: le soglie che lo giustificherebbero sono elencate
|
|
48
|
+
sotto.
|
|
49
|
+
|
|
50
|
+
## Quando rivalutare
|
|
51
|
+
|
|
52
|
+
Riaprire la decisione (ADR successivo) se si verifica almeno una di queste condizioni:
|
|
53
|
+
|
|
54
|
+
- i frontend richiedono un rilascio di `contracts`/`client` indipendente da `server`;
|
|
55
|
+
- il peso delle dipendenze server nel bundle browser diventa un problema non risolvibile con il
|
|
56
|
+
tree-shaking (es. consumer senza bundler);
|
|
57
|
+
- il team cresce al punto da avere cicli di rilascio separati per server e client;
|
|
58
|
+
- si rende necessario pubblicare su registry diversi o con licenze diverse.
|
|
59
|
+
|
|
60
|
+
## Piano di migrazione (se e quando)
|
|
61
|
+
|
|
62
|
+
1. Introdurre i workspace (`npm workspaces`) mantenendo i path pubblici attuali come facade.
|
|
63
|
+
2. Estrarre per primo `contracts` (zero dipendenze runtime), poi `client`, poi `resource-server`,
|
|
64
|
+
infine `server`.
|
|
65
|
+
3. Ogni pacchetto facade re-esporta dal nuovo package, così `accessi/client`, `accessi/contracts`,
|
|
66
|
+
ecc. continuano a funzionare senza modifiche ai consumer.
|
|
67
|
+
4. Aggiungere una test matrix che installa i tarball di tutti i pacchetti insieme e verifica i path
|
|
68
|
+
legacy.
|
|
69
|
+
5. Deprecare i facade solo in una major successiva, con guida di migrazione.
|
|
70
|
+
|
|
71
|
+
## Conseguenze
|
|
72
|
+
|
|
73
|
+
- **Versioning:** unico, gestito da semantic-release sul branch `dev` → `main`.
|
|
74
|
+
- **Compatibilita:** garantita dall'export map e dallo smoke test del tarball
|
|
75
|
+
(`scripts/pack-smoke-consumer.cjs`) che copre ogni subpath e gli scope client.
|
|
76
|
+
- **Build/publish riproducibili:** build dichiarativa (`npm run build`), configurazione npm
|
|
77
|
+
isolata nello smoke test, nessun passaggio manuale oltre al merge.
|
|
78
|
+
- **Debito accettato:** il tarball include dipendenze server anche per i consumer frontend; è un
|
|
79
|
+
costo noto e monitorato, non un bug.
|
package/package.json
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emilsoftware-utilities",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.73",
|
|
4
4
|
"description": "Utilities for EmilSoftware",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
"*": {
|
|
10
|
+
"accessi/*": [
|
|
11
|
+
"dist/accessi/*"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"./dist/index.js",
|
|
17
|
+
"./dist/firebird-compat.js",
|
|
18
|
+
"./dist/accessi-module/Console/console.js"
|
|
19
|
+
],
|
|
8
20
|
"exports": {
|
|
9
21
|
".": {
|
|
10
22
|
"types": "./dist/index.d.ts",
|
|
@@ -105,9 +117,11 @@
|
|
|
105
117
|
},
|
|
106
118
|
"scripts": {
|
|
107
119
|
"release": "semantic-release",
|
|
108
|
-
"build": "npm run generate:accessi-openapi && npm run check:accessi-openapi && npm run generate:accessi-client && npm run generate:accessi-wiki && tsc && tsc -p tsconfig.console.json --noEmit && npm run build:accessi-console && npm run copy-views",
|
|
120
|
+
"build": "npm run generate:accessi-openapi && npm run check:accessi-openapi && npm run check:accessi-openapi-diff && npm run generate:accessi-client && npm run generate:accessi-wiki && tsc && tsc -p tsconfig.console.json --noEmit && npm run build:accessi-console && npm run copy-views",
|
|
109
121
|
"check:accessi-openapi": "node scripts/check-accessi-openapi.cjs",
|
|
110
122
|
"accessi:update-openapi-fingerprint": "node scripts/check-accessi-openapi.cjs --update",
|
|
123
|
+
"check:accessi-openapi-diff": "node scripts/openapi-semantic-diff.cjs",
|
|
124
|
+
"accessi:update-openapi-baseline": "node scripts/openapi-semantic-diff.cjs --update",
|
|
111
125
|
"generate:accessi-openapi": "ts-node --transpile-only src/scripts/generateAccessiOpenApi.ts",
|
|
112
126
|
"generate:accessi-client": "orval --config orval.config.ts",
|
|
113
127
|
"generate:accessi-wiki": "ts-node --transpile-only src/scripts/generateAccessiWiki.ts",
|
|
@@ -124,8 +138,8 @@
|
|
|
124
138
|
"typecheck": "tsc --noEmit",
|
|
125
139
|
"lint": "node scripts/lint.cjs",
|
|
126
140
|
"test": "npm run typecheck && npm run lint && npm run test:unit",
|
|
127
|
-
"test:unit": "node --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs",
|
|
128
|
-
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=50 --test-coverage-functions=60 --test-coverage-branches=60 --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs",
|
|
141
|
+
"test:unit": "node --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs test/openapi-semantic-diff.cjs",
|
|
142
|
+
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=50 --test-coverage-functions=60 --test-coverage-branches=60 --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs test/openapi-config.cjs test/resource-server.cjs test/accessi-security-standards.cjs test/accessi-service.cjs test/refresh-token.cjs test/token-revocation.cjs test/accessi-client.cjs test/accessi-client-scopes.cjs test/openapi-semantic-diff.cjs",
|
|
129
143
|
"test:accessi": "npm run test:unit",
|
|
130
144
|
"test:all": "npm test && npm run test:integration && npm run test:integration:redis",
|
|
131
145
|
"test:integration": "node test/integration/run-firebird.cjs 5",
|
|
@@ -134,6 +148,7 @@
|
|
|
134
148
|
"test:integration:fb3": "node test/integration/run-firebird.cjs 3",
|
|
135
149
|
"test:integration:fb25": "node test/integration/run-firebird.cjs 2.5",
|
|
136
150
|
"test:accessi-console": "npm run build && node test/console-two-factor.cjs",
|
|
151
|
+
"test:pack": "node scripts/pack-smoke-test.cjs",
|
|
137
152
|
"accessi:seed-admin": "node scripts/seed-accessi-admin.cjs",
|
|
138
153
|
"accessi:console": "node scripts/run-accessi-console.cjs",
|
|
139
154
|
"test:accessi-schema": "node --test test/accessi-schema.cjs",
|
|
Binary file
|