diff --git a/.commitlintrc.json b/.commitlintrc.json index c30e5a9..f4fbb7d 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -1,3 +1,3 @@ { - "extends": ["@commitlint/config-conventional"] + "extends": ["@commitlint/config-conventional"] } diff --git a/.eslintrc.json b/.eslintrc.json index 06cc47d..12f3a13 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,35 +1,35 @@ { - "root": true, - "ignorePatterns": ["**/*"], - "plugins": ["@nrwl/nx"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": { - "@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": {} - } - ] + "root": true, + "ignorePatterns": ["**/*"], + "plugins": ["@nrwl/nx"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "@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": {} + } + ] } diff --git a/.prettierrc.json b/.prettierrc.json index a6d13f8..27140f2 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,5 @@ { - "semi": false, - "arrowParens": "always", - "trailingComma": "none" + "semi": false, + "arrowParens": "always", + "trailingComma": "none" } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 64553b1..b28ee79 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,8 @@ { - "recommendations": [ - "nrwl.angular-console", - "esbenp.prettier-vscode", - "firsttris.vscode-jest-runner", - "dbaeumer.vscode-eslint" - ] + "recommendations": [ + "nrwl.angular-console", + "esbenp.prettier-vscode", + "firsttris.vscode-jest-runner", + "dbaeumer.vscode-eslint" + ] } diff --git a/README.md b/README.md index 53ceda9..a7b9a66 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,18 @@ These capabilities include generating applications, libraries, etc as well as th Below are our core plugins: -- [React](https://reactjs.org) - - `npm install --save-dev @nrwl/react` -- Web (no framework frontends) - - `npm install --save-dev @nrwl/web` -- [Angular](https://angular.io) - - `npm install --save-dev @nrwl/angular` -- [Nest](https://nestjs.com) - - `npm install --save-dev @nrwl/nest` -- [Express](https://expressjs.com) - - `npm install --save-dev @nrwl/express` -- [Node](https://nodejs.org) - - `npm install --save-dev @nrwl/node` +- [React](https://reactjs.org) + - `npm install --save-dev @nrwl/react` +- Web (no framework frontends) + - `npm install --save-dev @nrwl/web` +- [Angular](https://angular.io) + - `npm install --save-dev @nrwl/angular` +- [Nest](https://nestjs.com) + - `npm install --save-dev @nrwl/nest` +- [Express](https://expressjs.com) + - `npm install --save-dev @nrwl/express` +- [Node](https://nodejs.org) + - `npm install --save-dev @nrwl/node` There are also many [community plugins](https://nx.dev/community) you could add. diff --git a/apps/admin-e2e/.eslintrc.json b/apps/admin-e2e/.eslintrc.json index 4c5989b..84a4be8 100644 --- a/apps/admin-e2e/.eslintrc.json +++ b/apps/admin-e2e/.eslintrc.json @@ -1,17 +1,17 @@ { - "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["src/plugins/index.js"], - "rules": { - "@typescript-eslint/no-var-requires": "off", - "no-undef": "off" - } - } - ] + "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["src/plugins/index.js"], + "rules": { + "@typescript-eslint/no-var-requires": "off", + "no-undef": "off" + } + } + ] } diff --git a/apps/admin-e2e/cypress.json b/apps/admin-e2e/cypress.json index 89ca513..a313ec6 100644 --- a/apps/admin-e2e/cypress.json +++ b/apps/admin-e2e/cypress.json @@ -1,12 +1,12 @@ { - "fileServerFolder": ".", - "fixturesFolder": "./src/fixtures", - "integrationFolder": "./src/integration", - "modifyObstructiveCode": false, - "supportFile": "./src/support/index.ts", - "pluginsFile": false, - "video": true, - "videosFolder": "../../dist/cypress/apps/admin-e2e/videos", - "screenshotsFolder": "../../dist/cypress/apps/admin-e2e/screenshots", - "chromeWebSecurity": false + "fileServerFolder": ".", + "fixturesFolder": "./src/fixtures", + "integrationFolder": "./src/integration", + "modifyObstructiveCode": false, + "supportFile": "./src/support/index.ts", + "pluginsFile": false, + "video": true, + "videosFolder": "../../dist/cypress/apps/admin-e2e/videos", + "screenshotsFolder": "../../dist/cypress/apps/admin-e2e/screenshots", + "chromeWebSecurity": false } diff --git a/apps/admin-e2e/project.json b/apps/admin-e2e/project.json index 3221401..ad8a7ec 100644 --- a/apps/admin-e2e/project.json +++ b/apps/admin-e2e/project.json @@ -1,28 +1,28 @@ { - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/admin-e2e/src", - "projectType": "application", - "targets": { - "e2e": { - "executor": "@nrwl/cypress:cypress", - "options": { - "cypressConfig": "apps/admin-e2e/cypress.json", - "devServerTarget": "admin:serve:development" - }, - "configurations": { - "production": { - "devServerTarget": "admin:serve:production" + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/admin-e2e/src", + "projectType": "application", + "targets": { + "e2e": { + "executor": "@nrwl/cypress:cypress", + "options": { + "cypressConfig": "apps/admin-e2e/cypress.json", + "devServerTarget": "admin:serve:development" + }, + "configurations": { + "production": { + "devServerTarget": "admin:serve:production" + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/admin-e2e/**/*.{js,ts}"] + } } - } }, - "lint": { - "executor": "@nrwl/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["apps/admin-e2e/**/*.{js,ts}"] - } - } - }, - "tags": [], - "implicitDependencies": ["admin"] + "tags": [], + "implicitDependencies": ["admin"] } diff --git a/apps/admin-e2e/src/fixtures/example.json b/apps/admin-e2e/src/fixtures/example.json index 294cbed..b132a94 100644 --- a/apps/admin-e2e/src/fixtures/example.json +++ b/apps/admin-e2e/src/fixtures/example.json @@ -1,4 +1,4 @@ { - "name": "Using fixtures to represent data", - "email": "hello@cypress.io" + "name": "Using fixtures to represent data", + "email": "hello@cypress.io" } diff --git a/apps/admin-e2e/src/integration/app.spec.ts b/apps/admin-e2e/src/integration/app.spec.ts index a7c1a6c..b50bb66 100644 --- a/apps/admin-e2e/src/integration/app.spec.ts +++ b/apps/admin-e2e/src/integration/app.spec.ts @@ -1,13 +1,13 @@ -import { getGreeting } from '../support/app.po'; +import { getGreeting } from "../support/app.po" -describe('admin', () => { - beforeEach(() => cy.visit('/')); +describe("admin", () => { + beforeEach(() => cy.visit("/")) - it('should display welcome message', () => { - // Custom command example, see `../support/commands.ts` file - cy.login('my-email@something.com', 'myPassword'); + it("should display welcome message", () => { + // Custom command example, see `../support/commands.ts` file + cy.login("my-email@something.com", "myPassword") - // Function helper example, see `../support/app.po.ts` file - getGreeting().contains('Welcome admin'); - }); -}); + // Function helper example, see `../support/app.po.ts` file + getGreeting().contains("Welcome admin") + }) +}) diff --git a/apps/admin-e2e/src/support/app.po.ts b/apps/admin-e2e/src/support/app.po.ts index 3293424..a324a13 100644 --- a/apps/admin-e2e/src/support/app.po.ts +++ b/apps/admin-e2e/src/support/app.po.ts @@ -1 +1 @@ -export const getGreeting = () => cy.get('h1'); +export const getGreeting = () => cy.get("h1") diff --git a/apps/admin-e2e/src/support/commands.ts b/apps/admin-e2e/src/support/commands.ts index 310f1fa..d1d0fed 100644 --- a/apps/admin-e2e/src/support/commands.ts +++ b/apps/admin-e2e/src/support/commands.ts @@ -10,16 +10,16 @@ // eslint-disable-next-line @typescript-eslint/no-namespace declare namespace Cypress { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface Chainable { - login(email: string, password: string): void; - } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface Chainable { + login(email: string, password: string): void + } } // // -- This is a parent command -- -Cypress.Commands.add('login', (email, password) => { - console.log('Custom command example: Login', email, password); -}); +Cypress.Commands.add("login", (email, password) => { + console.log("Custom command example: Login", email, password) +}) // // -- This is a child command -- // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) diff --git a/apps/admin-e2e/src/support/index.ts b/apps/admin-e2e/src/support/index.ts index 3d469a6..17b760c 100644 --- a/apps/admin-e2e/src/support/index.ts +++ b/apps/admin-e2e/src/support/index.ts @@ -14,4 +14,4 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands'; +import "./commands" diff --git a/apps/admin-e2e/tsconfig.json b/apps/admin-e2e/tsconfig.json index c4f818e..e20e2ba 100644 --- a/apps/admin-e2e/tsconfig.json +++ b/apps/admin-e2e/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "sourceMap": false, - "outDir": "../../dist/out-tsc", - "allowJs": true, - "types": ["cypress", "node"] - }, - "include": ["src/**/*.ts", "src/**/*.js"] + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "sourceMap": false, + "outDir": "../../dist/out-tsc", + "allowJs": true, + "types": ["cypress", "node"] + }, + "include": ["src/**/*.ts", "src/**/*.js"] } diff --git a/apps/admin/.babelrc b/apps/admin/.babelrc index 61641ec..f0aa1cb 100644 --- a/apps/admin/.babelrc +++ b/apps/admin/.babelrc @@ -1,11 +1,11 @@ { - "presets": [ - [ - "@nrwl/react/babel", - { - "runtime": "automatic" - } - ] - ], - "plugins": [] + "presets": [ + [ + "@nrwl/react/babel", + { + "runtime": "automatic" + } + ] + ], + "plugins": [] } diff --git a/apps/admin/.eslintrc.json b/apps/admin/.eslintrc.json index 734ddac..1f5ec76 100644 --- a/apps/admin/.eslintrc.json +++ b/apps/admin/.eslintrc.json @@ -1,18 +1,18 @@ { - "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] + "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] } diff --git a/apps/admin/jest.config.ts b/apps/admin/jest.config.ts index 0a35fbb..4276117 100644 --- a/apps/admin/jest.config.ts +++ b/apps/admin/jest.config.ts @@ -1,11 +1,11 @@ /* eslint-disable */ export default { - displayName: 'admin', - preset: '../../jest.preset.js', - transform: { - '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest', - '^.+\\.[tj]sx?$': 'babel-jest', - }, - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], - coverageDirectory: '../../coverage/apps/admin', -}; + displayName: "admin", + preset: "../../jest.preset.js", + transform: { + "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest", + "^.+\\.[tj]sx?$": "babel-jest" + }, + moduleFileExtensions: ["ts", "tsx", "js", "jsx"], + coverageDirectory: "../../coverage/apps/admin" +} diff --git a/apps/admin/project.json b/apps/admin/project.json index 4eb1101..864a47b 100644 --- a/apps/admin/project.json +++ b/apps/admin/project.json @@ -1,80 +1,83 @@ { - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/admin/src", - "projectType": "application", - "targets": { - "build": { - "executor": "@nrwl/web:webpack", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "compiler": "babel", - "outputPath": "dist/apps/admin", - "index": "apps/admin/src/index.html", - "baseHref": "/", - "main": "apps/admin/src/main.tsx", - "polyfills": "apps/admin/src/polyfills.ts", - "tsConfig": "apps/admin/tsconfig.app.json", - "assets": ["apps/admin/src/favicon.ico", "apps/admin/src/assets"], - "styles": [], - "scripts": [], - "webpackConfig": "@nrwl/react/plugins/webpack" - }, - "configurations": { - "development": { - "extractLicenses": false, - "optimization": false, - "sourceMap": true, - "vendorChunk": true - }, - "production": { - "fileReplacements": [ - { - "replace": "apps/admin/src/environments/environment.ts", - "with": "apps/admin/src/environments/environment.prod.ts" + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "apps/admin/src", + "projectType": "application", + "targets": { + "build": { + "executor": "@nrwl/web:webpack", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "production", + "options": { + "compiler": "babel", + "outputPath": "dist/apps/admin", + "index": "apps/admin/src/index.html", + "baseHref": "/", + "main": "apps/admin/src/main.tsx", + "polyfills": "apps/admin/src/polyfills.ts", + "tsConfig": "apps/admin/tsconfig.app.json", + "assets": [ + "apps/admin/src/favicon.ico", + "apps/admin/src/assets" + ], + "styles": [], + "scripts": [], + "webpackConfig": "@nrwl/react/plugins/webpack" + }, + "configurations": { + "development": { + "extractLicenses": false, + "optimization": false, + "sourceMap": true, + "vendorChunk": true + }, + "production": { + "fileReplacements": [ + { + "replace": "apps/admin/src/environments/environment.ts", + "with": "apps/admin/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false + } } - ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false - } - } - }, - "serve": { - "executor": "@nrwl/web:dev-server", - "defaultConfiguration": "development", - "options": { - "buildTarget": "admin:build", - "hmr": true - }, - "configurations": { - "development": { - "buildTarget": "admin:build:development" }, - "production": { - "buildTarget": "admin:build:production", - "hmr": false + "serve": { + "executor": "@nrwl/web:dev-server", + "defaultConfiguration": "development", + "options": { + "buildTarget": "admin:build", + "hmr": true + }, + "configurations": { + "development": { + "buildTarget": "admin:build:development" + }, + "production": { + "buildTarget": "admin:build:production", + "hmr": false + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/admin/**/*.{ts,tsx,js,jsx}"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/apps/admin"], + "options": { + "jestConfig": "apps/admin/jest.config.ts", + "passWithNoTests": true + } } - } }, - "lint": { - "executor": "@nrwl/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["apps/admin/**/*.{ts,tsx,js,jsx}"] - } - }, - "test": { - "executor": "@nrwl/jest:jest", - "outputs": ["coverage/apps/admin"], - "options": { - "jestConfig": "apps/admin/jest.config.ts", - "passWithNoTests": true - } - } - }, - "tags": [] + "tags": [] } diff --git a/apps/admin/src/app/app.spec.tsx b/apps/admin/src/app/app.spec.tsx index 518e5fa..49367bb 100644 --- a/apps/admin/src/app/app.spec.tsx +++ b/apps/admin/src/app/app.spec.tsx @@ -1,27 +1,27 @@ -import { render } from '@testing-library/react'; +import { render } from "@testing-library/react" -import { BrowserRouter } from 'react-router-dom'; +import { BrowserRouter } from "react-router-dom" -import App from './app'; +import App from "./app" -describe('App', () => { - it('should render successfully', () => { - const { baseElement } = render( - - - - ); +describe("App", () => { + it("should render successfully", () => { + const { baseElement } = render( + + + + ) - expect(baseElement).toBeTruthy(); - }); + expect(baseElement).toBeTruthy() + }) - it('should have a greeting as the title', () => { - const { getByText } = render( - - - - ); + it("should have a greeting as the title", () => { + const { getByText } = render( + + + + ) - expect(getByText(/Welcome admin/gi)).toBeTruthy(); - }); -}); + expect(getByText(/Welcome admin/gi)).toBeTruthy() + }) +}) diff --git a/apps/admin/src/app/app.tsx b/apps/admin/src/app/app.tsx index ceaca33..c17d931 100644 --- a/apps/admin/src/app/app.tsx +++ b/apps/admin/src/app/app.tsx @@ -1,51 +1,53 @@ -import NxWelcome from './nx-welcome'; +import NxWelcome from "./nx-welcome" -import { Route, Routes, Link } from 'react-router-dom'; +import { Route, Routes, Link } from "react-router-dom" export function App() { - return ( - <> - -
+ return ( + <> + +
- {/* START: routes */} - {/* These routes and navigation have been generated for you */} - {/* Feel free to move and update them to fit your needs */} -
-
-
-
-
    -
  • - Home -
  • -
  • - Page 2 -
  • -
-
- - - This is the generated root route.{' '} - Click here for page 2. + {/* START: routes */} + {/* These routes and navigation have been generated for you */} + {/* Feel free to move and update them to fit your needs */} +
+
+
+
+
    +
  • + Home +
  • +
  • + Page 2 +
  • +
- } - /> - - Click here to go back to root page. -
- } - /> - - {/* END: routes */} - - ); + + + This is the generated root route.{" "} + Click here for page 2. +
+ } + /> + + + Click here to go back to root page. + + + } + /> + + {/* END: routes */} + + ) } -export default App; +export default App diff --git a/apps/admin/src/app/nx-welcome.tsx b/apps/admin/src/app/nx-welcome.tsx index 6278272..382b466 100644 --- a/apps/admin/src/app/nx-welcome.tsx +++ b/apps/admin/src/app/nx-welcome.tsx @@ -6,11 +6,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ export function NxWelcome({ title }: { title: string }) { - return ( - <> -