diff --git a/CODEOWNERS b/CODEOWNERS index f5ddf0e3bba7a3..b147e6f38d416c 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -54,6 +54,12 @@ pnpm-lock.yaml @nrwl/nx-core-reviewers /packages/react-native/** @nrwl/nx-react-reviewers /e2e/react-native/** @nrwl/nx-react-reviewers +# Vue +/docs/generated/packages/vue/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers +/docs/shared/packages/vue/** @nrwl/nx-js-reviewers @nrwl/nx-docs-reviewers +/packages/vue/** @nrwl/nx-js-reviewers +/e2e/vue/** @nrwl/nx-js-reviewers + ## Node /docs/generated/packages/node/** @nrwl/nx-node-reviewers @nrwl/nx-docs-reviewers /docs/generated/packages/nest/** @nrwl/nx-node-reviewers @nrwl/nx-docs-reviewers diff --git a/e2e/vue/jest.config.ts b/e2e/vue/jest.config.ts new file mode 100644 index 00000000000000..9475cb21dfce52 --- /dev/null +++ b/e2e/vue/jest.config.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +export default { + displayName: 'e2e-vue', + preset: '../../jest.preset.js', + transform: { + '^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], + maxWorkers: 1, + globals: {}, + globalSetup: '../utils/global-setup.ts', + globalTeardown: '../utils/global-teardown.ts', +}; diff --git a/e2e/vue/project.json b/e2e/vue/project.json new file mode 100644 index 00000000000000..d436d055077862 --- /dev/null +++ b/e2e/vue/project.json @@ -0,0 +1,10 @@ +{ + "name": "e2e-vue", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "e2e/vue", + "projectType": "application", + "targets": { + "e2e": {} + }, + "implicitDependencies": ["vue"] +} diff --git a/e2e/vue/tsconfig.json b/e2e/vue/tsconfig.json new file mode 100644 index 00000000000000..6d5abf84832009 --- /dev/null +++ b/e2e/vue/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "types": ["node", "jest"] + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/e2e/vue/tsconfig.spec.json b/e2e/vue/tsconfig.spec.json new file mode 100644 index 00000000000000..1a24bfb0a13536 --- /dev/null +++ b/e2e/vue/tsconfig.spec.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "**/*.test.ts", + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.test.js", + "**/*.spec.jsx", + "**/*.test.jsx", + "**/*.d.ts", + "jest.config.ts" + ] +} diff --git a/packages/vue/.eslintrc.json b/packages/vue/.eslintrc.json new file mode 100644 index 00000000000000..379043e4b42a9e --- /dev/null +++ b/packages/vue/.eslintrc.json @@ -0,0 +1,38 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["./package.json", "./generators.json", "./executors.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/nx-plugin-checks": "error" + } + }, + { + "files": ["./package.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": [ + "error", + { + "buildTargets": ["build-base"], + "ignoredDependencies": ["nx", "typescript"] + } + ] + } + } + ] +} diff --git a/packages/vue/README.md b/packages/vue/README.md new file mode 100644 index 00000000000000..7d8346eedace50 --- /dev/null +++ b/packages/vue/README.md @@ -0,0 +1,13 @@ +

Nx - Smart, Fast and Extensible Build System

+ +{{links}} + +
+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. + +This package is a [Vue plugin for Nx](https://nx.dev/packages/vue). + +{{content}} diff --git a/packages/vue/executors.json b/packages/vue/executors.json new file mode 100644 index 00000000000000..bfd9c672e7dc44 --- /dev/null +++ b/packages/vue/executors.json @@ -0,0 +1,4 @@ +{ + "builders": {}, + "executors": {} +} diff --git a/packages/vue/generators.json b/packages/vue/generators.json new file mode 100644 index 00000000000000..3a2cd9c0d5b038 --- /dev/null +++ b/packages/vue/generators.json @@ -0,0 +1,6 @@ +{ + "name": "Nx Vue", + "version": "0.1", + "schematics": {}, + "generators": {} +} diff --git a/packages/vue/index.ts b/packages/vue/index.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/vue/jest.config.ts b/packages/vue/jest.config.ts new file mode 100644 index 00000000000000..c7bbe99346d6eb --- /dev/null +++ b/packages/vue/jest.config.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +export default { + displayName: 'vue', + preset: '../../jest.preset.js', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/packages/vue', +}; diff --git a/packages/vue/migrations.json b/packages/vue/migrations.json new file mode 100644 index 00000000000000..f9d34cef28c2cd --- /dev/null +++ b/packages/vue/migrations.json @@ -0,0 +1,4 @@ +{ + "generators": {}, + "packageJsonUpdates": {} +} diff --git a/packages/vue/migrations.spec.ts b/packages/vue/migrations.spec.ts new file mode 100644 index 00000000000000..655cf2ebadbf6b --- /dev/null +++ b/packages/vue/migrations.spec.ts @@ -0,0 +1,8 @@ +import json = require('./migrations.json'); + +import { assertValidMigrationPaths } from '@nx/devkit/internal-testing-utils'; +import { MigrationsJson } from '@nx/devkit'; + +describe('vite migrations', () => { + assertValidMigrationPaths(json as MigrationsJson, __dirname); +}); diff --git a/packages/vue/package.json b/packages/vue/package.json new file mode 100644 index 00000000000000..ab16343876d1a2 --- /dev/null +++ b/packages/vue/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nx/vue", + "version": "0.0.1", + "private": true, + "description": "The Vue plugin for Nx contains executors and generators for managing Vue applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages/vue" + }, + "keywords": [ + "Monorepo", + "Vue", + "Web", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "schematics": "./generators.json", + "builders": "./executors.json", + "ng-update": { + "requirements": {}, + "migrations": "./migrations.json" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": "./index.js", + "./package.json": "./package.json", + "./migrations.json": "./migrations.json", + "./generators.json": "./generators.json", + "./executors.json": "./executors.json" + } +} diff --git a/packages/vue/project.json b/packages/vue/project.json new file mode 100644 index 00000000000000..012ce949398499 --- /dev/null +++ b/packages/vue/project.json @@ -0,0 +1,64 @@ +{ + "name": "vue", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/vue", + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "options": { + "jestConfig": "packages/vue/jest.config.ts", + "passWithNoTests": true + }, + "outputs": ["{workspaceRoot}/coverage/packages/vue"] + }, + "build-base": { + "executor": "@nx/js:tsc", + "options": { + "outputPath": "build/packages/vue", + "tsConfig": "packages/vue/tsconfig.lib.json", + "main": "packages/vue/index.ts", + "assets": [ + { + "input": "packages/vue", + "glob": "**/files/**", + "output": "/" + }, + { + "input": "packages/vue", + "glob": "**/files/**/.gitkeep", + "output": "/" + }, + { + "input": "packages/vue", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"], + "output": "/" + }, + { + "input": "packages/vue", + "glob": "**/*.js", + "ignore": ["**/jest.config.js"], + "output": "/" + }, + { + "input": "packages/vue", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + }, + "outputs": ["{options.outputPath}"] + }, + "build": { + "command": "node ./scripts/copy-readme.js vue", + "outputs": ["{workspaceRoot}/build/packages/vue"] + }, + "lint": {} + } +} diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json new file mode 100644 index 00000000000000..19b9eece4df145 --- /dev/null +++ b/packages/vue/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs" + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/vue/tsconfig.lib.json b/packages/vue/tsconfig.lib.json new file mode 100644 index 00000000000000..7bfc80f73e6fad --- /dev/null +++ b/packages/vue/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["**/*.ts"], + "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] +} diff --git a/packages/vue/tsconfig.spec.json b/packages/vue/tsconfig.spec.json new file mode 100644 index 00000000000000..546f12877f7f05 --- /dev/null +++ b/packages/vue/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/scripts/commitizen.js b/scripts/commitizen.js index 4a4b204d13209e..07d99387f6d485 100644 --- a/scripts/commitizen.js +++ b/scripts/commitizen.js @@ -23,6 +23,7 @@ const scopes = [ { value: 'storybook', name: 'storybook: anything Storybook specific' }, { value: 'testing', name: 'testing: anything testing specific (e.g. jest or cypress)' }, { value: 'vite', name: 'vite: anything Vite specific' }, + { value: 'vue', name: 'vue: anything Vue specific' }, { value: 'web', name: 'web: anything Web specific' }, { value: 'webpack', name: 'webpack: anything Webpack specific' }, ]; diff --git a/tsconfig.base.json b/tsconfig.base.json index 45ccadc97782e3..748dab1846dd9f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -101,6 +101,7 @@ "@nx/typedoc-theme": ["typedoc-theme/src/index.ts"], "@nx/vite": ["packages/vite"], "@nx/vite/*": ["packages/vite/*"], + "@nx/vue": ["packages/vue/src/index.ts"], "@nx/web": ["packages/web"], "@nx/web/*": ["packages/web/*"], "@nx/webpack": ["packages/webpack"],