create-astram-app 0.1.0
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/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/package.json +27 -0
- package/template/README.md +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Astram
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# create-astram-app
|
|
2
|
+
|
|
3
|
+
**STUB (ADR-0023 §3)** — the Astram app scaffolder. `private`, not implemented in
|
|
4
|
+
this layer (Rule of Three, ADR-0023 §7 — don't over-build the scaffolder before
|
|
5
|
+
it's needed).
|
|
6
|
+
|
|
7
|
+
## Intent
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx create-astram-app my-app
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
will emit a consumer app **skeleton** (a scaffolded app skeleton that depends on
|
|
14
|
+
the published framework package) — generated from this package's
|
|
15
|
+
`template/` — whose `package.json` depends on the published `@astram/core` +
|
|
16
|
+
`@astram/guard`. The consumer builds features in the scaffolded `src/`, declaring
|
|
17
|
+
Astram through the ONE seam `ShieldModule.forRoot(...)`. Framework upgrades flow
|
|
18
|
+
through the dependency (`npm update`), never by re-cloning the skeleton.
|
|
19
|
+
|
|
20
|
+
The CLI currently prints a stub notice and exits non-zero (nothing is scaffolded).
|
|
21
|
+
The canonical shape of the emitted skeleton is [`examples/example-backend/`](../examples/example-backend/).
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm --filter create-astram-app build # tsc → dist/index.js (the CLI stub)
|
|
27
|
+
pnpm --filter create-astram-app lint
|
|
28
|
+
```
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `create-astram-app` — the Shield scaffolder (ADR-0023 §3).
|
|
4
|
+
*
|
|
5
|
+
* ┌─────────────────────────────────────────────────────────────────────────┐
|
|
6
|
+
* │ STUB — NOT IMPLEMENTED IN THIS LAYER. │
|
|
7
|
+
* │ This is a deliberate placeholder (Rule of Three, ADR-0023 §7): the │
|
|
8
|
+
* │ scaffolder is not built before it is needed. A later layer replaces the │
|
|
9
|
+
* │ body below with the real copy-from-template + install flow. │
|
|
10
|
+
* └─────────────────────────────────────────────────────────────────────────┘
|
|
11
|
+
*
|
|
12
|
+
* INTENT (what the finished tool will do):
|
|
13
|
+
*
|
|
14
|
+
* npx create-astram-app my-app
|
|
15
|
+
*
|
|
16
|
+
* emits the consumer's editable app SKELETON (a scaffolded app skeleton that
|
|
17
|
+
* depends on the published framework package) — scaffolded from this package's
|
|
18
|
+
* `template/` reference — whose `package.json` depends
|
|
19
|
+
* on the published `@astram/core` + `@astram/guard`. The scaffolded `src/` is
|
|
20
|
+
* where the consumer builds features; its `AppModule` declares Shield through the
|
|
21
|
+
* ONE registration seam, `ShieldModule.forRoot(...)`. Framework upgrades flow
|
|
22
|
+
* through the dependency (`npm update`), never by re-cloning the skeleton.
|
|
23
|
+
*
|
|
24
|
+
* The canonical shape of the emitted skeleton is `packages/nestjs-app/` in this
|
|
25
|
+
* monorepo (the consumer-skeleton reference). See `template/README.md`.
|
|
26
|
+
*/
|
|
27
|
+
const STUB_MESSAGE = [
|
|
28
|
+
'create-astram-app is a STUB (ADR-0023 §3) — not implemented in this layer.',
|
|
29
|
+
'',
|
|
30
|
+
'When built, it will scaffold a consumer app skeleton (a scaffolded app',
|
|
31
|
+
'skeleton that depends on the published framework package) depending on',
|
|
32
|
+
'@astram/core + @astram/guard, whose AppModule declares',
|
|
33
|
+
'Shield via ShieldModule.forRoot(...).',
|
|
34
|
+
'',
|
|
35
|
+
'Reference skeleton: packages/nestjs-app/ · template: this package’s template/.',
|
|
36
|
+
].join('\n');
|
|
37
|
+
/** Entry point. Prints the stub notice and exits non-zero (nothing scaffolded). */
|
|
38
|
+
export function main() {
|
|
39
|
+
console.error(STUB_MESSAGE);
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
// Only run when invoked as a CLI (not when imported by a test).
|
|
43
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
44
|
+
process.exitCode = main();
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,YAAY,GAAG;IACnB,4EAA4E;IAC5E,EAAE;IACF,wEAAwE;IACxE,wEAAwE;IACxE,wDAAwD;IACxD,uCAAuC;IACvC,EAAE;IACF,gFAAgF;CACjF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,mFAAmF;AACnF,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC5B,OAAO,CAAC,CAAC;AACX,CAAC;AAED,gEAAgE;AAChE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;IACpC,OAAO,CAAC,QAAQ,GAAG,IAAI,EAAE,CAAC;AAC5B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-astram-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Scaffolder for a new Astram app — emits a consumer project skeleton (Auth boilerplate + empty src/features/) that installs the sealed @astram/core + @astram/guard framework.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-astram-app": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"template"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.json",
|
|
19
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
20
|
+
"test": "vitest run --passWithNoTests"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22.0.0",
|
|
24
|
+
"typescript": "^5.7.0",
|
|
25
|
+
"vitest": "^2.1.8"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# create-astram-app template (reference)
|
|
2
|
+
|
|
3
|
+
This directory will hold the **app-skeleton template** the scaffolder copies to
|
|
4
|
+
emit a new consumer app (ADR-0023 §3). It is a placeholder in this layer.
|
|
5
|
+
|
|
6
|
+
Until the scaffolder is built, the **canonical reference for the emitted skeleton
|
|
7
|
+
is [`examples/example-backend/`](../../examples/example-backend/)** in this monorepo — the
|
|
8
|
+
consumer app skeleton (a scaffolded app skeleton that depends on the published
|
|
9
|
+
framework package). A generated app follows it:
|
|
10
|
+
|
|
11
|
+
- `package.json` depends on `@astram/core` + `@astram/guard` (published), plus the
|
|
12
|
+
host NestJS runtime (`@nestjs/common`, `@nestjs/core`, `@nestjs/platform-express`,
|
|
13
|
+
`reflect-metadata`, `rxjs`).
|
|
14
|
+
- `src/app.module.ts` declares Astram via `ShieldModule.forRoot(...)` — the one
|
|
15
|
+
registration seam — and adds the consumer's feature controllers.
|
|
16
|
+
- `src/main.ts` bootstraps Nest and listens (thin).
|
|
17
|
+
- Feature code lives in the consumer's editable `src/`; the framework is never
|
|
18
|
+
edited (upgrades flow through `npm update`).
|