Skip to content

Commit

Permalink
feat(nuxt): add private Nuxt plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Oct 3, 2023
1 parent 19be500 commit 077bde7
Show file tree
Hide file tree
Showing 24 changed files with 277 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions e2e/nuxt/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable */
export default {
displayName: 'e2e-nuxt',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
maxWorkers: 1,
globals: {},
globalSetup: '../utils/global-setup.ts',
globalTeardown: '../utils/global-teardown.ts',
};
10 changes: 10 additions & 0 deletions e2e/nuxt/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "e2e-nuxt",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/nuxt",
"projectType": "application",
"targets": {
"e2e": {}
},
"implicitDependencies": ["nuxt"]
}
Empty file added e2e/nuxt/src/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions e2e/nuxt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": [],
"files": [],
"references": [
{
"path": "./tsconfig.spec.json"
}
]
}
20 changes: 20 additions & 0 deletions e2e/nuxt/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
38 changes: 38 additions & 0 deletions packages/nuxt/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -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"]
}
]
}
}
]
}
13 changes: 13 additions & 0 deletions packages/nuxt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>

{{links}}

<hr>

# 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}}
Empty file added packages/nuxt/docs/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions packages/nuxt/executors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"executors": {}
}
5 changes: 5 additions & 0 deletions packages/nuxt/generators.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Nx Nuxt",
"version": "0.1",
"generators": {}
}
1 change: 1 addition & 0 deletions packages/nuxt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/utils/versions';
10 changes: 10 additions & 0 deletions packages/nuxt/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-disable */
export default {
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
displayName: 'nuxt',
preset: '../../jest.preset.js',
coverageDirectory: '../../coverage/packages/nuxt',
};
4 changes: 4 additions & 0 deletions packages/nuxt/migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"generators": {},
"packageJsonUpdates": {}
}
37 changes: 37 additions & 0 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
68 changes: 68 additions & 0 deletions packages/nuxt/project.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
Empty file.
Empty file.
1 change: 1 addition & 0 deletions packages/nuxt/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const nxVersion = require('../../package.json').version;
16 changes: 16 additions & 0 deletions packages/nuxt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs"
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
10 changes: 10 additions & 0 deletions packages/nuxt/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -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"]
}
9 changes: 9 additions & 0 deletions packages/nuxt/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -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"]
}
3 changes: 2 additions & 1 deletion scripts/commitizen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down

0 comments on commit 077bde7

Please sign in to comment.