Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(movies): migrate to use application builder SSR features #281

Merged
merged 16 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is opti

### Commit Message Details

See `commitlint.config.js` for details.
See `commitlint.config.cjs` for details.
6 changes: 3 additions & 3 deletions .github/unfinished/cf-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version-file: 'package.json'
cache: 'npm'

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/unfinished/user-flows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: install
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:
steps:
# needed for all cases
- if: github.event_name == 'push' && github.ref_name == 'main'
uses: actions/checkout@v3
uses: actions/checkout@v4
# needed for nx affected command
- if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# needed for nx affected command
- if: github.event_name == 'pull_request'
run: git fetch --no-tags --depth=1 origin $BASE_BRANCH

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version-file: 'package.json'
cache: npm

- name: Install dependencies
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/cloudflare-hosting-pr.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/docs-hosting-m.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version-file: 'package.json'
cache: 'npm'

- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/firebase-deploy-m.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ jobs:
steps:
# needed for all cases
- if: github.event_name == 'push' && github.ref_name == 'main'
uses: actions/checkout@v3
uses: actions/checkout@v4
# needed for nx affected command
- if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# needed for nx affected command
- if: github.event_name == 'pull_request'
run: git fetch --no-tags --depth=1 origin $BASE_BRANCH

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version-file: 'package.json'
cache: 'npm'

- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/firebase-function-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version-file: 'package.json'
cache: npm

- name: Install dependencies
Expand All @@ -23,7 +23,7 @@ jobs:
- name: User Flow
run: npm run nx run firebase-function:user-flow:production -- --format=md

#- name: Test firebase function emulation
#- name: Test firebase function emulation
# id: firebase-function-emulation
# uses: push-based/[email protected]
# with:
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/firebase-hosting-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version-file: 'package.json'
cache: npm

- name: Install dependencies
Expand All @@ -35,13 +35,12 @@ jobs:
# - name: User Flow
# run: npm run nx run movies:user-flow:production -- --format=md --url=${{ fromJson(steps.previewDeployStep.outputs.urls)[0] }}

#- name: Test firebase preview channel hosting
# id: firebase-preview-channel-hosting
# uses: push-based/[email protected]
# with:
# verbose: on
# commentId: firebase-preview-channel-hosting
# onlyComments: on
# outPath: ./dist/user-flow/movies
# rcPath: ./projects/movies/.user-flowrc.json

#- name: Test firebase preview channel hosting
# id: firebase-preview-channel-hosting
# uses: push-based/[email protected]
# with:
# verbose: on
# commentId: firebase-preview-channel-hosting
# onlyComments: on
# outPath: ./dist/user-flow/movies
# rcPath: ./projects/movies/.user-flowrc.json
31 changes: 0 additions & 31 deletions .github/workflows/ng-universal-pr.yml

This file was deleted.

8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,7 @@ Clone and install the dependencies for `angular-movies` locally:

## Running locally

- `npm run build:dev`: dev build
- `npm run build:prod`: production build
- `npm run build:prod:ssr`: production build for SSR
- `npm run start`: serve the project locally for development
- `npm run start:ssr:dev`: serve the project locally SSR for development
- `npm run start:ssr:prod`: serve the project locally SSR for production
- `npm run analyze:bundlesize`: bundle size analysis
- `nx run movies:serve`: dev server

## Tech Stack

Expand Down
File renamed without changes.
31 changes: 0 additions & 31 deletions firebase.function.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote it to the commit message, in short you can only specify one config json for deployment and if you split the hosting and functions into multiple configs, the hosting will never be associated with the functions rewrites thus SSR will not work correctly

This file was deleted.

29 changes: 27 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,34 @@
"emulators": {
"hosting": {
"port": 4202
},
"functions": {
"port": 4402
}
},
"functions": {
"source": ".",
"ignore": [
" **/.*",
"**/node_modules/**",
"**/tmp/**",
"**/tooling/**",
"**/LICENSE",
"**/CONTRIBUTING.md",
"**/README.md",
"**/commitlint.config.cjs",
"**/database.rules.json",
"**/firebase-debug.log",
"**/firebase.json",
"**/jest.config.ts",
"**/jest.preset.js",
"**/migrations.json",
"**/nx.json",
"**/tsconfig.json",
"**/ui-debug.log",
"**/wrangler.toml"
]
},
"hosting": {
"public": "./dist/projects/movies/browser",
"cleanUrls": true,
Expand Down Expand Up @@ -35,10 +61,9 @@
"**/LICENSE",
"**/CONTRIBUTING.md",
"**/README.md",
"**/commitlint.config.js",
"**/commitlint.config.cjs",
"**/database.rules.json",
"**/firebase-debug.log",
"**/firebase.function.json",
"**/firebase.json",
"**/jest.config.ts",
"**/jest.preset.js",
Expand Down
Loading
Loading