diff --git a/templates/node-angular/.editorconfig b/templates/node-angular/.editorconfig new file mode 100644 index 0000000..f166060 --- /dev/null +++ b/templates/node-angular/.editorconfig @@ -0,0 +1,17 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single +ij_typescript_use_double_quotes = false + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/templates/node-angular/.gitignore.template b/templates/node-angular/.gitignore.template index 32d9196..ee5f0f2 100644 --- a/templates/node-angular/.gitignore.template +++ b/templates/node-angular/.gitignore.template @@ -1,19 +1,15 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. +# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. # Compiled output /dist /tmp /out-tsc /bazel-out -/dist-ssr # Node /node_modules npm-debug.log yarn-error.log -yarn-debug.log* -pnpm-debug.log* -lerna-debug.log* # IDEs and editors .idea/ @@ -23,7 +19,6 @@ lerna-debug.log* *.launch .settings/ *.sublime-workspace -*.local # Visual Studio Code .vscode/* @@ -31,6 +26,7 @@ lerna-debug.log* !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json +.history/* # Miscellaneous /.angular/cache @@ -42,19 +38,12 @@ testem.log /typings /server/utils/db/wallet -# System files -.DS_Store -Thumbs.db - -# Logs -logs -*.log - # Environment variables /.env /.env.* !/.env.example !/.env.*.example -# Editor directories and files -.history/* +# System files +.DS_Store +Thumbs.db diff --git a/templates/node-angular/.vscode/extensions.json b/templates/node-angular/.vscode/extensions.json new file mode 100644 index 0000000..77b3745 --- /dev/null +++ b/templates/node-angular/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 + "recommendations": ["angular.ng-template"] +} diff --git a/templates/node-angular/.vscode/launch.json b/templates/node-angular/.vscode/launch.json new file mode 100644 index 0000000..925af83 --- /dev/null +++ b/templates/node-angular/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "ng serve", + "type": "chrome", + "request": "launch", + "preLaunchTask": "npm: start", + "url": "http://localhost:4200/" + }, + { + "name": "ng test", + "type": "chrome", + "request": "launch", + "preLaunchTask": "npm: test", + "url": "http://localhost:9876/debug.html" + } + ] +} diff --git a/templates/node-angular/.vscode/tasks.json b/templates/node-angular/.vscode/tasks.json new file mode 100644 index 0000000..a298b5b --- /dev/null +++ b/templates/node-angular/.vscode/tasks.json @@ -0,0 +1,42 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "start", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + }, + { + "type": "npm", + "script": "test", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + } + ] +} diff --git a/templates/node-angular/README.md b/templates/node-angular/README.md index 078bb60..4cb33c8 100644 --- a/templates/node-angular/README.md +++ b/templates/node-angular/README.md @@ -2,28 +2,60 @@ # NodeAngular -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.0. +This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.1.3. ## Development server -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. +To start a local development server, run: + +```bash +ng serve +``` + +Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. ## Code scaffolding -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. +Angular CLI includes powerful code scaffolding tools. To generate a new component, run: + +```bash +ng generate component component-name +``` + +For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: + +```bash +ng generate --help +``` -## Build +## Building -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. +To build the project run: + +```bash +ng build +``` + +This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. ## Running unit tests -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). +To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command: + +```bash +ng test +``` ## Running end-to-end tests -Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. +For end-to-end (e2e) testing, run: + +```bash +ng e2e +``` + +Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. -## Further help +## Additional Resources -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. +For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. diff --git a/templates/node-angular/angular.json b/templates/node-angular/angular.json index d4bf2a0..fc6d088 100644 --- a/templates/node-angular/angular.json +++ b/templates/node-angular/angular.json @@ -21,8 +21,10 @@ ], "tsConfig": "tsconfig.app.json", "assets": [ - "src/favicon.ico", - "src/assets" + { + "glob": "**/*", + "input": "public" + } ], "styles": [ "src/styles.css" @@ -34,13 +36,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "500kB", + "maximumError": "1MB" }, { "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" + "maximumWarning": "4kB", + "maximumError": "8kB" } ], "outputHashing": "all" @@ -66,10 +68,7 @@ "defaultConfiguration": "development" }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "node-angular:build" - } + "builder": "@angular-devkit/build-angular:extract-i18n" }, "test": { "builder": "@angular-devkit/build-angular:karma", @@ -80,8 +79,10 @@ ], "tsConfig": "tsconfig.spec.json", "assets": [ - "src/favicon.ico", - "src/assets" + { + "glob": "**/*", + "input": "public" + } ], "styles": [ "src/styles.css" diff --git a/templates/node-angular/eslint.config.mjs b/templates/node-angular/eslint.config.mjs index 372edbe..c569dfd 100644 --- a/templates/node-angular/eslint.config.mjs +++ b/templates/node-angular/eslint.config.mjs @@ -1,21 +1,51 @@ -import eslint from '@eslint/js'; -import tseslint from 'typescript-eslint'; +import globals from "globals"; +import js from "@eslint/js"; +import nodePlugin from "eslint-plugin-n"; +import tseslintPlugin from "@typescript-eslint/eslint-plugin"; +import tseslintParser from "@typescript-eslint/parser"; -export default tseslint.config( - eslint.configs.recommended, - ...tseslint.configs.recommended, - { - files: [ - '**/*.js', - '**/*.jsx', - '**/*.ts', - ], - linterOptions: { - reportUnusedDisableDirectives: 'warn' +export default [ + { + files: ["src/**/*.js","src/**/*.ts"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + parser: tseslintParser, + parserOptions: { + ecmaFeatures: { + modules: true }, - ignores: [ - 'dist/**/*', - 'node_modules/**/*', - ] + ecmaVersion: "2022", + project: "./tsconfig.json", + }, + globals: { + ...globals.browser, + } + }, + plugins: { + "@typescript-eslint": tseslintPlugin + }, + rules: { + ...js.configs.recommended.rules, + ...tseslintPlugin.configs["eslint-recommended"].overrides[0].rules, + ...tseslintPlugin.configs["recommended"].rules, } -); + }, + { + files: ["server/**/*.js", "server/**/*.cjs"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { + ...globals.node, + } + }, + plugins: { + n: nodePlugin + }, + rules: { + ...js.configs.recommended.rules, + ...nodePlugin.configs["flat/recommended-script"].rules + } + } +]; diff --git a/templates/node-angular/package.json b/templates/node-angular/package.json index a5eea02..1f392e9 100644 --- a/templates/node-angular/package.json +++ b/templates/node-angular/package.json @@ -2,48 +2,52 @@ "name": "<%= appName %>", "version": "0.0.0", "scripts": { - "ng": "ng", "dev": "concurrently --names 'angular,server' --prefix-colors 'green,blue' --kill-others --success first 'ng serve' 'node server/index.cjs'", + "lint": "eslint --report-unused-disable-directives", + "ng": "ng", + "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", - "test": "ng test", - "lint": "eslint . --max-warnings 0" + "test": "ng test" }, "private": true, "dependencies": { - "@angular/animations": "^18.2.2", - "@angular/common": "^18.2.2", - "@angular/compiler": "^18.2.2", - "@angular/core": "^18.2.2", - "@angular/forms": "^18.2.2", - "@angular/platform-browser": "^18.2.2", - "@angular/platform-browser-dynamic": "^18.2.2", - "@angular/router": "^18.2.2", - "rxjs": "~7.8.1", - "tslib": "^2.7.0", - "zone.js": "~0.14.10", - "body-parser": "^1.20.2", + "@angular/animations": "^19.1.0", + "@angular/common": "^19.1.0", + "@angular/compiler": "^19.1.0", + "@angular/core": "^19.1.0", + "@angular/forms": "^19.1.0", + "@angular/platform-browser": "^19.1.0", + "@angular/platform-browser-dynamic": "^19.1.0", + "@angular/router": "^19.1.0", + "rxjs": "~7.8.0", + "tslib": "^2.3.0", + "zone.js": "~0.15.0", + "body-parser": "^1.20.3", "cors": "^2.8.5", - "dotenv": "^16.4.5", - "express": "^4.19.2", + "dotenv": "^16.4.7", + "express": "^4.21.2", "morgan": "^1.10.0", - "oracledb": "^6.6.0" + "oracledb": "^6.7.1" }, "devDependencies": { - "@angular-devkit/build-angular": "^18.2.2", - "@angular/cli": "^18.2.2", - "@angular/compiler-cli": "^18.2.2", - "@types/jasmine": "~5.1.4", - "jasmine-core": "~5.2.0", - "karma": "~6.4.4", + "@angular-devkit/build-angular": "^19.1.3", + "@angular/cli": "^19.1.3", + "@angular/compiler-cli": "^19.1.0", + "@types/jasmine": "~5.1.0", + "jasmine-core": "~5.5.0", + "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", - "karma-coverage": "~2.2.1", + "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", - "typescript": "~5.5.4", - "concurrently": "^8.2.2", - "eslint": "^9.9.1", - "@eslint/js": "^9.9.1", - "typescript-eslint": "8.3.0" + "typescript": "~5.7.2", + "concurrently": "^9.1.2", + "eslint": "^9.18.0", + "@eslint/js": "^9.18.0", + "eslint-plugin-n": "^17.15.1", + "@typescript-eslint/eslint-plugin": "^8.21.0", + "@typescript-eslint/parser": "^8.21.0", + "globals": "15.14.0" } } diff --git a/templates/node-angular/src/assets/.gitkeep b/templates/node-angular/public/assets/.gitkeep similarity index 100% rename from templates/node-angular/src/assets/.gitkeep rename to templates/node-angular/public/assets/.gitkeep diff --git a/templates/node-angular/src/assets/angular.svg b/templates/node-angular/public/assets/angular.svg similarity index 100% rename from templates/node-angular/src/assets/angular.svg rename to templates/node-angular/public/assets/angular.svg diff --git a/templates/node-angular/src/assets/oracle.svg b/templates/node-angular/public/assets/oracle.svg similarity index 100% rename from templates/node-angular/src/assets/oracle.svg rename to templates/node-angular/public/assets/oracle.svg diff --git a/templates/node-angular/src/favicon.ico b/templates/node-angular/public/favicon.ico similarity index 100% rename from templates/node-angular/src/favicon.ico rename to templates/node-angular/public/favicon.ico diff --git a/templates/node-angular/src/app/app.component.css b/templates/node-angular/src/app/app.component.css index 1426b69..2a67c85 100644 --- a/templates/node-angular/src/app/app.component.css +++ b/templates/node-angular/src/app/app.component.css @@ -54,22 +54,6 @@ h1 { filter: drop-shadow(0 0 2em #d51135aa); } -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - .card { padding: 2em; } @@ -77,4 +61,3 @@ h1 { .read-the-docs { color: #888; } - diff --git a/templates/node-angular/src/app/app.component.html b/templates/node-angular/src/app/app.component.html index dcf8cad..da421af 100644 --- a/templates/node-angular/src/app/app.component.html +++ b/templates/node-angular/src/app/app.component.html @@ -4,7 +4,7 @@ - +

{{ checkingConnection }}

@@ -16,4 +16,4 @@

{{ checkingConnection }}

Click on the Oracle and Angular logos to learn more

- \ No newline at end of file + diff --git a/templates/node-angular/src/app/app.config.ts b/templates/node-angular/src/app/app.config.ts index f4fba27..a1e7d6f 100644 --- a/templates/node-angular/src/app/app.config.ts +++ b/templates/node-angular/src/app/app.config.ts @@ -1,10 +1,8 @@ -import { ApplicationConfig } from '@angular/core'; +import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; export const appConfig: ApplicationConfig = { - providers: [provideRouter(routes)] + providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)] }; - - diff --git a/templates/node-angular/src/styles.css b/templates/node-angular/src/styles.css index fd886d3..7078aa7 100644 --- a/templates/node-angular/src/styles.css +++ b/templates/node-angular/src/styles.css @@ -10,4 +10,4 @@ text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -} \ No newline at end of file +} diff --git a/templates/node-angular/tsconfig.app.json b/templates/node-angular/tsconfig.app.json index 374cc9d..3775b37 100644 --- a/templates/node-angular/tsconfig.app.json +++ b/templates/node-angular/tsconfig.app.json @@ -1,4 +1,5 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ { "extends": "./tsconfig.json", "compilerOptions": { diff --git a/templates/node-angular/tsconfig.json b/templates/node-angular/tsconfig.json index f37b67f..5525117 100644 --- a/templates/node-angular/tsconfig.json +++ b/templates/node-angular/tsconfig.json @@ -1,28 +1,22 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ { "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", - "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "skipLibCheck": true, + "isolatedModules": true, "esModuleInterop": true, - "sourceMap": true, - "declaration": false, "experimentalDecorators": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "importHelpers": true, "target": "ES2022", - "module": "ES2022", - "useDefineForClassFields": false, - "lib": [ - "ES2022", - "dom" - ] + "module": "ES2022" }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, diff --git a/templates/node-angular/tsconfig.spec.json b/templates/node-angular/tsconfig.spec.json index be7e9da..5fb748d 100644 --- a/templates/node-angular/tsconfig.spec.json +++ b/templates/node-angular/tsconfig.spec.json @@ -1,4 +1,5 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ +/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ +/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ { "extends": "./tsconfig.json", "compilerOptions": {