-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 82631a3
Showing
30 changed files
with
33,246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
ij_typescript_spaces_within_imports = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 🚀 Deploy | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- run: npm run lint | ||
- run: npm run prettier -- --check | ||
- run: npx nx build-gh-pages demo | ||
- uses: taiga-family/ci/actions/deploy/[email protected] | ||
with: | ||
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} | ||
folder: dist/demo/browser | ||
|
||
concurrency: | ||
group: deploy-${{ github.head_ref }} | ||
cancel-in-progress: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
# misc | ||
/.angular | ||
/.sass-cache | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
.nx | ||
.angular |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
legacy-peer-deps=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"name": "demo", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "apps/demo/src", | ||
"targets": { | ||
"build": { | ||
"executor": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"outputPath": "dist/demo", | ||
"index": "apps/demo/src/index.html", | ||
"main": "apps/demo/src/main.ts", | ||
"polyfills": "apps/demo/src/polyfills.ts", | ||
"tsConfig": "apps/demo/tsconfig.app.json", | ||
"baseHref": "/", | ||
"assets": [ | ||
"apps/demo/src/favicon.ico", | ||
"apps/demo/src/assets", | ||
{ | ||
"glob": "**/*", | ||
"input": "node_modules/@taiga-ui/icons/src", | ||
"output": "assets/taiga-ui/icons" | ||
} | ||
], | ||
"styles": ["apps/demo/src/styles.less", "node_modules/@taiga-ui/core/styles/taiga-ui-theme.less"], | ||
"scripts": [], | ||
"extractLicenses": false, | ||
"buildOptimizer": false, | ||
"sourceMap": true, | ||
"optimization": false | ||
}, | ||
"configurations": { | ||
"production": { | ||
"fileReplacements": [ | ||
{ | ||
"replace": "apps/demo/src/environments/environment.ts", | ||
"with": "apps/demo/src/environments/environment.prod.ts" | ||
} | ||
], | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": false, | ||
"buildOptimizer": true | ||
} | ||
}, | ||
"defaultConfiguration": "" | ||
}, | ||
"serve": { | ||
"executor": "@angular-devkit/build-angular:dev-server", | ||
"options": { | ||
"browserTarget": "demo:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "demo:build:production" | ||
} | ||
} | ||
}, | ||
"build-gh-pages": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"parallel": false, | ||
"commands": [ | ||
"echo 'Github pages require special 404.html'", | ||
"echo 'Read more: https://angular.io/guide/deployment#deploy-to-github-pages'", | ||
"echo ------", | ||
"nx run demo:build:production", | ||
"cp dist/demo/index.html dist/demo/404.html", | ||
"nx run demo:prerender:production" | ||
] | ||
} | ||
}, | ||
"prerender": { | ||
"executor": "@nguniversal/builders:prerender", | ||
"options": { | ||
"browserTarget": "demo:build", | ||
"serverTarget": "demo:server:production", | ||
"routesFile": "./apps/demo/routesFile.txt", | ||
"guessRoutes": false | ||
} | ||
}, | ||
"server": { | ||
"executor": "@angular-devkit/build-angular:server", | ||
"options": { | ||
"outputPath": "dist/demo/server", | ||
"main": "apps/demo/server.ts", | ||
"tsConfig": "apps/demo/tsconfig.server.json" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"outputHashing": "media" | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import 'zone.js/node'; | ||
|
||
import {APP_BASE_HREF} from '@angular/common'; | ||
import {ngExpressEngine} from '@nguniversal/express-engine'; | ||
import express from 'express'; | ||
import {existsSync} from 'node:fs'; | ||
import {join} from 'node:path'; | ||
import bootstrap from './src/main.server'; | ||
|
||
// The Express app is exported so that it can be used by serverless Functions. | ||
export function app(): express.Express { | ||
const server = express(); | ||
const distFolder = join(process.cwd(), 'dist/demo'); | ||
const indexHtml = existsSync(join(distFolder, 'index.original.html')) | ||
? 'index.original.html' | ||
: 'index'; | ||
|
||
// Our Universal express-engine (found @ https://github.com/angular/universal/tree/main/modules/express-engine) | ||
server.engine( | ||
'html', | ||
ngExpressEngine({ | ||
bootstrap, | ||
}), | ||
); | ||
|
||
server.set('view engine', 'html'); | ||
Check failure on line 26 in apps/demo/server.ts GitHub Actions / deploy
|
||
server.set('views', distFolder); | ||
|
||
// Example Express Rest API endpoints | ||
// server.get('/api/**', (req, res) => { }); | ||
|
||
// Serve static files from /browser | ||
server.get( | ||
'*.*', | ||
express.static(distFolder, { | ||
maxAge: '1y', | ||
}), | ||
); | ||
|
||
// All regular routes use the Universal engine | ||
server.get('*', (req, res) => { | ||
res.render(indexHtml, { | ||
req, | ||
providers: [{provide: APP_BASE_HREF, useValue: req.baseUrl}], | ||
}); | ||
}); | ||
|
||
return server; | ||
} | ||
|
||
function run(): void { | ||
const port = process.env['PORT'] || 4000; | ||
|
||
// Start up the Node server | ||
const server = app(); | ||
server.listen(port, () => { | ||
console.log(`Node Express server listening on http://localhost:${port}`); | ||
}); | ||
} | ||
|
||
// Webpack will replace 'require' with '__webpack_require__' | ||
// '__non_webpack_require__' is a proxy to Node 'require' | ||
// The below code is to ensure that the server is run only when not requiring the bundle. | ||
declare const __non_webpack_require__: NodeRequire; | ||
const mainModule = __non_webpack_require__.main; | ||
const moduleFilename = (mainModule && mainModule.filename) || ''; | ||
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) { | ||
run(); | ||
} | ||
|
||
export * from './src/main.server'; | ||
|
||
// fixes prerendering | ||
export default bootstrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {CommonModule} from '@angular/common'; | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import {RouterOutlet} from '@angular/router'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'app', | ||
template: '<router-outlet></router-outlet>', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [CommonModule, RouterOutlet], | ||
}) | ||
export class AppComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import {mergeApplicationConfig, ApplicationConfig} from '@angular/core'; | ||
import {provideServerRendering} from '@angular/platform-server'; | ||
import {appConfig} from './app.config'; | ||
|
||
const serverConfig: ApplicationConfig = { | ||
providers: [provideServerRendering()], | ||
}; | ||
|
||
export const config = mergeApplicationConfig(appConfig, serverConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {ApplicationConfig, importProvidersFrom} from '@angular/core'; | ||
import {BrowserModule} from '@angular/platform-browser'; | ||
import { | ||
BrowserAnimationsModule, | ||
provideAnimations, | ||
} from '@angular/platform-browser/animations'; | ||
import {TuiRootModule} from '@taiga-ui/core'; | ||
import {routes} from './app.routes'; | ||
import {provideRouter} from '@angular/router'; | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [ | ||
provideAnimations(), | ||
provideRouter(routes), | ||
importProvidersFrom(BrowserModule, BrowserAnimationsModule, TuiRootModule), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {Routes} from '@angular/router'; | ||
|
||
export const routes: Routes = [ | ||
{ | ||
path: '', | ||
loadComponent: async () => (await import('./home/home.component')).HomeComponent, | ||
}, | ||
]; |
Oops, something went wrong.