Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx 15 #224

Merged
merged 13 commits into from
Oct 25, 2023
Merged

Nx 15 #224

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// @ts-check
const { defineConfig } = require('eslint-define-config');

// Disable this annoying red lines under unformatted code
// if there is prettier extensions installed
let prettierExtension = process.env.VSCODE_CWD;

module.exports = defineConfig({
root: true,
ignorePatterns: ['**/*'],
extends: [
prettierExtension
? 'eslint-config-prettier'
: 'plugin:prettier/recommended',
'airbnb',
'airbnb/hooks',
'airbnb-typescript',
'plugin:jest/recommended',
'plugin:testing-library/react',
],
plugins: [
'@nrwl/nx',
prettierExtension ? '' : 'prettier',
'formatjs',
'jest',
'testing-library',
].filter(Boolean),
parserOptions: {
project: './tsconfig.base.json',
},
overrides: [
{
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
rules: {
...(prettierExtension
? {}
: {
'prettier/prettier': [
'error',
{
endOfLine: 'crlf',
},
],
}),
'@nrwl/nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
},
],
},
},
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@nrwl/nx/typescript'],
rules: {},
},
{
files: ['*.js', '*.jsx'],
extends: ['plugin:@nrwl/nx/javascript'],
rules: {},
},
],
rules: {
'@typescript-eslint/ban-types': 'warn',
'class-methods-use-this': 'off',
'formatjs/no-offset': 'error',
'import/no-cycle': 'off',
'import/prefer-default-export': 'off',
'react/jsx-props-no-spreading': 'off',
'react/react-in-jsx-scope': 'off',
'import/no-extraneous-dependencies': 'warn',
},
});
62 changes: 0 additions & 62 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion apps/client-server/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc.json"],
"extends": ["../../.eslintrc.js"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
13 changes: 7 additions & 6 deletions apps/client-server/jest.config.ts
Original file line number Diff line number Diff line change
@@ -2,14 +2,15 @@
export default {
displayName: 'client-server',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': 'ts-jest',
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/apps/client-server',
57 changes: 57 additions & 0 deletions apps/client-server/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "client-server",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/client-server/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/client-server",
"main": "apps/client-server/src/main.ts",
"tsConfig": "apps/client-server/tsconfig.app.json",
"assets": ["apps/client-server/src/assets"],
"target": "node",
"compiler": "tsc"
},
"configurations": {
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/client-server/src/environments/environment.ts",
"with": "apps/client-server/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/node:node",
"options": {
"buildTarget": "client-server:build",
"inspect": true,
"port": 9229
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/client-server/**/*.ts"]
},
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/client-server"],
"options": {
"jestConfig": "apps/client-server/jest.config.ts",
"passWithNoTests": true
}
}
},
"tags": []
}
18 changes: 9 additions & 9 deletions apps/postybirb-ui/.browserslistrc
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@
# 1. autoprefixer to adjust CSS to support the below specified browsers
# 2. babel preset-env to adjust included polyfills
#
# Run
# npx browserslist
# in apps/postybirb-ui to verify that all is OK
#
# Direct Chrome version should be set from
# https://releases.electronjs.org/releases/stable
# according to electron version in package.json
#
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# If you need to support different browsers in production, you may tweak the list below.

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
Chrome 112
2 changes: 1 addition & 1 deletion apps/postybirb-ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.js"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
82 changes: 82 additions & 0 deletions apps/postybirb-ui/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "postybirb-ui",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/postybirb-ui/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/postybirb-ui",
"index": "apps/postybirb-ui/src/index.html",
"baseHref": "/",
"main": "apps/postybirb-ui/src/main.tsx",
"polyfills": "apps/postybirb-ui/src/polyfills.ts",
"tsConfig": "apps/postybirb-ui/tsconfig.app.json",
"assets": ["apps/postybirb-ui/src/assets"],
"styles": ["apps/postybirb-ui/src/styles.css"],
"scripts": [],
"webpackConfig": "apps/postybirb-ui/webpack.config.js",
"isolatedConfig": true
},
"configurations": {
"development": {
"extractLicenses": false,
"optimization": false,
"sourceMap": true,
"vendorChunk": true
},
"production": {
"fileReplacements": [
{
"replace": "apps/postybirb-ui/src/environments/environment.ts",
"with": "apps/postybirb-ui/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false
}
}
},
"serve": {
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "postybirb-ui:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "postybirb-ui:build:development"
},
"production": {
"buildTarget": "postybirb-ui:build:production",
"hmr": false
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/postybirb-ui/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/postybirb-ui"],
"options": {
"jestConfig": "apps/postybirb-ui/jest.config.ts",
"passWithNoTests": true
}
}
},
"tags": []
}
3 changes: 1 addition & 2 deletions apps/postybirb-ui/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -3,14 +3,13 @@ const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind');
const { join } = require('path');

module.exports = {
purge: [
content: [
join(__dirname, 'src/**/*.{js,ts,jsx,tsx}'),
...createGlobPatternsForDependencies(__dirname),
],
corePlugins: {
preflight: false,
},
content: [],
theme: {
extend: {},
},
17 changes: 17 additions & 0 deletions apps/postybirb-ui/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable */

const { composePlugins, withNx } = require('@nrwl/webpack');
const { withReact } = require('@nrwl/react');

// Nx plugins for webpack.
module.exports = composePlugins(
withNx(),
withReact(),
(config, { options, context }) => {
// Update the webpack config as needed here.
// e.g. config.plugins.push(new MyPlugin())
// For more information on webpack config and Nx see:
// https://nx.dev/packages/webpack/documents/webpack-config-setup
return config;
}
);
2 changes: 1 addition & 1 deletion apps/postybirb/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../.eslintrc.json",
"extends": "../../.eslintrc.js",
"ignorePatterns": ["!**/*"],
"overrides": [
{
Loading