Skip to content

Commit

Permalink
chore: nx upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed May 8, 2023
1 parent b2a6c54 commit afeb6aa
Show file tree
Hide file tree
Showing 64 changed files with 4,628 additions and 5,174 deletions.
28 changes: 22 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx", "prettier", "prefer-arrow"],
"plugins": ["@nx", "prettier", "prefer-arrow"],
"rules": {},
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -24,7 +24,7 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript", "airbnb", "airbnb-typescript", "next", "prettier"],
"extends": ["plugin:@nx/typescript", "airbnb", "airbnb-typescript", "next", "prettier"],
"rules": {
"prefer-arrow/prefer-arrow-functions": [
"error",
Expand All @@ -34,8 +34,19 @@
"classPropertiesAllowed": false
}
],
"prefer-arrow-callback": ["error", { "allowNamedFunctions": true }],
"func-style": ["error", "expression", { "allowArrowFunctions": true }],
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": true
}
],
"func-style": [
"error",
"expression",
{
"allowArrowFunctions": true
}
],
"react/prop-types": "off",
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
Expand All @@ -61,7 +72,12 @@
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib",

"tailwindCSS.experimental.configFile": "apps/trialanderror.org/tailwind.config.cjs",
"exportall.config.folderListener": ["/libs/types/src/lib/github", "/libs/types/src/lib"],
"appService.defaultWebAppToDeploy": "/subscriptions/3d4dfc68-39d1-4d8e-81d5-b59ee8d8cd36/microsoft.web/sites/subscriptions/3d4dfc68-39d1-4d8e-81d5-b59ee8d8cd36/resourceGroups/centeroftrialanderror.com/providers/Microsoft.Web/sites/cote-strapi",
"appService.deploySubpath": "apps/strapi",
"exportall.config.relExclusion": ["/libs/types/src/lib/validators.ts"]
"exportall.config.relExclusion": ["/libs/types/src/lib/validators.ts"],
"eslint.validate": ["json"]
}
12 changes: 6 additions & 6 deletions apps/blog-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defineConfig } from 'cypress'
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'

export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
/**
* TODO(@nrwl/cypress): In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
* TODO(@nx/cypress): In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
},
})
4 changes: 2 additions & 2 deletions apps/blog-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/blog-e2e/cypress.config.ts",
"devServerTarget": "blog:dev",
"testingType": "e2e"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/blog-e2e/**/*.{js,ts}"]
Expand Down
9 changes: 5 additions & 4 deletions apps/blog/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"name": "blog",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/blog/src",
"targets": {
"build": {
"outputs": ["dist/apps/blog"],
"outputs": [
"dist/apps/blog"
],
"executor": "@nxtensions/astro:build",
"options": {
"config": "astro.config.ts"
Expand All @@ -18,8 +20,7 @@
"preview": {
"dependsOn": [
{
"target": "build",
"projects": "self"
"target": "build"
}
],
"executor": "@nxtensions/astro:preview",
Expand Down
2 changes: 1 addition & 1 deletion apps/email/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:@nrwl/nx/react-typescript",
"plugin:@nx/react-typescript",
"next",
"next/core-web-vitals",
"../../.eslintrc.json"
Expand Down
6 changes: 3 additions & 3 deletions apps/email/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ export default {
displayName: 'trialanderror.org',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/trialanderror.org',
}
};
4 changes: 2 additions & 2 deletions apps/email/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"command": "pnpm exec email dev --dir apps/email/emails"
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/email/jest.config.ts",
"passWithNoTests": true
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/email/**/*.{ts,tsx,js,jsx}"]
Expand Down
56 changes: 28 additions & 28 deletions apps/email/tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// @ts-check
const { createGlobPatternsForDependencies } = require("@nrwl/react/tailwind")
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');

const { join } = require("path")
const defaultTheme = require("tailwindcss/defaultTheme")
const { join } = require('path');
const defaultTheme = require('tailwindcss/defaultTheme');

/**
* @type {import('tailwindcss').Config}
*/
module.exports = {
darkMode: "class",
darkMode: 'class',
// presets: [require("../../tailwind-workspace-preset.js")],
content: [
join(__dirname, "**/*!(*.stories|*.spec).{ts,tsx,html}"),
join(__dirname, '**/*!(*.stories|*.spec).{ts,tsx,html}'),
...createGlobPatternsForDependencies(__dirname),
],
theme: {
Expand All @@ -20,7 +20,7 @@ module.exports = {
},
extend: {
fontFamily: {
sans: ["var(--font-open-sans)", ...defaultTheme.fontFamily.sans],
sans: ['var(--font-open-sans)', ...defaultTheme.fontFamily.sans],
},
boxShadow: {
'thick-1': '2px 2px 0 #000',
Expand All @@ -32,31 +32,31 @@ module.exports = {
},
colors: {
orange: {
50: "#ffe13e",
100: "#ffd734",
200: "#ffcd2a",
300: "#ffc320",
400: "#ffb916",
500: "#ffaf0c",
600: "#f5a502",
700: "#eb9b00",
800: "#e19100",
900: "#d78700",
50: '#ffe13e',
100: '#ffd734',
200: '#ffcd2a',
300: '#ffc320',
400: '#ffb916',
500: '#ffaf0c',
600: '#f5a502',
700: '#eb9b00',
800: '#e19100',
900: '#d78700',
},
blue: {
50: "#dfe4ea",
100: "#284e6a",
200: "#1e4460",
300: "#143a56",
400: "#0a304c",
500: "#002642",
600: "#001c38",
700: "#00122e",
800: "#000824",
900: "#00001a",
50: '#dfe4ea',
100: '#284e6a',
200: '#1e4460',
300: '#143a56',
400: '#0a304c',
500: '#002642',
600: '#001c38',
700: '#00122e',
800: '#000824',
900: '#00001a',
},
},
},
},
plugins: [require("@tailwindcss/typography"), require("@tailwindcss/forms")],
}
plugins: [require('@tailwindcss/typography'), require('@tailwindcss/forms')],
};
2 changes: 1 addition & 1 deletion apps/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:@nrwl/nx/react-typescript",
"plugin:@nx/react-typescript",
"next",
"next/core-web-vitals",
"../../.eslintrc.json"
Expand Down
22 changes: 11 additions & 11 deletions apps/frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
const config = {
displayName: 'thesis',
preset: '../../jest.preset.ts',
displayName: "thesis",
preset: "../../jest.preset.ts",
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
useESM: true,
},
},
testEnvironment: 'node',
testEnvironment: "node",
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['@swc/jest'],
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nx/react/plugins/jest",
"^.+\\.[tj]sx?$": ["@swc/jest"],
},
transformIgnorePatterns: [],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/thesis',
extensionsToTreatAsEsm: ['.ts'],
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
coverageDirectory: "../../coverage/apps/thesis",
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
"^(\\.{1,2}/.*)\\.js$": "$1",
},
}

Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const withNx = require("@nrwl/next/plugins/with-nx")
const withNx = require("@nx/next/plugins/with-nx")

// const withBundleAnalyzer = require("@next/bundle-analyzer")({
// enabled: process.env.ANALYZE === "true",
Expand Down
10 changes: 5 additions & 5 deletions apps/frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/next:build",
"executor": "@nx/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
Expand All @@ -19,7 +19,7 @@
}
},
"serve": {
"executor": "@nrwl/next:server",
"executor": "@nx/next:server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "frontend:build",
Expand All @@ -37,21 +37,21 @@
}
},
"export": {
"executor": "@nrwl/next:export",
"executor": "@nx/next:export",
"options": {
"buildTarget": "frontend:build:production"
}
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["coverage/apps/frontend"],
"options": {
"jestConfig": "apps/frontend/jest.config.js",
"passWithNoTests": true
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/frontend/**/*.{ts,tsx,js,jsx}"]
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { createGlobPatternsForDependencies } = require("@nrwl/react/tailwind")
const { createGlobPatternsForDependencies } = require("@nx/react/tailwind")

const { join } = require("path")

Expand Down
2 changes: 1 addition & 1 deletion apps/og/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:@nrwl/nx/react-typescript",
"plugin:@nx/react-typescript",
"next",
"next/core-web-vitals",
"../../.eslintrc.json"
Expand Down
6 changes: 3 additions & 3 deletions apps/og/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ export default {
displayName: 'og',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/og',
}
};
Loading

0 comments on commit afeb6aa

Please sign in to comment.