diff --git a/CODEOWNERS b/CODEOWNERS index 4551eb72a664d0..d5696b7a452726 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -57,6 +57,8 @@ pnpm-lock.yaml @nrwl/nx-core-reviewers # Vue /packages/vue/** @nrwl/nx-vue-reviewers /e2e/vue/** @nrwl/nx-vue-reviewers +/packages/nuxt/** @nrwl/nx-vue-reviewers +/e2e/nuxt/** @nrwl/nx-vue-reviewers ## Node /docs/generated/packages/node/** @nrwl/nx-node-reviewers @nrwl/nx-docs-reviewers diff --git a/e2e/nuxt/jest.config.ts b/e2e/nuxt/jest.config.ts new file mode 100644 index 00000000000000..26b8d6d8492798 --- /dev/null +++ b/e2e/nuxt/jest.config.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +export default { + displayName: 'e2e-nuxt', + 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/nuxt/project.json b/e2e/nuxt/project.json new file mode 100644 index 00000000000000..9d5b451030be2b --- /dev/null +++ b/e2e/nuxt/project.json @@ -0,0 +1,10 @@ +{ + "name": "e2e-nuxt", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "e2e/nuxt", + "projectType": "application", + "targets": { + "e2e": {} + }, + "implicitDependencies": ["nuxt"] +} diff --git a/e2e/nuxt/src/.gitkeep b/e2e/nuxt/src/.gitkeep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/e2e/nuxt/tsconfig.json b/e2e/nuxt/tsconfig.json new file mode 100644 index 00000000000000..6d5abf84832009 --- /dev/null +++ b/e2e/nuxt/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/nuxt/tsconfig.spec.json b/e2e/nuxt/tsconfig.spec.json new file mode 100644 index 00000000000000..1a24bfb0a13536 --- /dev/null +++ b/e2e/nuxt/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/e2e/utils/create-project-utils.ts b/e2e/utils/create-project-utils.ts index 3439a43cab49ae..b60e256e23e66e 100644 --- a/e2e/utils/create-project-utils.ts +++ b/e2e/utils/create-project-utils.ts @@ -81,6 +81,7 @@ export function newProject({ `@nx/nest`, `@nx/next`, `@nx/node`, + `@nx/nuxt`, `@nx/plugin`, `@nx/playwright`, `@nx/rollup`, diff --git a/packages/nuxt/.eslintrc.json b/packages/nuxt/.eslintrc.json new file mode 100644 index 00000000000000..379043e4b42a9e --- /dev/null +++ b/packages/nuxt/.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/nuxt/README.md b/packages/nuxt/README.md new file mode 100644 index 00000000000000..25eb5c64def10c --- /dev/null +++ b/packages/nuxt/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 [Nuxt plugin for Nx](https://nx.dev/nx-api/nuxt). + +{{content}} diff --git a/packages/nuxt/docs/.gitkeep b/packages/nuxt/docs/.gitkeep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/nuxt/executors.json b/packages/nuxt/executors.json new file mode 100644 index 00000000000000..3a64718e93cb08 --- /dev/null +++ b/packages/nuxt/executors.json @@ -0,0 +1,3 @@ +{ + "executors": {} +} diff --git a/packages/nuxt/generators.json b/packages/nuxt/generators.json new file mode 100644 index 00000000000000..4bc61ef3634b89 --- /dev/null +++ b/packages/nuxt/generators.json @@ -0,0 +1,5 @@ +{ + "name": "Nx Nuxt", + "version": "0.1", + "generators": {} +} diff --git a/packages/nuxt/index.ts b/packages/nuxt/index.ts new file mode 100644 index 00000000000000..457e54197c0426 --- /dev/null +++ b/packages/nuxt/index.ts @@ -0,0 +1 @@ +export * from './src/utils/versions'; diff --git a/packages/nuxt/jest.config.ts b/packages/nuxt/jest.config.ts new file mode 100644 index 00000000000000..fc5050c9b8935f --- /dev/null +++ b/packages/nuxt/jest.config.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +export default { + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + displayName: 'nuxt', + preset: '../../jest.preset.js', + coverageDirectory: '../../coverage/packages/nuxt', +}; diff --git a/packages/nuxt/migrations.json b/packages/nuxt/migrations.json new file mode 100644 index 00000000000000..f9d34cef28c2cd --- /dev/null +++ b/packages/nuxt/migrations.json @@ -0,0 +1,4 @@ +{ + "generators": {}, + "packageJsonUpdates": {} +} diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json new file mode 100644 index 00000000000000..430d5db458b13b --- /dev/null +++ b/packages/nuxt/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nx/nuxt", + "version": "0.0.1", + "private": true, + "description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt 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/nuxt" + }, + "keywords": [ + "Monorepo", + "Nuxt", + "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", + "generators": "./generators.json", + "executors": "./executors.json", + "nx-migrations": { + "migrations": "./migrations.json" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "publishConfig": { + "access": "public" + }, + "peerDependencies": {} +} diff --git a/packages/nuxt/project.json b/packages/nuxt/project.json new file mode 100644 index 00000000000000..cf54b7a8db4c65 --- /dev/null +++ b/packages/nuxt/project.json @@ -0,0 +1,68 @@ +{ + "name": "nuxt", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/nuxt", + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "options": { + "jestConfig": "packages/nuxt/jest.config.ts", + "passWithNoTests": true + }, + "outputs": ["{workspaceRoot}/coverage/packages/nuxt"] + }, + "build-base": { + "executor": "@nx/js:tsc", + "options": { + "outputPath": "build/packages/nuxt", + "tsConfig": "packages/nuxt/tsconfig.lib.json", + "main": "packages/nuxt/index.ts", + "generateExportsField": true, + "additionalEntryPoints": [ + "{projectRoot}/{executors,generators,migrations}.json" + ], + "assets": [ + { + "input": "packages/nuxt", + "glob": "**/files/**", + "output": "/" + }, + { + "input": "packages/nuxt", + "glob": "**/files/**/.gitkeep", + "output": "/" + }, + { + "input": "packages/nuxt", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"], + "output": "/" + }, + { + "input": "packages/nuxt", + "glob": "**/*.js", + "ignore": ["**/jest.config.js"], + "output": "/" + }, + { + "input": "packages/nuxt", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + }, + "outputs": ["{options.outputPath}"] + }, + "build": { + "command": "node ./scripts/copy-readme.js nuxt", + "outputs": ["{workspaceRoot}/build/packages/nuxt"] + }, + "lint": {} + } +} diff --git a/packages/nuxt/src/executors/.gitkeep b/packages/nuxt/src/executors/.gitkeep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/nuxt/src/generators/.gitkeep b/packages/nuxt/src/generators/.gitkeep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/nuxt/src/utils/versions.ts b/packages/nuxt/src/utils/versions.ts new file mode 100644 index 00000000000000..e268dc8f82dd39 --- /dev/null +++ b/packages/nuxt/src/utils/versions.ts @@ -0,0 +1 @@ +export const nxVersion = require('../../package.json').version; diff --git a/packages/nuxt/tsconfig.json b/packages/nuxt/tsconfig.json new file mode 100644 index 00000000000000..19b9eece4df145 --- /dev/null +++ b/packages/nuxt/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/nuxt/tsconfig.lib.json b/packages/nuxt/tsconfig.lib.json new file mode 100644 index 00000000000000..7bfc80f73e6fad --- /dev/null +++ b/packages/nuxt/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/nuxt/tsconfig.spec.json b/packages/nuxt/tsconfig.spec.json new file mode 100644 index 00000000000000..546f12877f7f05 --- /dev/null +++ b/packages/nuxt/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 07d99387f6d485..20e89b6fe13607 100644 --- a/scripts/commitizen.js +++ b/scripts/commitizen.js @@ -13,9 +13,10 @@ const scopes = [ { value: 'nest', name: 'nest: anything Nest specific' }, { value: 'nextjs', name: 'nextjs: anything Next specific' }, { value: 'node', name: 'node: anything Node specific' }, + { value: 'nuxt', name: 'nuxt: anything Nuxt specific' }, { value: 'nx-cloud', name: 'nx-cloud: anything NxCloud specific' }, { value: 'nx-plugin', name: 'nx-plugin: anything Nx Plugin specific' }, - { value: 'nx-dev', name: 'nx-dev: anything related to docs infrastructure' }, + { value: 'nx-dev', name: 'nx-dev: anything related to docs infrastructure' }, { value: 'react', name: 'react: anything React specific' }, { value: 'react-native', name: 'react-native: anything React Native specific' }, { value: 'expo', name: 'expo: anything Expo specific' }, diff --git a/tsconfig.base.json b/tsconfig.base.json index 0a2070143c6335..70fccbc9599e6a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -47,6 +47,8 @@ "@nx/next/*": ["packages/next/*"], "@nx/node": ["packages/node"], "@nx/node/*": ["packages/node/*"], + "@nx/nuxt": ["packages/nuxt"], + "@nx/nuxt/*": ["packages/nuxt/*"], "@nx/nx-dev/data-access-documents": [ "nx-dev/data-access-documents/src/index.ts" ],