@friggframework/devtools 2.0.0--canary.639.86e8467.0 → 2.0.0--canary.540.4653c0a.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/frigg-cli/README.md +12 -48
- package/frigg-cli/index.js +4 -9
- package/frigg-cli/init-command/backend-first-handler.js +546 -378
- package/frigg-cli/init-command/index.js +33 -70
- package/frigg-cli/package.json +1 -1
- package/frigg-cli/test/init-command.test.js +1 -1
- package/infrastructure/docs/POSTGRES-CONFIGURATION.md +1 -21
- package/infrastructure/domains/database/aurora-builder.js +2 -13
- package/infrastructure/domains/database/aurora-builder.test.js +0 -22
- package/package.json +8 -10
- package/frigg-cli/__tests__/unit/commands/init.test.js +0 -506
- package/frigg-cli/init-command/deployment-modes.js +0 -7
- package/frigg-cli/init-command/scaffold-dependencies.js +0 -167
- package/frigg-cli/templates/backend/README.md +0 -177
- package/frigg-cli/templates/backend/env.example +0 -21
- package/frigg-cli/templates/backend/gitignore +0 -10
- package/frigg-cli/templates/backend/index.js +0 -95
- package/frigg-cli/templates/backend/infrastructure.js +0 -20
- package/infrastructure/__tests__/scaffold-default-infrastructure.test.js +0 -140
package/frigg-cli/README.md
CHANGED
|
@@ -10,65 +10,29 @@ The Frigg CLI provides tools for building, deploying, and managing serverless in
|
|
|
10
10
|
|
|
11
11
|
### Core Commands
|
|
12
12
|
|
|
13
|
-
#### `frigg init [
|
|
13
|
+
#### `frigg init [options]`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**Status:** To be documented (command may not be merged yet)
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Initialize a new Frigg application with scaffolding and configuration.
|
|
18
18
|
|
|
19
|
+
**Usage:**
|
|
19
20
|
```bash
|
|
20
|
-
frigg init
|
|
21
|
-
frigg init my-app
|
|
22
|
-
frigg init
|
|
23
|
-
frigg init my-app --mode embedded # add to an existing project (./frigg-integration)
|
|
24
|
-
npx @friggframework/devtools init my-app --yes # without a global install
|
|
21
|
+
frigg init
|
|
22
|
+
frigg init my-app
|
|
23
|
+
frigg init --template typescript
|
|
25
24
|
```
|
|
26
25
|
|
|
27
26
|
**What it does:**
|
|
28
|
-
|
|
29
|
-
1. Validates the project name and `--mode`, and checks that the target directory is
|
|
30
|
-
empty (only `.git`, `.gitignore`, `README.md` and `.DS_Store` may exist) before asking anything else
|
|
31
|
-
2. Copies the backend template: `index.js` (app definition, named after the project),
|
|
32
|
-
`infrastructure.js`, `README.md`, `.gitignore`, `.env.example` (also seeded into `.env`)
|
|
33
|
-
3. Writes `package.json` with:
|
|
34
|
-
- scripts: `start` (`frigg start`), `build` (`frigg build`), `deploy` (`frigg deploy`),
|
|
35
|
-
`db:setup` (`frigg db:setup`), `test` (`jest`)
|
|
36
|
-
- dependencies: `@friggframework/core`, `@prisma/client`, `prisma`
|
|
37
|
-
- devDependencies: `@friggframework/devtools`, `@friggframework/serverless-plugin`,
|
|
38
|
-
`osls`, and the serverless plugins the composed definition loads
|
|
39
|
-
- Frigg package versions match the devtools that ran `init` (a prerelease is pinned exactly)
|
|
40
|
-
4. Validates the generated app definition against the app-definition schema
|
|
41
|
-
5. Optionally initializes git and runs `npm install`
|
|
42
|
-
6. Prints next steps. API modules picked in the interactive prompt are not wired in
|
|
43
|
-
automatically; the next steps list a `frigg install <module>` command for each
|
|
44
|
-
|
|
45
|
-
In `embedded` mode the backend is written to `./frigg-integration` inside the target
|
|
46
|
-
directory, which may already contain your application. Git is not initialized.
|
|
27
|
+
- TBD - Full documentation pending implementation merge
|
|
47
28
|
|
|
48
29
|
**Options:**
|
|
30
|
+
- TBD
|
|
49
31
|
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
- `-y, --yes` - Accept the default for every prompt. Implied when stdin is not a TTY
|
|
53
|
-
- `--no-install` - Skip `npm install`
|
|
54
|
-
- `--no-git` - Skip `git init` and the initial commit
|
|
55
|
-
- `-f, --force` - Scaffold into a non-empty directory and overwrite an existing `README.md`/`.gitignore`
|
|
56
|
-
- `-v, --verbose` - Verbose output
|
|
57
|
-
|
|
58
|
-
**Next steps after `init`:**
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
cd my-app
|
|
62
|
-
docker run --name frigg-postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:16
|
|
63
|
-
npm run db:setup
|
|
64
|
-
npm start
|
|
65
|
-
```
|
|
32
|
+
**Example Output:**
|
|
33
|
+
- TBD
|
|
66
34
|
|
|
67
|
-
|
|
68
|
-
database cluster (`vpc: { enable: false }`, `database.postgres.management: 'external'`),
|
|
69
|
-
field-level encryption with a per-stage KMS key (about $1/month), and the app connecting
|
|
70
|
-
to a PostgreSQL you host through `DATABASE_URL`. The generated `README.md` explains the
|
|
71
|
-
security model and the opt-in upgrades.
|
|
35
|
+
> **Note**: This command may be part of an upcoming release. Documentation will be updated once the implementation is merged to the main branch.
|
|
72
36
|
|
|
73
37
|
---
|
|
74
38
|
|
package/frigg-cli/index.js
CHANGED
|
@@ -91,16 +91,11 @@ const { ssmPushCommand } = require('./ssm-command');
|
|
|
91
91
|
const program = new Command();
|
|
92
92
|
|
|
93
93
|
program
|
|
94
|
-
.command('init [
|
|
94
|
+
.command('init [templateName]')
|
|
95
95
|
.description('Initialize a new Frigg application')
|
|
96
|
-
.option('-
|
|
97
|
-
.option('-
|
|
98
|
-
.option('-
|
|
99
|
-
.option('--no-install', 'skip installing dependencies')
|
|
100
|
-
.option('--no-git', 'skip initializing a git repository')
|
|
101
|
-
.option('-f, --force', 'scaffold into a non-empty directory and overwrite README.md')
|
|
102
|
-
.option('-v, --verbose', 'enable verbose output')
|
|
103
|
-
.option('-t, --template <template>', 'legacy template (no longer supported)')
|
|
96
|
+
.option('-t, --template <template>', 'template to use', 'backend-only')
|
|
97
|
+
.option('-n, --name <name>', 'project name')
|
|
98
|
+
.option('-d, --directory <directory>', 'target directory')
|
|
104
99
|
.action(initCommand);
|
|
105
100
|
|
|
106
101
|
program
|