Skip to content

Commit efee1bd

Browse files
committed
Setup repo structure
1 parent 2f23104 commit efee1bd

26 files changed

+5209
-1
lines changed

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
root: true,
3+
// This tells ESLint to load the config from the package `eslint-config-custom`
4+
extends: ["custom"],
5+
settings: {
6+
next: {
7+
rootDir: ["apps/*/"],
8+
},
9+
},
10+
};

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
.yarn
8+
9+
# testing
10+
coverage
11+
12+
# next.js
13+
.next/
14+
out/
15+
build
16+
17+
# misc
18+
.DS_Store
19+
*.pem
20+
21+
# debug
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
.pnpm-debug.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# turbo
34+
.turbo
35+
36+
# Cypress test outputs
37+
**/cypress/videos/

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
}

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: "node-modules"

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
1-
# cypress-cloud
1+
# Cypress Cloud
2+
3+
This is an official Yarn (Berry) starter turborepo.
4+
5+
## What's inside?
6+
7+
This turborepo uses [Yarn](https://yarnpkg.com/) as a package manager. It includes the following packages/apps:
8+
9+
### Examples and Packages
10+
11+
- `nextjs`: an example [Next.js](https://nextjs.org/) app with Currents Cypress Cloud setup
12+
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
13+
14+
Each package/example is 100% [TypeScript](https://www.typescriptlang.org/).
15+
16+
### Utilities
17+
18+
This turborepo has some additional tools already setup for you:
19+
20+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
21+
- [ESLint](https://eslint.org/) for code linting
22+
- [Prettier](https://prettier.io) for code formatting
23+
24+
### Build
25+
26+
To build all apps and packages, run the following command:
27+
28+
```
29+
cd cypress-cloud
30+
yarn run build
31+
```
32+
33+
### Develop
34+
35+
To develop all apps and packages, run the following command:
36+
37+
```
38+
cd cypress-cloud
39+
yarn run dev
40+
```

examples/nextjs/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["custom"],
4+
};

examples/nextjs/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Getting Started
2+
3+
First, run the development server:
4+
5+
```bash
6+
yarn dev
7+
```
8+
9+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
10+
11+
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
12+
13+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
14+
15+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
16+
17+
## Learn More
18+
19+
To learn more about Next.js, take a look at the following resources:
20+
21+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
22+
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
23+
24+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
25+
26+
## Deploy on Vercel
27+
28+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
29+
30+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

examples/nextjs/cypress.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { defineConfig } = require("cypress");
2+
const { loadEnvConfig } = require("@next/env");
3+
4+
function loadEnvVariables() {
5+
const projectDir = process.cwd();
6+
loadEnvConfig(projectDir);
7+
}
8+
9+
loadEnvVariables();
10+
const projectId = process.env.CYPRESS_PROJECT_ID;
11+
12+
module.exports = defineConfig({
13+
projectId,
14+
e2e: {
15+
supportFile: false,
16+
setupNodeEvents(on, config) {
17+
// implement node event listeners here
18+
},
19+
},
20+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { homeUrl } from "../../homeUrl";
2+
3+
describe("Navigation Again", () => {
4+
it("should navigate to the about page", () => {
5+
// Start from the index page
6+
cy.visit(homeUrl);
7+
8+
// Find a link with an href attribute containing "about" and click it
9+
cy.get('a[href*="about"]').click();
10+
11+
// The new url should include "/about"
12+
cy.url().should("include", "/about");
13+
14+
// The new page should contain an h1 with "About page"
15+
cy.get("h1").contains("About Page");
16+
});
17+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { homeUrl } from "../../homeUrl";
2+
3+
describe("Navigation", () => {
4+
it("should navigate to the about page", () => {
5+
// Start from the index page
6+
cy.visit(homeUrl);
7+
8+
// Find a link with an href attribute containing "about" and click it
9+
cy.get('a[href*="about"]').click();
10+
11+
// The new url should include "/about"
12+
cy.url().should("include", "/about");
13+
14+
// The new page should contain an h1 with "About page"
15+
cy.get("h1").contains("About Page");
16+
});
17+
});

examples/nextjs/homeUrl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const homeUrl = "http://localhost:3000";

examples/nextjs/loadEnvVariables.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { loadEnvConfig } from "@next/env";
2+
3+
export function loadEnvVariables() {
4+
const projectDir = process.cwd();
5+
loadEnvConfig(projectDir);
6+
}

examples/nextjs/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

examples/nextjs/next.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
reactStrictMode: true,
3+
experimental: {
4+
transpilePackages: ["cypress-runner"],
5+
},
6+
};

examples/nextjs/package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "web",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"cypress-runner": "*",
13+
"next": "13.0.0",
14+
"react": "^18.2.0",
15+
"react-dom": "^18.2.0"
16+
},
17+
"devDependencies": {
18+
"@babel/core": "^7.0.0",
19+
"@types/node": "^17.0.12",
20+
"@types/react": "^18.0.22",
21+
"@types/react-dom": "^18.0.7",
22+
"cypress": "^11.2.0",
23+
"eslint": "7.32.0",
24+
"eslint-config-custom": "*",
25+
"start-server-and-test": "^1.14.0",
26+
"tsconfig": "*",
27+
"typescript": "^4.5.3"
28+
}
29+
}

examples/nextjs/pages/about.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function About() {
2+
return (
3+
<div>
4+
<h1>About Page</h1>
5+
</div>
6+
);
7+
}

examples/nextjs/pages/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Link from "next/link";
2+
3+
export default function Home() {
4+
return (
5+
<nav>
6+
<Link href="/about">About</Link>
7+
</nav>
8+
);
9+
}

examples/nextjs/tsconfig.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"display": "Next.js",
4+
"compilerOptions": {
5+
"composite": false,
6+
"declaration": true,
7+
"declarationMap": true,
8+
"inlineSources": false,
9+
"moduleResolution": "node",
10+
"noUnusedLocals": false,
11+
"noUnusedParameters": false,
12+
"preserveWatchOutput": true,
13+
"target": "es5",
14+
"lib": ["dom", "dom.iterable", "esnext"],
15+
"allowJs": true,
16+
"skipLibCheck": true,
17+
"strict": true,
18+
"forceConsistentCasingInFileNames": true,
19+
"noEmit": true,
20+
"incremental": true,
21+
"esModuleInterop": true,
22+
"module": "esnext",
23+
"resolveJsonModule": true,
24+
"isolatedModules": true,
25+
"jsx": "preserve"
26+
},
27+
"include": ["src", "next-env.d.ts"],
28+
"exclude": ["node_modules"]
29+
}

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@currents/cypress-cloud",
3+
"version": "1.0.0",
4+
"description": "",
5+
"private": true,
6+
"author": "",
7+
"license": "ISC",
8+
"workspaces": [
9+
"examples/*",
10+
"packages/*"
11+
],
12+
"scripts": {
13+
"build": "turbo run build",
14+
"dev": "turbo run dev --parallel",
15+
"lint": "turbo run lint",
16+
"format": "prettier --write \"**/*.{ts,tsx,md}\""
17+
},
18+
"devDependencies": {
19+
"eslint-config-custom": "*",
20+
"prettier": "latest",
21+
"turbo": "latest"
22+
},
23+
"engines": {
24+
"node": ">=14.0.0"
25+
},
26+
"packageManager": "[email protected]"
27+
}

packages/cypress-runner/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function run() {
2+
3+
};

packages/cypress-runner/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "cypress-runner",
3+
"version": "0.0.0",
4+
"main": "./index.ts",
5+
"types": "./index.ts",
6+
"license": "ISC",
7+
"scripts": {
8+
"lint": "TIMING=1 eslint \"**/*.ts*\""
9+
},
10+
"devDependencies": {
11+
"@types/babel__code-frame": "^7.0.3",
12+
"@types/getos": "^3.0.1",
13+
"@types/randomstring": "^1.1.8",
14+
"@types/stack-utils": "^2.0.1",
15+
"eslint": "^7.32.0",
16+
"eslint-config-custom": "*",
17+
"tsconfig": "*",
18+
"typescript": "^4.5.2"
19+
},
20+
"dependencies": {
21+
"@babel/code-frame": "^7.18.6",
22+
"@cypress/commit-info": "^2.2.0",
23+
"axios": "^1.2.0",
24+
"colors": "^1.4.0",
25+
"getos": "^3.2.1",
26+
"image-size": "^1.0.2",
27+
"randomstring": "^1.2.3",
28+
"stack-utils": "^2.0.6"
29+
}
30+
}

packages/cypress-runner/tsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"composite": false,
4+
"declarationMap": true,
5+
"forceConsistentCasingInFileNames": true,
6+
"inlineSources": false,
7+
"isolatedModules": true,
8+
"moduleResolution": "node",
9+
"noUnusedLocals": false,
10+
"noUnusedParameters": false,
11+
"preserveWatchOutput": true,
12+
"skipLibCheck": true,
13+
"strict": true,
14+
"outDir": "dist",
15+
"module": "commonjs",
16+
"target": "es2016",
17+
"declaration": true,
18+
"emitDeclarationOnly": true,
19+
"esModuleInterop": true,
20+
"strictNullChecks": true,
21+
"resolveJsonModule": true
22+
},
23+
"lib": ["es2016"],
24+
"exclude": ["node_modules", "./src/__tests__/*.ts"]
25+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: ["next", "turbo", "prettier"],
3+
rules: {
4+
"@next/next/no-html-link-for-pages": "off",
5+
"react/jsx-key": "off",
6+
},
7+
};

0 commit comments

Comments
 (0)