Skip to content

Commit

Permalink
build(dictionary): generate react project for dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-plahn committed Jan 7, 2022
1 parent 47d170d commit 182320f
Show file tree
Hide file tree
Showing 32 changed files with 32,412 additions and 17,166 deletions.
134 changes: 102 additions & 32 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,107 @@
}
}
},
"tng-dictionary": {
"root": "apps/tng-dictionary",
"sourceRoot": "apps/tng-dictionary/src",
"projectType": "application",
"architect": {
"build": {
"builder": "@nrwl/web:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/tng-dictionary",
"index": "apps/tng-dictionary/src/index.html",
"baseHref": "/",
"main": "apps/tng-dictionary/src/main.tsx",
"polyfills": "apps/tng-dictionary/src/polyfills.ts",
"tsConfig": "apps/tng-dictionary/tsconfig.app.json",
"assets": [
"apps/tng-dictionary/src/favicon.ico",
"apps/tng-dictionary/src/assets"
],
"styles": ["apps/tng-dictionary/src/styles.css"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/tng-dictionary/src/environments/environment.ts",
"with": "apps/tng-dictionary/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false
}
}
},
"serve": {
"builder": "@nrwl/web:dev-server",
"options": {
"buildTarget": "tng-dictionary:build",
"hmr": true
},
"configurations": {
"production": {
"buildTarget": "tng-dictionary:build:production",
"hmr": false
}
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/tng-dictionary/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": ["coverage/apps/tng-dictionary"],
"options": {
"jestConfig": "apps/tng-dictionary/jest.config.js",
"passWithNoTests": true
}
}
},
"tags": []
},
"tng-dictionary-e2e": {
"root": "apps/tng-dictionary-e2e",
"sourceRoot": "apps/tng-dictionary-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/tng-dictionary-e2e/cypress.json",
"devServerTarget": "tng-dictionary:serve"
},
"configurations": {
"production": {
"devServerTarget": "tng-dictionary:serve:production"
}
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/tng-dictionary-e2e/**/*.{js,ts}"]
}
}
},
"tags": [],
"implicitDependencies": ["tng-dictionary"]
},
"tw-research": {
"projectType": "application",
"root": "apps/tw-research",
Expand Down Expand Up @@ -185,36 +286,5 @@
}
}
}
},
"cli": {
"defaultCollection": "@nrwl/angular"
},
"schematics": {
"@nrwl/angular": {
"application": {
"linter": "eslint"
},
"library": {
"linter": "eslint"
},
"storybook-configuration": {
"linter": "eslint"
}
},
"@nrwl/angular:application": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nrwl/angular:component": {
"style": "css"
}
},
"defaultProject": "tw-research"
}
}
10 changes: 10 additions & 0 deletions apps/tng-dictionary-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}
12 changes: 12 additions & 0 deletions apps/tng-dictionary-e2e/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"supportFile": "./src/support/index.ts",
"pluginsFile": false,
"video": true,
"videosFolder": "../../dist/cypress/apps/tng-dictionary-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/tng-dictionary-e2e/screenshots",
"chromeWebSecurity": false
}
4 changes: 4 additions & 0 deletions apps/tng-dictionary-e2e/src/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]"
}
13 changes: 13 additions & 0 deletions apps/tng-dictionary-e2e/src/integration/app.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('tng-dictionary', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('[email protected]', 'myPassword');

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Welcome tng-dictionary');
});
});
1 change: 1 addition & 0 deletions apps/tng-dictionary-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('h1');
33 changes: 33 additions & 0 deletions apps/tng-dictionary-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
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);
});
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions apps/tng-dictionary-e2e/src/support/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';
10 changes: 10 additions & 0 deletions apps/tng-dictionary-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js"]
}
11 changes: 11 additions & 0 deletions apps/tng-dictionary/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic"
}
]
],
"plugins": []
}
16 changes: 16 additions & 0 deletions apps/tng-dictionary/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is used by:
# 1. autoprefixer to adjust CSS to support the below specified browsers
# 2. babel preset-env to adjust included polyfills
#
# 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'.
18 changes: 18 additions & 0 deletions apps/tng-dictionary/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +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": {}
}
]
}
10 changes: 10 additions & 0 deletions apps/tng-dictionary/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
displayName: 'tng-dictionary',
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/tng-dictionary',
};
1 change: 1 addition & 0 deletions apps/tng-dictionary/src/app/app.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Your styles goes here. */
17 changes: 17 additions & 0 deletions apps/tng-dictionary/src/app/app.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { render } from '@testing-library/react';

import App from './app';

describe('App', () => {
it('should render successfully', () => {
const { baseElement } = render(<App />);

expect(baseElement).toBeTruthy();
});

it('should have a greeting as the title', () => {
const { getByText } = render(<App />);

expect(getByText(/Welcome tng-dictionary/gi)).toBeTruthy();
});
});
13 changes: 13 additions & 0 deletions apps/tng-dictionary/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import styles from './app.module.css';
import NxWelcome from './nx-welcome';

export function App() {
return (
<>
<NxWelcome title="tng-dictionary" />
<div />
</>
);
}

export default App;
Loading

0 comments on commit 182320f

Please sign in to comment.