Skip to content

Commit

Permalink
chore: 🤖 bring back transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharkazaz committed Jan 5, 2025
1 parent 58bf87d commit 59f431d
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/actions/step-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ runs:
cache: npm

- name: Install dependencies
run: npm i
run: npm ci
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ['ci:build', 'ci:test', 'ci:lint', 'ci:e2e', 'build docs']
target: ['ci:build', 'ci:test', 'ci:lint', 'ci:e2e']
runs-on: ubuntu-latest
name: ${{ matrix.target }}
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-demo-app.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Deploy playground to Pages

on:
# Runs on pushes targeting the default branch
Expand Down Expand Up @@ -34,19 +34,19 @@ jobs:

- name: Setup
uses: ./.github/actions/step-setup

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build playground
run: npm run build:playground

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'dist/apps/transloco-playground'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
9 changes: 9 additions & 0 deletions apps/transloco-playground/index-html-transform.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Target } from '@angular-devkit/architect';
import * as cheerio from 'cheerio';

export default (targetOptions: Target, indexHtml: string) => {
const $ = cheerio.load(indexHtml);
$('base').attr('href', process.env.ORIGIN + '/transloco/');

return $.html();
};
4 changes: 4 additions & 0 deletions apps/transloco-playground/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
],
"outputHashing": "all"
},
"docs": {
"indexHtmlTransformer": "apps/transloco-playground/index-html-transform.ts",
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
Expand Down
1 change: 0 additions & 1 deletion apps/transloco-playground/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { environment } from '../environments/environment';
})
export class AppComponent {
private destroyRef = inject(DestroyRef);
isDocs = environment.isDocs;
service = inject(TranslocoService);
availableLangs = this.service.getAvailableLangs() as LangDefinition[];

Expand Down
1 change: 0 additions & 1 deletion apps/transloco-playground/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { environment } from '../../environments/environment';
imports: [TranslocoModule],
})
export class HomeComponent {
isDocs = environment.isDocs;
dynamic = '🦄';
key = 'home';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const environment = {
production: true,
baseUrl: '',
isDocs: false,
};
1 change: 0 additions & 1 deletion apps/transloco-playground/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
export const environment = {
production: false,
baseUrl: '',
isDocs: false,
};

/*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"commit": "git-cz",
"start": "nx run transloco-playground:serve",
"build": "node scripts/build.mjs",
"build:playground": "nx build transloco-playground",
"build:playground": "nx build transloco-playground --configuration=docs",
"ci:test": "nx run-many --target=test --all",
"ci:build": "nx run-many --target=build --all",
"ci:lint": "nx run-many --target=lint --all",
Expand Down

0 comments on commit 59f431d

Please sign in to comment.