From 96b682aa1273c2a6fe197cc082df1df6833341c1 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 4 Feb 2026 13:16:07 +0100 Subject: [PATCH] :recycle: Remove Nx and rely on pnpm monorepo features --- plugins/.npmrc | 1 + plugins/.vscode/extensions.json | 6 +- plugins/angular.json | 493 ++ .../colors-to-tokens-plugin/eslint.config.js | 75 +- .../apps/colors-to-tokens-plugin/package.json | 13 + .../apps/colors-to-tokens-plugin/project.json | 81 - .../colors-to-tokens-plugin/src/plugin.ts | 2 +- .../colors-to-tokens-plugin/vite.config.ts | 6 +- plugins/apps/contrast-plugin/eslint.config.js | 75 +- plugins/apps/contrast-plugin/package.json | 13 + plugins/apps/contrast-plugin/project.json | 81 - plugins/apps/contrast-plugin/vite.config.ts | 6 +- plugins/apps/create-palette-plugin/.babelrc | 3 - plugins/apps/create-palette-plugin/.swcrc | 8 - .../apps/create-palette-plugin/package.json | 14 + .../apps/create-palette-plugin/project.json | 8 - .../apps/create-palette-plugin/vite.config.ts | 20 +- plugins/apps/e2e/eslint.config.js | 2 +- plugins/apps/e2e/package.json | 10 + plugins/apps/e2e/project.json | 8 - plugins/apps/e2e/src/utils/agent.ts | 1 + plugins/apps/e2e/vite.config.ts | 6 +- plugins/apps/example-styles/.babelrc | 3 - plugins/apps/example-styles/.swcrc | 8 - plugins/apps/example-styles/package.json | 13 + plugins/apps/example-styles/project.json | 8 - .../example-styles/src/app/app.element.ts | 3 +- plugins/apps/example-styles/vite.config.ts | 17 +- plugins/apps/icons-plugin/eslint.config.js | 75 +- plugins/apps/icons-plugin/package.json | 13 + plugins/apps/icons-plugin/project.json | 81 - .../icons-plugin/src/app/app.component.ts | 8 +- .../apps/lorem-ipsum-plugin/eslint.config.js | 75 +- plugins/apps/lorem-ipsum-plugin/package.json | 13 + plugins/apps/lorem-ipsum-plugin/project.json | 81 - .../apps/lorem-ipsum-plugin/src/generator.ts | 10 +- .../apps/lorem-ipsum-plugin/vite.config.ts | 6 +- .../apps/poc-state-plugin/eslint.config.js | 74 +- plugins/apps/poc-state-plugin/package.json | 13 + plugins/apps/poc-state-plugin/project.json | 80 - plugins/apps/poc-state-plugin/src/plugin.ts | 6 +- .../apps/poc-tokens-plugin/eslint.config.js | 75 +- plugins/apps/poc-tokens-plugin/package.json | 13 + plugins/apps/poc-tokens-plugin/project.json | 79 - plugins/apps/poc-tokens-plugin/vite.config.ts | 17 + .../rename-layers-plugin/eslint.config.js | 75 +- .../apps/rename-layers-plugin/package.json | 13 + .../apps/rename-layers-plugin/project.json | 81 - .../apps/rename-layers-plugin/src/plugin.ts | 1 - plugins/apps/table-plugin/eslint.config.js | 75 +- plugins/apps/table-plugin/package.json | 13 + plugins/apps/table-plugin/project.json | 80 - .../table-plugin/src/app/app.component.ts | 2 +- .../src/app/nx-welcome.component.ts | 986 --- plugins/docs/create-angular-plugin.md | 72 +- plugins/docs/create-plugin.md | 62 +- plugins/docs/publish-package.md | 34 +- plugins/eslint.base.config.js | 49 - plugins/eslint.config.js | 142 +- plugins/libs/plugin-types/package.json | 6 +- plugins/libs/plugin-types/project.json | 13 +- plugins/libs/plugins-runtime/eslint.config.js | 13 +- plugins/libs/plugins-runtime/package.json | 9 +- plugins/libs/plugins-runtime/project.json | 13 +- plugins/libs/plugins-runtime/src/index.ts | 1 + .../libs/plugins-runtime/src/lib/api/index.ts | 1 + .../plugins-runtime/src/lib/create-modal.ts | 4 +- .../plugins-runtime/src/lib/create-sandbox.ts | 2 +- .../plugins-runtime/src/lib/load-plugin.ts | 5 +- plugins/libs/plugins-runtime/src/lib/ses.ts | 4 +- plugins/libs/plugins-runtime/vite.config.ts | 12 +- plugins/libs/plugins-styles/package.json | 6 +- plugins/libs/plugins-styles/project.json | 17 +- plugins/nx.json | 145 - plugins/package.json | 64 +- plugins/pnpm-lock.yaml | 6591 +---------------- plugins/project.json | 5 - plugins/tools/plugins/plugin-tasks.ts | 56 - plugins/tools/scripts/publish.ts | 196 +- 79 files changed, 1498 insertions(+), 9053 deletions(-) create mode 100644 plugins/.npmrc create mode 100644 plugins/angular.json create mode 100644 plugins/apps/colors-to-tokens-plugin/package.json delete mode 100644 plugins/apps/colors-to-tokens-plugin/project.json create mode 100644 plugins/apps/contrast-plugin/package.json delete mode 100644 plugins/apps/contrast-plugin/project.json delete mode 100644 plugins/apps/create-palette-plugin/.babelrc delete mode 100644 plugins/apps/create-palette-plugin/.swcrc create mode 100644 plugins/apps/create-palette-plugin/package.json delete mode 100644 plugins/apps/create-palette-plugin/project.json create mode 100644 plugins/apps/e2e/package.json delete mode 100644 plugins/apps/e2e/project.json delete mode 100644 plugins/apps/example-styles/.babelrc delete mode 100644 plugins/apps/example-styles/.swcrc create mode 100644 plugins/apps/example-styles/package.json delete mode 100644 plugins/apps/example-styles/project.json create mode 100644 plugins/apps/icons-plugin/package.json delete mode 100644 plugins/apps/icons-plugin/project.json create mode 100644 plugins/apps/lorem-ipsum-plugin/package.json delete mode 100644 plugins/apps/lorem-ipsum-plugin/project.json create mode 100644 plugins/apps/poc-state-plugin/package.json delete mode 100644 plugins/apps/poc-state-plugin/project.json create mode 100644 plugins/apps/poc-tokens-plugin/package.json delete mode 100644 plugins/apps/poc-tokens-plugin/project.json create mode 100644 plugins/apps/poc-tokens-plugin/vite.config.ts create mode 100644 plugins/apps/rename-layers-plugin/package.json delete mode 100644 plugins/apps/rename-layers-plugin/project.json create mode 100644 plugins/apps/table-plugin/package.json delete mode 100644 plugins/apps/table-plugin/project.json delete mode 100644 plugins/apps/table-plugin/src/app/nx-welcome.component.ts delete mode 100644 plugins/eslint.base.config.js delete mode 100644 plugins/nx.json delete mode 100644 plugins/project.json delete mode 100644 plugins/tools/plugins/plugin-tasks.ts diff --git a/plugins/.npmrc b/plugins/.npmrc new file mode 100644 index 0000000000..ae90f70514 --- /dev/null +++ b/plugins/.npmrc @@ -0,0 +1 @@ +ignore-workspace-root-check=true diff --git a/plugins/.vscode/extensions.json b/plugins/.vscode/extensions.json index b7ed4cd502..d7df89c9cd 100644 --- a/plugins/.vscode/extensions.json +++ b/plugins/.vscode/extensions.json @@ -1,7 +1,3 @@ { - "recommendations": [ - "nrwl.angular-console", - "prettier.prettier-vscode", - "dbaeumer.vscode-eslint" - ] + "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] } diff --git a/plugins/angular.json b/plugins/angular.json new file mode 100644 index 0000000000..32b3a9897e --- /dev/null +++ b/plugins/angular.json @@ -0,0 +1,493 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "apps", + "projects": { + "contrast-plugin": { + "projectType": "application", + "root": "apps/contrast-plugin", + "sourceRoot": "apps/contrast-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/contrast-plugin", + "index": "apps/contrast-plugin/src/index.html", + "browser": "apps/contrast-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/contrast-plugin/tsconfig.app.json", + "assets": [ + "apps/contrast-plugin/src/_headers", + "apps/contrast-plugin/src/favicon.ico", + "apps/contrast-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/contrast-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { "buildTarget": "contrast-plugin:build:production" }, + "development": { + "buildTarget": "contrast-plugin:build:development", + "host": "0.0.0.0", + "port": 4302 + } + }, + "defaultConfiguration": "development" + } + } + }, + "icons-plugin": { + "projectType": "application", + "root": "apps/icons-plugin", + "sourceRoot": "apps/icons-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/icons-plugin", + "index": "apps/icons-plugin/src/index.html", + "browser": "apps/icons-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/icons-plugin/tsconfig.app.json", + "assets": [ + "apps/icons-plugin/src/_headers", + "apps/icons-plugin/src/favicon.ico", + "apps/icons-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/icons-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { "buildTarget": "icons-plugin:build:production" }, + "development": { + "buildTarget": "icons-plugin:build:development", + "host": "0.0.0.0", + "port": 4303 + } + }, + "defaultConfiguration": "development" + } + } + }, + "lorem-ipsum-plugin": { + "projectType": "application", + "root": "apps/lorem-ipsum-plugin", + "sourceRoot": "apps/lorem-ipsum-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/lorem-ipsum-plugin", + "index": "apps/lorem-ipsum-plugin/src/index.html", + "browser": "apps/lorem-ipsum-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/lorem-ipsum-plugin/tsconfig.app.json", + "assets": [ + "apps/lorem-ipsum-plugin/src/_headers", + "apps/lorem-ipsum-plugin/src/favicon.ico", + "apps/lorem-ipsum-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/lorem-ipsum-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "lorem-ipsum-plugin:build:production" + }, + "development": { + "buildTarget": "lorem-ipsum-plugin:build:development", + "host": "0.0.0.0", + "port": 4304 + } + }, + "defaultConfiguration": "development" + } + } + }, + "table-plugin": { + "projectType": "application", + "root": "apps/table-plugin", + "sourceRoot": "apps/table-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/table-plugin", + "index": "apps/table-plugin/src/index.html", + "browser": "apps/table-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/table-plugin/tsconfig.app.json", + "assets": [ + "apps/table-plugin/src/_headers", + "apps/table-plugin/src/favicon.ico", + "apps/table-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/table-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { "buildTarget": "table-plugin:build:production" }, + "development": { + "buildTarget": "table-plugin:build:development", + "host": "0.0.0.0", + "port": 4306 + } + }, + "defaultConfiguration": "development" + } + } + }, + "rename-layers-plugin": { + "projectType": "application", + "root": "apps/rename-layers-plugin", + "sourceRoot": "apps/rename-layers-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/rename-layers-plugin", + "index": "apps/rename-layers-plugin/src/index.html", + "browser": "apps/rename-layers-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/rename-layers-plugin/tsconfig.app.json", + "assets": [ + "apps/rename-layers-plugin/src/_headers", + "apps/rename-layers-plugin/src/favicon.ico", + "apps/rename-layers-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/rename-layers-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "rename-layers-plugin:build:production" + }, + "development": { + "buildTarget": "rename-layers-plugin:build:development", + "host": "0.0.0.0", + "port": 4307 + } + }, + "defaultConfiguration": "development" + } + } + }, + "colors-to-tokens-plugin": { + "projectType": "application", + "root": "apps/colors-to-tokens-plugin", + "sourceRoot": "apps/colors-to-tokens-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/colors-to-tokens-plugin", + "index": "apps/colors-to-tokens-plugin/src/index.html", + "browser": "apps/colors-to-tokens-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/colors-to-tokens-plugin/tsconfig.app.json", + "assets": [ + "apps/colors-to-tokens-plugin/src/_headers", + "apps/colors-to-tokens-plugin/src/favicon.ico", + "apps/colors-to-tokens-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/colors-to-tokens-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "colors-to-tokens-plugin:build:production" + }, + "development": { + "buildTarget": "colors-to-tokens-plugin:build:development", + "host": "0.0.0.0", + "port": 4308 + } + }, + "defaultConfiguration": "development" + } + } + }, + "poc-state-plugin": { + "projectType": "application", + "root": "apps/poc-state-plugin", + "sourceRoot": "apps/poc-state-plugin/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:application", + "options": { + "outputPath": "dist/apps/poc-state-plugin", + "index": "apps/poc-state-plugin/src/index.html", + "browser": "apps/poc-state-plugin/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/poc-state-plugin/tsconfig.app.json", + "assets": [ + "apps/poc-state-plugin/src/favicon.ico", + "apps/poc-state-plugin/src/assets" + ], + "styles": [ + "libs/plugins-styles/src/lib/styles.css", + "apps/poc-state-plugin/src/styles.css" + ], + "scripts": [], + "optimization": { + "scripts": true, + "styles": true, + "fonts": false + } + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "poc-state-plugin:build:production" + }, + "development": { + "buildTarget": "poc-state-plugin:build:development", + "host": "0.0.0.0", + "port": 4309 + } + }, + "defaultConfiguration": "development" + } + } + } + }, + "cli": { + "analytics": false + } +} diff --git a/plugins/apps/colors-to-tokens-plugin/eslint.config.js b/plugins/apps/colors-to-tokens-plugin/eslint.config.js index 7aa90c2ab0..cdcefb4c9e 100644 --- a/plugins/apps/colors-to-tokens-plugin/eslint.config.js +++ b/plugins/apps/colors-to-tokens-plugin/eslint.config.js @@ -1,46 +1,33 @@ import baseConfig from '../../eslint.config.js'; -import { compat } from '../../eslint.base.config.js'; +import angular from '@angular-eslint/eslint-plugin'; +import angularTemplate from '@angular-eslint/eslint-plugin-template'; +import angularTemplateParser from '@angular-eslint/template-parser'; export default [ ...baseConfig, - ...compat - .config({ - extends: [ - 'plugin:@nx/angular', - 'plugin:@angular-eslint/template/process-inline-templates', - ], - }) - .map((config) => ({ - ...config, - files: ['**/*.ts'], - rules: { - '@angular-eslint/directive-selector': [ - 'error', - { - type: 'attribute', - prefix: 'app', - style: 'camelCase', - }, - ], - '@angular-eslint/component-selector': [ - 'error', - { - type: 'element', - prefix: 'app', - style: 'kebab-case', - }, - ], - }, - })), - ...compat - .config({ extends: ['plugin:@nx/angular-template'] }) - .map((config) => ({ - ...config, - files: ['**/*.html'], - rules: {}, - })), - { ignores: ['**/assets/*.js'] }, { + files: ['**/*.ts'], + plugins: { + '@angular-eslint': angular, + }, + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + }, languageOptions: { parserOptions: { project: './tsconfig.*?.json', @@ -48,4 +35,16 @@ export default [ }, }, }, + { + files: ['**/*.html'], + plugins: { + '@angular-eslint/template': angularTemplate, + }, + languageOptions: { + parser: angularTemplateParser, + }, + processor: '@angular-eslint/template/extract-inline-html', + rules: {}, + }, + { ignores: ['**/assets/*.js'] }, ]; diff --git a/plugins/apps/colors-to-tokens-plugin/package.json b/plugins/apps/colors-to-tokens-plugin/package.json new file mode 100644 index 0000000000..2e1d8273be --- /dev/null +++ b/plugins/apps/colors-to-tokens-plugin/package.json @@ -0,0 +1,13 @@ +{ + "name": "colors-to-tokens-plugin", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "build": "ng build colors-to-tokens-plugin", + "build:dev": "ng build colors-to-tokens-plugin --configuration development", + "serve": "ng serve colors-to-tokens-plugin", + "lint": "eslint .", + "test": "vitest" + } +} diff --git a/plugins/apps/colors-to-tokens-plugin/project.json b/plugins/apps/colors-to-tokens-plugin/project.json deleted file mode 100644 index a2be4c507c..0000000000 --- a/plugins/apps/colors-to-tokens-plugin/project.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "colors-to-tokens-plugin", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "prefix": "app", - "sourceRoot": "apps/colors-to-tokens-plugin/src", - "tags": ["type:plugin"], - "targets": { - "build": { - "executor": "@angular-devkit/build-angular:application", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/apps/colors-to-tokens-plugin", - "index": "apps/colors-to-tokens-plugin/src/index.html", - "browser": "apps/colors-to-tokens-plugin/src/main.ts", - "polyfills": ["zone.js"], - "tsConfig": "apps/colors-to-tokens-plugin/tsconfig.app.json", - "assets": [ - "apps/colors-to-tokens-plugin/src/_headers", - "apps/colors-to-tokens-plugin/src/favicon.ico", - "apps/colors-to-tokens-plugin/src/assets" - ], - "styles": [ - "libs/plugins-styles/src/lib/styles.css", - "apps/colors-to-tokens-plugin/src/styles.css" - ], - "scripts": [], - "optimization": { - "scripts": true, - "styles": true, - "fonts": false - } - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all" - }, - "development": { - "optimization": false, - "extractLicenses": false, - "sourceMap": true - } - }, - "defaultConfiguration": "production", - "dependsOn": ["buildPlugin"] - }, - "serve": { - "executor": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "buildTarget": "colors-to-tokens-plugin:build:production" - }, - "development": { - "buildTarget": "colors-to-tokens-plugin:build:development", - "host": "0.0.0.0", - "port": 4308 - } - }, - "defaultConfiguration": "development", - "continuous": true - }, - "extract-i18n": { - "executor": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "colors-to-tokens-plugin:build" - } - } - } -} diff --git a/plugins/apps/colors-to-tokens-plugin/src/plugin.ts b/plugins/apps/colors-to-tokens-plugin/src/plugin.ts index eb54d03831..ee2d2007ff 100644 --- a/plugins/apps/colors-to-tokens-plugin/src/plugin.ts +++ b/plugins/apps/colors-to-tokens-plugin/src/plugin.ts @@ -41,7 +41,7 @@ penpot.ui.onMessage((message) => { function resize(width: number, height: number) { if ('resize' in penpot.ui) { - (penpot as any).ui.resize(width, height); + penpot.ui.resize(width, height); } } diff --git a/plugins/apps/colors-to-tokens-plugin/vite.config.ts b/plugins/apps/colors-to-tokens-plugin/vite.config.ts index 7bb188ef75..ce57d28043 100644 --- a/plugins/apps/colors-to-tokens-plugin/vite.config.ts +++ b/plugins/apps/colors-to-tokens-plugin/vite.config.ts @@ -1,15 +1,11 @@ -/// +/// import { defineConfig } from 'vite'; export default defineConfig({ root: __dirname, - cacheDir: '../node_modules/.vite/colors-to-tokens-plugin', test: { watch: false, globals: true, - cache: { - dir: '../node_modules/.vitest', - }, environment: 'jsdom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], diff --git a/plugins/apps/contrast-plugin/eslint.config.js b/plugins/apps/contrast-plugin/eslint.config.js index 7aa90c2ab0..cdcefb4c9e 100644 --- a/plugins/apps/contrast-plugin/eslint.config.js +++ b/plugins/apps/contrast-plugin/eslint.config.js @@ -1,46 +1,33 @@ import baseConfig from '../../eslint.config.js'; -import { compat } from '../../eslint.base.config.js'; +import angular from '@angular-eslint/eslint-plugin'; +import angularTemplate from '@angular-eslint/eslint-plugin-template'; +import angularTemplateParser from '@angular-eslint/template-parser'; export default [ ...baseConfig, - ...compat - .config({ - extends: [ - 'plugin:@nx/angular', - 'plugin:@angular-eslint/template/process-inline-templates', - ], - }) - .map((config) => ({ - ...config, - files: ['**/*.ts'], - rules: { - '@angular-eslint/directive-selector': [ - 'error', - { - type: 'attribute', - prefix: 'app', - style: 'camelCase', - }, - ], - '@angular-eslint/component-selector': [ - 'error', - { - type: 'element', - prefix: 'app', - style: 'kebab-case', - }, - ], - }, - })), - ...compat - .config({ extends: ['plugin:@nx/angular-template'] }) - .map((config) => ({ - ...config, - files: ['**/*.html'], - rules: {}, - })), - { ignores: ['**/assets/*.js'] }, { + files: ['**/*.ts'], + plugins: { + '@angular-eslint': angular, + }, + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + }, languageOptions: { parserOptions: { project: './tsconfig.*?.json', @@ -48,4 +35,16 @@ export default [ }, }, }, + { + files: ['**/*.html'], + plugins: { + '@angular-eslint/template': angularTemplate, + }, + languageOptions: { + parser: angularTemplateParser, + }, + processor: '@angular-eslint/template/extract-inline-html', + rules: {}, + }, + { ignores: ['**/assets/*.js'] }, ]; diff --git a/plugins/apps/contrast-plugin/package.json b/plugins/apps/contrast-plugin/package.json new file mode 100644 index 0000000000..fbef9b21db --- /dev/null +++ b/plugins/apps/contrast-plugin/package.json @@ -0,0 +1,13 @@ +{ + "name": "contrast-plugin", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "build": "ng build contrast-plugin", + "build:dev": "ng build contrast-plugin --configuration development", + "serve": "ng serve contrast-plugin", + "lint": "eslint .", + "test": "vitest" + } +} diff --git a/plugins/apps/contrast-plugin/project.json b/plugins/apps/contrast-plugin/project.json deleted file mode 100644 index 4a8159c3ab..0000000000 --- a/plugins/apps/contrast-plugin/project.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "contrast-plugin", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "prefix": "app", - "sourceRoot": "apps/contrast-plugin/src", - "tags": ["type:plugin"], - "targets": { - "build": { - "executor": "@angular-devkit/build-angular:application", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/apps/contrast-plugin", - "index": "apps/contrast-plugin/src/index.html", - "browser": "apps/contrast-plugin/src/main.ts", - "polyfills": ["zone.js"], - "tsConfig": "apps/contrast-plugin/tsconfig.app.json", - "assets": [ - "apps/contrast-plugin/src/_headers", - "apps/contrast-plugin/src/favicon.ico", - "apps/contrast-plugin/src/assets" - ], - "styles": [ - "libs/plugins-styles/src/lib/styles.css", - "apps/contrast-plugin/src/styles.css" - ], - "scripts": [], - "optimization": { - "scripts": true, - "styles": true, - "fonts": false - } - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all" - }, - "development": { - "optimization": false, - "extractLicenses": false, - "sourceMap": true - } - }, - "defaultConfiguration": "production", - "dependsOn": ["buildPlugin"] - }, - "serve": { - "executor": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "buildTarget": "contrast-plugin:build:production" - }, - "development": { - "buildTarget": "contrast-plugin:build:development", - "host": "0.0.0.0", - "port": 4302 - } - }, - "defaultConfiguration": "development", - "continuous": true - }, - "extract-i18n": { - "executor": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "contrast-plugin:build" - } - } - } -} diff --git a/plugins/apps/contrast-plugin/vite.config.ts b/plugins/apps/contrast-plugin/vite.config.ts index c5ff14b94c..5b4538a2e6 100644 --- a/plugins/apps/contrast-plugin/vite.config.ts +++ b/plugins/apps/contrast-plugin/vite.config.ts @@ -1,14 +1,10 @@ -/// +/// import { defineConfig } from 'vite'; export default defineConfig({ root: __dirname, - cacheDir: '../node_modules/.vite/contrast-plugin', test: { globals: true, - cache: { - dir: '../node_modules/.vitest', - }, environment: 'jsdom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], diff --git a/plugins/apps/create-palette-plugin/.babelrc b/plugins/apps/create-palette-plugin/.babelrc deleted file mode 100644 index f2f3806745..0000000000 --- a/plugins/apps/create-palette-plugin/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@nx/js/babel"] -} diff --git a/plugins/apps/create-palette-plugin/.swcrc b/plugins/apps/create-palette-plugin/.swcrc deleted file mode 100644 index a2d5b04f47..0000000000 --- a/plugins/apps/create-palette-plugin/.swcrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "jsc": { - "parser": { - "syntax": "typescript" - }, - "target": "es2016" - } -} diff --git a/plugins/apps/create-palette-plugin/package.json b/plugins/apps/create-palette-plugin/package.json new file mode 100644 index 0000000000..8d9adc07ee --- /dev/null +++ b/plugins/apps/create-palette-plugin/package.json @@ -0,0 +1,14 @@ +{ + "name": "create-palette-plugin", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "build:watch": "vite build --watch --mode development", + "preview": "vite preview", + "lint": "eslint .", + "test": "vitest" + } +} diff --git a/plugins/apps/create-palette-plugin/project.json b/plugins/apps/create-palette-plugin/project.json deleted file mode 100644 index c91245bf40..0000000000 --- a/plugins/apps/create-palette-plugin/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "create-palette-plugin", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "sourceRoot": "apps/create-palette-plugin/src", - "tags": ["type:plugin"], - "targets": {} -} diff --git a/plugins/apps/create-palette-plugin/vite.config.ts b/plugins/apps/create-palette-plugin/vite.config.ts index 4a2baef1a0..28b4810798 100644 --- a/plugins/apps/create-palette-plugin/vite.config.ts +++ b/plugins/apps/create-palette-plugin/vite.config.ts @@ -1,12 +1,9 @@ -/// +/// import { defineConfig } from 'vite'; - -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import tsconfigPaths from 'vite-tsconfig-paths'; export default defineConfig({ root: __dirname, - cacheDir: '../../node_modules/.vite/apps/create-palette-plugin', - server: { port: 4305, host: '0.0.0.0', @@ -16,14 +13,7 @@ export default defineConfig({ port: 4305, host: '0.0.0.0', }, - - plugins: [nxViteTsPaths()], - - // Uncomment this if you are using workers. - // worker: { - // plugins: [ nxViteTsPaths() ], - // }, - + plugins: [tsconfigPaths()], build: { outDir: '../../dist/apps/create-palette-plugin', reportCompressedSize: true, @@ -40,12 +30,8 @@ export default defineConfig({ }, }, }, - test: { globals: true, - cache: { - dir: '../../node_modules/.vitest', - }, environment: 'jsdom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], diff --git a/plugins/apps/e2e/eslint.config.js b/plugins/apps/e2e/eslint.config.js index 6ad54283da..e41f553526 100644 --- a/plugins/apps/e2e/eslint.config.js +++ b/plugins/apps/e2e/eslint.config.js @@ -7,7 +7,7 @@ export default [ { languageOptions: { parser: typescriptEslintParser, - parserOptions: { project: './apps/e2e/tsconfig.json' }, + parserOptions: { project: './tsconfig.json' }, }, }, { diff --git a/plugins/apps/e2e/package.json b/plugins/apps/e2e/package.json new file mode 100644 index 0000000000..d6e4bce356 --- /dev/null +++ b/plugins/apps/e2e/package.json @@ -0,0 +1,10 @@ +{ + "name": "e2e", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "test": "vitest", + "lint": "eslint ." + } +} diff --git a/plugins/apps/e2e/project.json b/plugins/apps/e2e/project.json deleted file mode 100644 index 30596a8c1d..0000000000 --- a/plugins/apps/e2e/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "e2e", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "implicitDependencies": [], - "tags": ["type:e2e"], - "targets": {} -} diff --git a/plugins/apps/e2e/src/utils/agent.ts b/plugins/apps/e2e/src/utils/agent.ts index f5775d75d4..0093cc64ce 100644 --- a/plugins/apps/e2e/src/utils/agent.ts +++ b/plugins/apps/e2e/src/utils/agent.ts @@ -107,6 +107,7 @@ export async function Agent() { console.log('Running plugin code...'); await page.evaluate((testingPlugin) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any (globalThis as any).ɵloadPlugin({ pluginId: 'TEST', name: 'Test', diff --git a/plugins/apps/e2e/vite.config.ts b/plugins/apps/e2e/vite.config.ts index 4f2d855a66..ac46a55bd9 100644 --- a/plugins/apps/e2e/vite.config.ts +++ b/plugins/apps/e2e/vite.config.ts @@ -1,16 +1,12 @@ -/// +/// import { defineConfig } from 'vite'; export default defineConfig({ root: __dirname, - cacheDir: '../../node_modules/.vite/e2e', test: { testTimeout: 20000, watch: false, globals: true, - cache: { - dir: '../node_modules/.vitest', - }, environment: 'happy-dom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], diff --git a/plugins/apps/example-styles/.babelrc b/plugins/apps/example-styles/.babelrc deleted file mode 100644 index f2f3806745..0000000000 --- a/plugins/apps/example-styles/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@nx/js/babel"] -} diff --git a/plugins/apps/example-styles/.swcrc b/plugins/apps/example-styles/.swcrc deleted file mode 100644 index a2d5b04f47..0000000000 --- a/plugins/apps/example-styles/.swcrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "jsc": { - "parser": { - "syntax": "typescript" - }, - "target": "es2016" - } -} diff --git a/plugins/apps/example-styles/package.json b/plugins/apps/example-styles/package.json new file mode 100644 index 0000000000..2496eb113e --- /dev/null +++ b/plugins/apps/example-styles/package.json @@ -0,0 +1,13 @@ +{ + "name": "example-styles", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "build:watch": "vite build --watch --mode development", + "preview": "vite preview", + "lint": "eslint ." + } +} diff --git a/plugins/apps/example-styles/project.json b/plugins/apps/example-styles/project.json deleted file mode 100644 index 8a32c41845..0000000000 --- a/plugins/apps/example-styles/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "example-styles", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "sourceRoot": "apps/example-styles/src", - "tags": ["type:app"], - "targets": {} -} diff --git a/plugins/apps/example-styles/src/app/app.element.ts b/plugins/apps/example-styles/src/app/app.element.ts index 58aa278845..03f2160171 100644 --- a/plugins/apps/example-styles/src/app/app.element.ts +++ b/plugins/apps/example-styles/src/app/app.element.ts @@ -25,7 +25,8 @@ export class AppElement extends HTMLElement { el.remove(); }); - (window as any).hljs.highlightAll(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (window as any).hljs?.highlightAll(); } getIndentationSize(str: string) { diff --git a/plugins/apps/example-styles/vite.config.ts b/plugins/apps/example-styles/vite.config.ts index 79b201e514..e5b2a268de 100644 --- a/plugins/apps/example-styles/vite.config.ts +++ b/plugins/apps/example-styles/vite.config.ts @@ -1,12 +1,9 @@ -/// +/// import { defineConfig } from 'vite'; - -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import tsconfigPaths from 'vite-tsconfig-paths'; export default defineConfig({ root: __dirname, - cacheDir: '../../node_modules/.vite/apps/example-styles', - server: { port: 4201, host: '0.0.0.0', @@ -17,12 +14,7 @@ export default defineConfig({ host: '0.0.0.0', }, - plugins: [nxViteTsPaths()], - - // Uncomment this if you are using workers. - // worker: { - // plugins: [ nxViteTsPaths() ], - // }, + plugins: [tsconfigPaths()], build: { outDir: '../../dist/apps/example-styles', @@ -34,9 +26,6 @@ export default defineConfig({ test: { globals: true, - cache: { - dir: '../../node_modules/.vitest', - }, environment: 'jsdom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], diff --git a/plugins/apps/icons-plugin/eslint.config.js b/plugins/apps/icons-plugin/eslint.config.js index 7aa90c2ab0..cdcefb4c9e 100644 --- a/plugins/apps/icons-plugin/eslint.config.js +++ b/plugins/apps/icons-plugin/eslint.config.js @@ -1,46 +1,33 @@ import baseConfig from '../../eslint.config.js'; -import { compat } from '../../eslint.base.config.js'; +import angular from '@angular-eslint/eslint-plugin'; +import angularTemplate from '@angular-eslint/eslint-plugin-template'; +import angularTemplateParser from '@angular-eslint/template-parser'; export default [ ...baseConfig, - ...compat - .config({ - extends: [ - 'plugin:@nx/angular', - 'plugin:@angular-eslint/template/process-inline-templates', - ], - }) - .map((config) => ({ - ...config, - files: ['**/*.ts'], - rules: { - '@angular-eslint/directive-selector': [ - 'error', - { - type: 'attribute', - prefix: 'app', - style: 'camelCase', - }, - ], - '@angular-eslint/component-selector': [ - 'error', - { - type: 'element', - prefix: 'app', - style: 'kebab-case', - }, - ], - }, - })), - ...compat - .config({ extends: ['plugin:@nx/angular-template'] }) - .map((config) => ({ - ...config, - files: ['**/*.html'], - rules: {}, - })), - { ignores: ['**/assets/*.js'] }, { + files: ['**/*.ts'], + plugins: { + '@angular-eslint': angular, + }, + rules: { + '@angular-eslint/directive-selector': [ + 'error', + { + type: 'attribute', + prefix: 'app', + style: 'camelCase', + }, + ], + '@angular-eslint/component-selector': [ + 'error', + { + type: 'element', + prefix: 'app', + style: 'kebab-case', + }, + ], + }, languageOptions: { parserOptions: { project: './tsconfig.*?.json', @@ -48,4 +35,16 @@ export default [ }, }, }, + { + files: ['**/*.html'], + plugins: { + '@angular-eslint/template': angularTemplate, + }, + languageOptions: { + parser: angularTemplateParser, + }, + processor: '@angular-eslint/template/extract-inline-html', + rules: {}, + }, + { ignores: ['**/assets/*.js'] }, ]; diff --git a/plugins/apps/icons-plugin/package.json b/plugins/apps/icons-plugin/package.json new file mode 100644 index 0000000000..42475abf07 --- /dev/null +++ b/plugins/apps/icons-plugin/package.json @@ -0,0 +1,13 @@ +{ + "name": "icons-plugin", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "build": "ng build icons-plugin", + "build:dev": "ng build icons-plugin --configuration development", + "serve": "ng serve icons-plugin", + "lint": "eslint .", + "test": "vitest" + } +} diff --git a/plugins/apps/icons-plugin/project.json b/plugins/apps/icons-plugin/project.json deleted file mode 100644 index fe4542ceb1..0000000000 --- a/plugins/apps/icons-plugin/project.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "icons-plugin", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "prefix": "app", - "sourceRoot": "apps/icons-plugin/src", - "tags": ["type:plugin"], - "targets": { - "build": { - "executor": "@angular-devkit/build-angular:application", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/apps/icons-plugin", - "index": "apps/icons-plugin/src/index.html", - "browser": "apps/icons-plugin/src/main.ts", - "polyfills": ["zone.js"], - "tsConfig": "apps/icons-plugin/tsconfig.app.json", - "assets": [ - "apps/icons-plugin/src/_headers", - "apps/icons-plugin/src/favicon.ico", - "apps/icons-plugin/src/assets" - ], - "styles": [ - "libs/plugins-styles/src/lib/styles.css", - "apps/icons-plugin/src/styles.css" - ], - "optimization": { - "scripts": true, - "styles": true, - "fonts": false - }, - "scripts": [] - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "outputHashing": "all" - }, - "development": { - "optimization": false, - "extractLicenses": false, - "sourceMap": true - } - }, - "defaultConfiguration": "production", - "dependsOn": ["buildPlugin"] - }, - "serve": { - "executor": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "buildTarget": "icons-plugin:build:production" - }, - "development": { - "buildTarget": "icons-plugin:build:development", - "host": "0.0.0.0", - "port": 4303 - } - }, - "defaultConfiguration": "development", - "continuous": true - }, - "extract-i18n": { - "executor": "@angular-devkit/build-angular:extract-i18n", - "options": { - "buildTarget": "icons-plugin:build" - } - } - } -} diff --git a/plugins/apps/icons-plugin/src/app/app.component.ts b/plugins/apps/icons-plugin/src/app/app.component.ts index dfb2ac323d..4c3ebc6ed3 100644 --- a/plugins/apps/icons-plugin/src/app/app.component.ts +++ b/plugins/apps/icons-plugin/src/app/app.component.ts @@ -1,7 +1,6 @@ import { Component, inject, signal } from '@angular/core'; import { ActivatedRoute, RouterModule } from '@angular/router'; import { FeatherIconNames, icons } from 'feather-icons'; -import { SafeHtmlPipe } from './pipes/safe-html.pipe'; import { IconButtonComponent } from './components/icon-button/icon-button.component'; import { IconSearchComponent } from './components/icon-search/icon-search.component'; import { toSignal } from '@angular/core/rxjs-interop'; @@ -10,12 +9,7 @@ import { PluginMessageEvent } from '../model'; @Component({ selector: 'app-root', - imports: [ - RouterModule, - SafeHtmlPipe, - IconButtonComponent, - IconSearchComponent, - ], + imports: [RouterModule, IconButtonComponent, IconSearchComponent], styleUrl: './app.component.css', template: `