-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65776cc
commit bd79aae
Showing
35 changed files
with
516 additions
and
30,979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/grocery-list-e2e/videos", | ||
"screenshotsFolder": "../../dist/cypress/apps/grocery-list-e2e/screenshots", | ||
"chromeWebSecurity": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/grocery-list-e2e/src", | ||
"projectType": "application", | ||
"targets": { | ||
"e2e": { | ||
"executor": "@nrwl/cypress:cypress", | ||
"options": { | ||
"cypressConfig": "apps/grocery-list-e2e/cypress.json", | ||
"devServerTarget": "grocery-list:serve:development", | ||
"testingType": "e2e" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"devServerTarget": "grocery-list:serve:production" | ||
} | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nrwl/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["apps/grocery-list-e2e/**/*.{js,ts}"] | ||
} | ||
} | ||
}, | ||
"tags": [], | ||
"implicitDependencies": ["grocery-list"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { getGreeting } from '../support/app.po'; | ||
|
||
describe('grocery-list', () => { | ||
beforeEach(() => cy.visit('/')); | ||
|
||
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 grocery-list'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const getGreeting = () => cy.get('h1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => { ... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// *********************************************************** | ||
// This example support/index.ts 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.ts using ES2015 syntax: | ||
import './commands'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@nrwl/react/babel", | ||
{ | ||
"runtime": "automatic" | ||
} | ||
] | ||
], | ||
"plugins": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'grocery-list', | ||
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/grocery-list', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/grocery-list/src", | ||
"projectType": "application", | ||
"targets": { | ||
"build": { | ||
"executor": "@nrwl/web:webpack", | ||
"outputs": ["{options.outputPath}"], | ||
"defaultConfiguration": "production", | ||
"options": { | ||
"compiler": "babel", | ||
"outputPath": "dist/apps/grocery-list", | ||
"index": "apps/grocery-list/src/index.html", | ||
"baseHref": "/", | ||
"main": "apps/grocery-list/src/main.tsx", | ||
"polyfills": "apps/grocery-list/src/polyfills.ts", | ||
"tsConfig": "apps/grocery-list/tsconfig.app.json", | ||
"assets": [ | ||
"apps/grocery-list/src/favicon.ico", | ||
"apps/grocery-list/src/assets" | ||
], | ||
"styles": ["apps/grocery-list/src/styles.scss"], | ||
"scripts": [], | ||
"webpackConfig": "@nrwl/react/plugins/webpack" | ||
}, | ||
"configurations": { | ||
"development": { | ||
"extractLicenses": false, | ||
"optimization": false, | ||
"sourceMap": true, | ||
"vendorChunk": true | ||
}, | ||
"production": { | ||
"fileReplacements": [ | ||
{ | ||
"replace": "apps/grocery-list/src/environments/environment.ts", | ||
"with": "apps/grocery-list/src/environments/environment.prod.ts" | ||
} | ||
], | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": false | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"executor": "@nrwl/web:dev-server", | ||
"defaultConfiguration": "development", | ||
"options": { | ||
"buildTarget": "grocery-list:build", | ||
"hmr": true | ||
}, | ||
"configurations": { | ||
"development": { | ||
"buildTarget": "grocery-list:build:development" | ||
}, | ||
"production": { | ||
"buildTarget": "grocery-list:build:production", | ||
"hmr": false | ||
} | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nrwl/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["apps/grocery-list/**/*.{ts,tsx,js,jsx}"] | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nrwl/jest:jest", | ||
"outputs": ["coverage/apps/grocery-list"], | ||
"options": { | ||
"jestConfig": "apps/grocery-list/jest.config.ts", | ||
"passWithNoTests": true | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* Your styles goes here. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 grocery-list/gi)).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import styles from './app.module.scss'; | ||
import GroceryList from './components/GroceryList'; | ||
import Header from './components/Header/Header'; | ||
|
||
export function App() { | ||
return ( | ||
<> | ||
<Header /> | ||
<GroceryList /> | ||
<div /> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function GroceryList() { | ||
return ( | ||
<main> | ||
Hello World | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import styles from './header.module.scss'; | ||
|
||
export default function Header(): React.ReactElement { | ||
return ( | ||
<header className={styles['headerContainer']}> | ||
<h1>Grocery List</h1> | ||
<input className={styles['searchInput']} type="text" placeholder="Search" /> | ||
</header> | ||
) | ||
} |
15 changes: 15 additions & 0 deletions
15
apps/grocery-list/src/app/components/Header/header.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.headerContainer { | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
h1 { | ||
margin-left: 2rem; | ||
} | ||
} | ||
|
||
.searchInput { | ||
height: 2rem; | ||
border-radius: 1rem; | ||
padding: .5rem; | ||
margin-right: 2rem; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const environment = { | ||
production: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// This file can be replaced during build by using the `fileReplacements` array. | ||
// When building for production, this file is replaced with `environment.prod.ts`. | ||
|
||
export const environment = { | ||
production: false, | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>GroceryList</title> | ||
<base href="/" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { StrictMode } from 'react'; | ||
import * as ReactDOM from 'react-dom/client'; | ||
|
||
import App from './app/app'; | ||
|
||
const root = ReactDOM.createRoot( | ||
document.getElementById('root') as HTMLElement | ||
); | ||
root.render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode> | ||
); |
Oops, something went wrong.