Skip to content

Commit

Permalink
build: add support for and upgrade to Nx 18 (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Feb 11, 2024
1 parent ed807c4 commit 180f358
Show file tree
Hide file tree
Showing 44 changed files with 812 additions and 1,912 deletions.
5 changes: 1 addition & 4 deletions apps/analog-app-e2e-cypress/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/analog-app-e2e-cypress/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
5 changes: 1 addition & 4 deletions apps/analog-app-e2e-playwright/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/analog-app-e2e-playwright/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
3 changes: 2 additions & 1 deletion apps/analog-app-e2e-playwright/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { offsetFromRoot } from '@nx/devkit';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: 'tests',
root: __dirname,
test: {
reporters: ['default'],
globals: true,
environment: 'node',
include: ['**/*.spec.ts'],
Expand Down
8 changes: 1 addition & 7 deletions apps/analog-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@
}
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"apps/analog-app/**/*.ts",
"apps/analog-app/**/*.html"
]
}
"executor": "@nx/eslint:lint"
},
"tests": {
"executor": "@nx/vite:test",
Expand Down
9 changes: 9 additions & 0 deletions apps/analog-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ if (process.env['NETLIFY'] === 'true') {
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: __dirname,
publicDir: 'src/public',
build: {
outDir: '../../dist/apps/analog-app/client',
reportCompressedSize: true,
commonjsOptions: { transformMixedEsModules: true },
target: ['es2020'],
},
optimizeDeps: {
Expand All @@ -45,6 +49,11 @@ export default defineConfig(({ mode }) => {
splitVendorChunkPlugin(),
],
test: {
reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/apps/analog-app',
provider: 'v8',
},
globals: true,
environment: 'jsdom',
setupFiles: ['src/test-setup.ts'],
Expand Down
3 changes: 2 additions & 1 deletion apps/analog-preset-e2e/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { offsetFromRoot } from '@nx/devkit';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: 'tests',
root: __dirname,
test: {
reporters: ['default'],
globals: true,
environment: 'node',
include: ['**/*.spec.ts'],
Expand Down
5 changes: 1 addition & 4 deletions apps/astro-app-e2e-playwright/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/astro-app-e2e-playwright/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
2 changes: 2 additions & 0 deletions apps/astro-app-e2e-playwright/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: __dirname,
test: {
reporters: ['default'],
globals: true,
environment: 'node',
include: ['**/*.spec.ts'],
Expand Down
5 changes: 1 addition & 4 deletions apps/blog-app-e2e-cypress/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/blog-app-e2e-cypress/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
4 changes: 4 additions & 0 deletions apps/blog-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
root: __dirname,
publicDir: 'src/assets',
optimizeDeps: {
include: ['@angular/common'],
},
build: {
outDir: '../../dist/apps/blog-app/client',
reportCompressedSize: true,
commonjsOptions: { transformMixedEsModules: true },
target: ['es2020'],
},
plugins: [
Expand Down
3 changes: 2 additions & 1 deletion apps/create-analog-e2e/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { offsetFromRoot } from '@nx/devkit';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: 'tests',
root: __dirname,
test: {
reporters: ['default'],
globals: true,
environment: 'node',
include: ['**/*.spec.ts'],
Expand Down
5 changes: 1 addition & 4 deletions apps/ng-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/ng-app/**/*.ts", "apps/ng-app/**/*.html"]
}
"outputs": ["{options.outputFile}"]
}
}
}
8 changes: 8 additions & 0 deletions apps/ng-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import analog from '@analogjs/platform';

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
root: __dirname,
publicDir: 'src/assets',
build: {
outDir: '../../dist/apps/ng-app/client',
reportCompressedSize: true,
commonjsOptions: { transformMixedEsModules: true },
target: ['es2020'],
},
resolve: {
Expand All @@ -23,6 +27,10 @@ export default defineConfig(({ mode }) => ({
}),
],
test: {
coverage: {
reportsDirectory: '../../coverage/apps/ng-app',
provider: 'v8',
},
globals: true,
environment: 'jsdom',
setupFiles: ['src/test.ts'],
Expand Down
8 changes: 3 additions & 5 deletions apps/nx-plugin-e2e/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/// <reference types="vitest" />

import { defineConfig } from 'vite';
import { offsetFromRoot } from '@nx/devkit';

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: 'tests',
root: __dirname,
test: {
reporters: ['default'],
globals: true,
environment: 'node',
include: ['**/*.spec.ts'],
cache: {
dir: `${offsetFromRoot(
'apps/nx-plugin-e2e'
)}/node_modules/.vitest/nx-plugin-e2e`,
dir: `../../node_modules/.vitest/nx-plugin-e2e`,
},
},
define: {
Expand Down
5 changes: 1 addition & 4 deletions apps/trpc-app-e2e-playwright/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/trpc-app-e2e-playwright/**/*.{js,ts}"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
Expand Down
1 change: 1 addition & 0 deletions apps/trpc-app-e2e-playwright/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig(({ mode }) => {
return {
root: 'tests',
test: {
reporters: ['default'],
globals: true,
environment: 'node',
include: ['**/*.spec.ts'],
Expand Down
5 changes: 1 addition & 4 deletions apps/trpc-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/trpc-app/**/*.ts", "apps/trpc-app/**/*.html"]
}
"outputs": ["{options.outputFile}"]
},
"tests": {
"executor": "@nx/vite:test",
Expand Down
9 changes: 9 additions & 0 deletions apps/trpc-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: __dirname,
publicDir: 'src/public',
optimizeDeps: {
include: ['@angular/common', '@angular/forms', 'isomorphic-fetch'],
Expand All @@ -16,6 +17,9 @@ export default defineConfig(({ mode }) => {
noExternal: ['@analogjs/trpc', '@trpc/server'],
},
build: {
outDir: '../../dist/apps/trpc-app/client',
reportCompressedSize: true,
commonjsOptions: { transformMixedEsModules: true },
target: ['es2020'],
},
plugins: [
Expand All @@ -33,6 +37,11 @@ export default defineConfig(({ mode }) => {
splitVendorChunkPlugin(),
],
test: {
reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/apps/trpc-app',
provider: 'v8',
},
globals: true,
environment: 'jsdom',
setupFiles: ['src/test-setup.ts'],
Expand Down
5 changes: 1 addition & 4 deletions libs/card/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/card/**/*.ts", "libs/card/**/*.html"]
}
"outputs": ["{options.outputFile}"]
}
},
"implicitDependencies": ["vite-plugin-angular"]
Expand Down
2 changes: 2 additions & 0 deletions libs/card/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import angular from '@analogjs/vite-plugin-angular';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: __dirname,
plugins: [angular()],
test: {
reporters: ['default'],
globals: true,
environment: 'jsdom',
setupFiles: ['src/test-setup.ts'],
Expand Down
5 changes: 1 addition & 4 deletions libs/top-bar/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/top-bar/**/*.ts", "libs/top-bar/**/*.html"]
}
"outputs": ["{options.outputFile}"]
}
},
"tags": []
Expand Down
3 changes: 2 additions & 1 deletion libs/top-bar/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import angular from '@analogjs/vite-plugin-angular';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
root: 'src',
root: __dirname,
plugins: [angular()],
test: {
reporters: ['default'],
globals: true,
environment: 'jsdom',
setupFiles: ['src/test-setup.ts'],
Expand Down
9 changes: 3 additions & 6 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@
"serve": {
"dependsOn": ["^build"]
},
"cypress": {
"inputs": ["default", "^production"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"build-package": {
"cache": true
},
"build-package": {
"@nx/eslint:lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
}
},
Expand Down
Loading

0 comments on commit 180f358

Please sign in to comment.