diff --git a/templates/node-angular/.vscode/extensions.json b/templates/node-angular/.vscode/extensions.json deleted file mode 100644 index 77b3745..0000000 --- a/templates/node-angular/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - // 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 deleted file mode 100644 index 925af83..0000000 --- a/templates/node-angular/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // 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 deleted file mode 100644 index a298b5b..0000000 --- a/templates/node-angular/.vscode/tasks.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - // 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/angular.json b/templates/node-angular/angular.json index fc6d088..21047dd 100644 --- a/templates/node-angular/angular.json +++ b/templates/node-angular/angular.json @@ -11,10 +11,8 @@ "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:application", + "builder": "@angular/build:application", "options": { - "outputPath": "dist/node-angular", - "index": "src/index.html", "browser": "src/main.ts", "polyfills": [ "zone.js" @@ -28,8 +26,7 @@ ], "styles": [ "src/styles.css" - ], - "scripts": [] + ] }, "configurations": { "production": { @@ -56,7 +53,7 @@ "defaultConfiguration": "production" }, "serve": { - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@angular/build:dev-server", "configurations": { "production": { "buildTarget": "node-angular:build:production" @@ -68,10 +65,10 @@ "defaultConfiguration": "development" }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n" + "builder": "@angular/build:extract-i18n" }, "test": { - "builder": "@angular-devkit/build-angular:karma", + "builder": "@angular/build:karma", "options": { "polyfills": [ "zone.js", @@ -86,8 +83,7 @@ ], "styles": [ "src/styles.css" - ], - "scripts": [] + ] } } } diff --git a/templates/node-angular/eslint.config.mjs b/templates/node-angular/eslint.config.mjs index c569dfd..e07d716 100644 --- a/templates/node-angular/eslint.config.mjs +++ b/templates/node-angular/eslint.config.mjs @@ -1,43 +1,62 @@ -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"; +/* +** +** Copyright (c) 2024, Oracle and/or its affiliates. +** All rights reserved +** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ +*/ +import js from '@eslint/js' +import globals from 'globals' +import nodePlugin from 'eslint-plugin-n' +import reactPlugin from 'eslint-plugin-react' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import { defineConfig, globalIgnores } from 'eslint/config' -export default [ +export default defineConfig([ + // Ignore dist folder globally + globalIgnores(['dist']), + + // Frontend (React) { - files: ["src/**/*.js","src/**/*.ts"], + files: ['src/**/*.js', 'src/**/*.jsx'], languageOptions: { ecmaVersion: 2022, - sourceType: "module", - parser: tseslintParser, + sourceType: 'module', parserOptions: { ecmaFeatures: { - modules: true - }, - ecmaVersion: "2022", - project: "./tsconfig.json", + jsx: true + } }, globals: { - ...globals.browser, + ...globals.browser } }, plugins: { - "@typescript-eslint": tseslintPlugin + react: reactPlugin, + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh + }, + settings: { + react: { version: 'detect' } }, rules: { ...js.configs.recommended.rules, - ...tseslintPlugin.configs["eslint-recommended"].overrides[0].rules, - ...tseslintPlugin.configs["recommended"].rules, + ...reactPlugin.configs.flat.recommended.rules, + ...reactPlugin.configs.flat['jsx-runtime'].rules, + ...reactHooks.configs['recommended-latest'].rules, + ...reactRefresh.configs.vite.rules, + 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }] } }, + + // Backend (Node.js) { - files: ["server/**/*.js", "server/**/*.cjs"], + files: ['server/**/*.js', 'server/**/*.cjs'], languageOptions: { ecmaVersion: 2022, - sourceType: "module", + sourceType: 'module', globals: { - ...globals.node, + ...globals.node } }, plugins: { @@ -45,7 +64,7 @@ export default [ }, rules: { ...js.configs.recommended.rules, - ...nodePlugin.configs["flat/recommended-script"].rules + ...nodePlugin.configs['flat/recommended-script'].rules } } -]; +]) diff --git a/templates/node-angular/package.json b/templates/node-angular/package.json index 981d3cd..6fc32fb 100644 --- a/templates/node-angular/package.json +++ b/templates/node-angular/package.json @@ -10,43 +10,50 @@ "watch": "ng build --watch --configuration development", "test": "ng test" }, + "prettier": { + "overrides": [ + { + "files": "*.html", + "options": { + "parser": "angular" + } + } + ] + }, "private": true, "dependencies": { - "@angular/common": "^19.2.0", - "@angular/compiler": "^19.2.0", - "@angular/core": "^19.2.0", - "@angular/forms": "^19.2.0", - "@angular/platform-browser": "^19.2.0", - "@angular/platform-browser-dynamic": "^19.2.0", - "@angular/router": "^19.2.0", + "@angular/common": "^20.0.0", + "@angular/compiler": "^20.0.0", + "@angular/core": "^20.0.0", + "@angular/forms": "^20.0.0", + "@angular/platform-browser": "^20.0.0", + "@angular/router": "^20.0.0", + "rxjs": "~7.8.0", + "tslib": "^2.3.0", + "zone.js": "~0.15.0", "body-parser": "^2.2.0", "cors": "^2.8.5", - "dotenv": "^16.5.0", + "dotenv": "^17.1.0", "express": "^5.1.0", "morgan": "^1.10.0", - "oracledb": "^6.8.0", - "rxjs": "~7.8.0", - "tslib": "^2.3.0", - "zone.js": "~0.15.0" + "oracledb": "^6.7.1" }, "devDependencies": { - "@angular-devkit/build-angular": "^19.2.8", - "@angular/cli": "^19.2.8", - "@angular/compiler-cli": "^19.2.0", - "@eslint/js": "^9.25.1", + "@angular/build": "^20.0.6", + "@angular/cli": "^20.0.6", + "@angular/compiler-cli": "^20.0.0", "@types/jasmine": "~5.1.0", - "@typescript-eslint/eslint-plugin": "^8.31.0", - "@typescript-eslint/parser": "^8.31.0", - "concurrently": "^9.1.2", - "eslint": "^9.25.1", - "eslint-plugin-n": "^17.17.0", - "globals": "^16.0.0", - "jasmine-core": "~5.6.0", + "jasmine-core": "~5.7.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", "karma-coverage": "~2.2.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.1.0", - "typescript": "~5.7.2" + "typescript": "~5.8.2", + "@eslint/js": "^9.18.0", + "concurrently": "^9.1.2", + "eslint": "^9.18.0", + "eslint-plugin-n": "^17.15.1", + "globals": "^16.3.0" } } diff --git a/templates/node-angular/src/app/app.config.ts b/templates/node-angular/src/app/app.config.ts index a1e7d6f..d953f4c 100644 --- a/templates/node-angular/src/app/app.config.ts +++ b/templates/node-angular/src/app/app.config.ts @@ -1,8 +1,12 @@ -import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; +import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; export const appConfig: ApplicationConfig = { - providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)] + providers: [ + provideBrowserGlobalErrorListeners(), + provideZoneChangeDetection({ eventCoalescing: true }), + provideRouter(routes) + ] }; diff --git a/templates/node-angular/src/app/app.component.css b/templates/node-angular/src/app/app.css similarity index 100% rename from templates/node-angular/src/app/app.component.css rename to templates/node-angular/src/app/app.css diff --git a/templates/node-angular/src/app/app.component.html b/templates/node-angular/src/app/app.html similarity index 85% rename from templates/node-angular/src/app/app.component.html rename to templates/node-angular/src/app/app.html index da421af..fde2947 100644 --- a/templates/node-angular/src/app/app.component.html +++ b/templates/node-angular/src/app/app.html @@ -1,7 +1,7 @@