Skip to content

Commit d02f0fc

Browse files
authored
claude init and npm scripts refactoring (#755)
1 parent adb6cf9 commit d02f0fc

File tree

169 files changed

+1279
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+1279
-700
lines changed

CLAUDE.md

Lines changed: 485 additions & 0 deletions
Large diffs are not rendered by default.

client/firebase-emulators-data/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ zenika
1414

1515
## How to update the data?
1616

17-
If you need to update emulator data, temporarily add the option `--export-on-exit` to the end of the NPM `firebase:emulators` script like this:
17+
If you need to update emulator data, temporarily add the option `--export-on-exit` to the end of the NPM `firebase:emulators:watch` script like this:
1818

1919
```json
2020
{
2121
"scripts": {
22-
"firebase:emulators": "firebase emulators:start --only auth:dev,firestore:dev --import ./firebase-emulators-data --export-on-exit"
22+
"firebase:emulators:watch": "firebase emulators:start --only auth:dev,firestore:dev --import ./firebase-emulators-data --export-on-exit"
2323
}
2424
}
2525
```
2626

2727
Then run the command:
2828

2929
```bash
30-
npm run firebase:emulators
30+
npm run firebase:emulators:watch
3131
```
3232

3333
The data will be exported when you terminate the command execution.

client/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"start:en": "ng serve -c development-en",
8-
"start:emulators": "ng serve -c development-emulators",
8+
"start:emulators:watch": "ng serve -c development-emulators",
99
"build": "ng build",
1010
"build:dev": "ng build -c development-remote && npm run post-build",
11-
"build:e2e": "ng build -c development,emulators --localize --base-href=\"/\" && npm run post-build",
11+
"build:emulators": "ng build -c development,emulators --localize --base-href=\"/\" && npm run post-build",
1212
"build:staging": "ng build -c staging && npm run post-build",
1313
"build:production": "ng build -c production && npm run post-build",
1414
"post-build": "cp src/404.html dist/client/browser/404.html",
@@ -22,13 +22,13 @@
2222
"format:check": "prettier --check .",
2323
"bundle-visualizer": "ng build --localize false --named-chunks && cd ./dist/client/browser && npx vite-bundle-visualizer && cd -",
2424
"server": "npm --prefix ../server start",
25-
"firebase:emulators": "firebase emulators:start --only auth:dev,firestore:dev --import ./firebase-emulators-data",
25+
"firebase:emulators:watch": "firebase emulators:start --only auth:dev,firestore:dev --import ./firebase-emulators-data",
26+
"server:emulators:watch": "npm --prefix ../server run start:emulators:watch",
27+
"stack:emulators:watch": "concurrently \"npm run firebase:emulators:watch\" \"npm run server:emulators:watch\" \"npm run start:emulators:watch\"",
28+
"firebase:emulators": "firebase emulators:start --only auth:dev,firestore:dev,hosting:dev --import ./firebase-emulators-data",
2629
"server:emulators": "npm --prefix ../server run start:emulators",
27-
"stack:emulators": "concurrently \"npm run firebase:emulators\" \"npm run server:emulators\" \"npm run start:emulators\"",
28-
"firebase:e2e": "firebase emulators:start --only auth:dev,firestore:dev,hosting:dev --import ./firebase-emulators-data",
29-
"server:e2e": "npm --prefix ../server run start:e2e",
30-
"prestack:e2e": "npm run build:e2e",
31-
"stack:e2e": "concurrently \"npm run firebase:e2e\" \"npm run server:e2e\"",
30+
"prestack:emulators": "npm run build:emulators",
31+
"stack:emulators": "concurrently \"npm run firebase:emulators\" \"npm run server:emulators\"",
3232
"e2e:install": "playwright install",
3333
"e2e:test": "playwright test",
3434
"e2e:report": "playwright show-report",

client/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default defineConfig({
7878

7979
/* Run your local dev server before starting the tests */
8080
webServer: {
81-
command: 'npm run stack:e2e',
81+
command: 'npm run stack:emulators',
8282
reuseExistingServer: !process.env['CI'],
8383
port: 4200,
8484
timeout: 60_000,

docs-source/docs/technical-guides/e2e-testing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ export default defineConfig({
3636

3737
// Run your local dev server before starting the tests
3838
webServer: {
39-
command: 'npm run stack:e2e',
39+
command: 'npm run stack:emulators',
4040
port: 4200,
4141
reuseExistingServer: !process.env['CI'],
4242
},
4343
});
4444
```
4545

46-
Before starting the tests, Playwright executes the command `npm run stack:e2e` and waits for the application to be available on port `4200`.
46+
Before starting the tests, Playwright executes the command `npm run stack:emulators` and waits for the application to be available on port `4200`.
4747
Due to the `reuseExistingServer` option (enabled for non-CI environment), the command will not be executed if the application is already available.
4848

49-
Therefore, you can run the command `npm run stack:e2e` in one terminal, wait for the application to be available on port `4200`, and then run the command `npm run e2e:test` in another terminal.
49+
Therefore, you can run the command `npm run stack:emulators` in one terminal, wait for the application to be available on port `4200`, and then run the command `npm run e2e:test` in another terminal.
5050
In this case, Playwright will skip the `webServer.command`, starting the tests immediately.
5151

5252
## Running Playwright
@@ -71,13 +71,13 @@ To avoid this problem, use the method 2 instead.
7171
To start the app once and then have Playwright only start the tests, run the following commands in two separate terminals:
7272

7373
```bash
74-
npm run stack:e2e # First terminal
74+
npm run stack:emulators # First terminal
7575
```
7676

77+
:::tip
78+
As an alternative, run `npm run stack:emulators:watch` instead, to start the app in "watch" mode.
79+
:::
80+
7781
```bash
7882
npm run e2e:test # Second terminal
7983
```
80-
81-
:::tip
82-
As an alternative to the above command in the first terminal, run `npm run stack:emulators` instead, to start the app in "watch" mode.
83-
:::

docs-source/docs/technical-guides/environments/local-dev.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ When using the Firebase emulator, the Google Auth provider is no longer availabl
1818
Only the Email/Password provider is enabled.
1919
:::
2020

21-
## `*:emulators` scripts
21+
## `*:emulators:watch` scripts
2222

2323
In this execution context, the _client_ and _server_ apps are running in "watch" mode.
2424

@@ -30,22 +30,22 @@ Here are the NPM scripts for this execution context:
3030
{
3131
"scripts": {
3232
// Start Firebase "Auth" and "Firestore" emulators
33-
"firebase:emulators": "firebase emulators:start --only auth:dev,firestore:dev --import ./firebase-emulators-data",
33+
"firebase:emulators:watch": "firebase emulators:start --only auth:dev,firestore:dev --import ./firebase-emulators-data",
3434

3535
// Start the server app in "watch" mode
36-
"server:emulators": "npm --prefix ../server run start:emulators",
36+
"server:emulators:watch": "npm --prefix ../server run start:emulators:watch",
3737

3838
// Start the client app in "watch" mode
39-
"start:emulators": "ng serve -c development-emulators",
39+
"start:emulators:watch": "ng serve -c development-emulators",
4040

4141
// ----------------------------------------
4242
// Run all the previous scripts in parallel
43-
"stack:emulators": "concurrently \"npm run firebase:emulators\" \"npm run server:emulators\" \"npm run start:emulators\""
43+
"stack:emulators:watch": "concurrently \"npm run firebase:emulators:watch\" \"npm run server:emulators:watch\" \"npm run start:emulators:watch\""
4444
}
4545
}
4646
```
4747

48-
## `*:e2e` scripts
48+
## `*:emulators` scripts
4949

5050
In this execution context, the _client_ and _server_ apps are built before running.
5151

@@ -60,17 +60,17 @@ Here are the NPM scripts for this execution context:
6060
{
6161
"scripts": {
6262
// Start Firebase "Auth", "Firestore" and "Hosting" emulators
63-
"firebase:e2e": "firebase emulators:start --only auth:dev,firestore:dev,hosting:dev --import ./firebase-emulators-data",
63+
"firebase:emulators": "firebase emulators:start --only auth:dev,firestore:dev,hosting:dev --import ./firebase-emulators-data",
6464

6565
// Build and start the server app (see "<rootDir>/server/package.json" scripts for details)
66-
"server:e2e": "npm --prefix ../server run start:e2e",
66+
"server:emulators": "npm --prefix ../server run start:emulators",
6767

6868
// Only build the client app (it will be served by Firebase "Hosting")
69-
"prestack:e2e": "npm run build:e2e",
69+
"prestack:emulators": "npm run build:emulators",
7070

7171
// ----------------------------------------
7272
// Run all the previous scripts in parallel
73-
"stack:e2e": "concurrently \"npm run firebase:e2e\" \"npm run server:e2e\""
73+
"stack:emulators": "concurrently \"npm run firebase:emulators\" \"npm run server:emulators\""
7474
}
7575
}
7676
```

0 commit comments

Comments
 (0)