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

feat(core): adds nx cloud #23

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions apps/react-cookie-service-example-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": {}
}
]
}
8 changes: 8 additions & 0 deletions apps/react-cookie-service-example-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';

export default defineConfig({
e2e: nxE2EPreset(__dirname, {
bundler: 'vite',
}),
});
33 changes: 33 additions & 0 deletions apps/react-cookie-service-example-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "react-cookie-service-example-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/react-cookie-service-example-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/react-cookie-service-example-e2e/cypress.config.ts",
"devServerTarget": "react-cookie-service-example:serve:development",
"testingType": "e2e"
},
"configurations": {
"production": {
"devServerTarget": "react-cookie-service-example:serve:production"
},
"ci": {
"devServerTarget": "react-cookie-service-example:serve-static"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/react-cookie-service-example-e2e/**/*.{js,ts}"]
}
}
},
"tags": [],
"implicitDependencies": ["react-cookie-service-example"]
}
13 changes: 13 additions & 0 deletions apps/react-cookie-service-example-e2e/src/e2e/app.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('react-cookie-service-example', () => {
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 react-cookie-service-example');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io"
}
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/react-cookie-service-example-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/react-cookie-service-example-e2e/src/support/e2e.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/react-cookie-service-example-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", "cypress.config.ts"]
}
18 changes: 18 additions & 0 deletions apps/react-cookie-service-example/.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": {}
}
]
}
16 changes: 16 additions & 0 deletions apps/react-cookie-service-example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>ReactCookieServiceExample</title>
<base href="/" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="/src/styles.scss" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
78 changes: 78 additions & 0 deletions apps/react-cookie-service-example/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "react-cookie-service-example",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/react-cookie-service-example/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/react-cookie-service-example"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
},
"serve": {
"executor": "@nrwl/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "react-cookie-service-example:build"
},
"configurations": {
"development": {
"buildTarget": "react-cookie-service-example:build:development",
"hmr": true
},
"production": {
"buildTarget": "react-cookie-service-example:build:production",
"hmr": false
}
}
},
"preview": {
"executor": "@nrwl/vite:preview-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "react-cookie-service-example:build"
},
"configurations": {
"development": {
"buildTarget": "react-cookie-service-example:build:development"
},
"production": {
"buildTarget": "react-cookie-service-example:build:production"
}
}
},
"test": {
"executor": "@nrwl/vite:test",
"outputs": ["coverage/apps/react-cookie-service-example"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/react-cookie-service-example"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/react-cookie-service-example/**/*.{ts,tsx,js,jsx}"]
}
},
"serve-static": {
"executor": "@nrwl/web:file-server",
"options": {
"buildTarget": "react-cookie-service-example:build"
}
}
},
"tags": []
}
Binary file not shown.
1 change: 1 addition & 0 deletions apps/react-cookie-service-example/src/app/app.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Your styles goes here. */
25 changes: 25 additions & 0 deletions apps/react-cookie-service-example/src/app/app.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { render } from '@testing-library/react';

import { BrowserRouter } from 'react-router-dom';

import App from './app';

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

it('should have a greeting as the title', () => {
const { getByText } = render(
<BrowserRouter>
<App />
</BrowserRouter>
);
expect(getByText(/Welcome react-cookie-service-example/gi)).toBeTruthy();
});
});
54 changes: 54 additions & 0 deletions apps/react-cookie-service-example/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import styles from './app.module.scss';

import NxWelcome from './nx-welcome';

import { Route, Routes, Link } from 'react-router-dom';

export function App() {
return (
<>
<NxWelcome title="react-cookie-service-example" />

<div />

{/* START: routes */}
{/* These routes and navigation have been generated for you */}
{/* Feel free to move and update them to fit your needs */}
<br />
<hr />
<br />
<div role="navigation">
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/page-2">Page 2</Link>
</li>
</ul>
</div>
<Routes>
<Route
path="/"
element={
<div>
This is the generated root route. <Link to="/page-2">Click here for page 2.</Link>
</div>
}
/>
<Route
path="/page-2"
element={
<div>
<Link to="/">Click here to go back to root page.</Link>
</div>
}
/>
</Routes>
{/* END: routes */}
</>
);
}

export default App;
Loading