Skip to content

Commit ef96e5d

Browse files
committed
Initial commit
0 parents  commit ef96e5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1783
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nx/javascript"],
32+
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
40+
}
41+
]
42+
}

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
permissions:
10+
actions: read
11+
contents: read
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: oven-sh/setup-bun@v1
22+
with:
23+
bun-version: latest
24+
25+
# Connect your workspace on nx.app and uncomment this to enable task distribution.
26+
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
27+
# - run: bunx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
28+
29+
- run: bun install --no-cache
30+
- uses: nrwl/nx-set-shas@v4
31+
32+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
33+
# - run: bun nx-cloud record -- echo Hello World
34+
- run: bun nx affected -t lint test build
35+
- run: bun nx affected --parallel 1 -t e2e-ci

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
/out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.angular

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
.angular

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"ms-playwright.playwright"
7+
]
8+
}

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# BunTest
2+
3+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4+
5+
**This workspace has been generated by [Nx, Smart Monorepos · Fast CI.](https://nx.dev)**
6+
7+
## Integrate with editors
8+
9+
Enhance your Nx experience by installing [Nx Console](https://nx.dev/nx-console) for your favorite editor. Nx Console
10+
provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and
11+
comes with a LSP for Vim users.
12+
13+
## Start the application
14+
15+
Run `npx nx serve bun-test` to start the development server. Happy coding!
16+
17+
## Build for production
18+
19+
Run `npx nx build bun-test` to build the application. The build artifacts are stored in the output directory (e.g. `dist/` or `build/`), ready to be deployed.
20+
21+
## Running tasks
22+
23+
To execute tasks with Nx use the following syntax:
24+
25+
```
26+
npx nx <target> <project> <...options>
27+
```
28+
29+
You can also run multiple targets:
30+
31+
```
32+
npx nx run-many -t <target1> <target2>
33+
```
34+
35+
..or add `-p` to filter specific projects
36+
37+
```
38+
npx nx run-many -t <target1> <target2> -p <proj1> <proj2>
39+
```
40+
41+
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/features/run-tasks).
42+
43+
## Set up CI!
44+
45+
Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
46+
47+
- [Set up remote caching](https://nx.dev/features/share-your-cache)
48+
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
49+
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
50+
51+
## Explore the project graph
52+
53+
Run `npx nx graph` to show the graph of the workspace.
54+
It will show tasks that you can run with Nx.
55+
56+
- [Learn more about Exploring the Project Graph](https://nx.dev/core-features/explore-graph)
57+
58+
## Connect with us!
59+
60+
- [Join the community](https://nx.dev/community)
61+
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
62+
- [Follow us on Twitter](https://twitter.com/nxdevtools)

apps/bun-test-e2e/.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": ["plugin:playwright/recommended", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["src/**/*.{ts,js,tsx,jsx}"],
19+
"rules": {}
20+
}
21+
]
22+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
import { nxE2EPreset } from '@nx/playwright/preset';
3+
4+
import { workspaceRoot } from '@nx/devkit';
5+
6+
// For CI, you may want to set BASE_URL to the deployed application.
7+
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
8+
9+
/**
10+
* Read environment variables from file.
11+
* https://github.com/motdotla/dotenv
12+
*/
13+
// require('dotenv').config();
14+
15+
/**
16+
* See https://playwright.dev/docs/test-configuration.
17+
*/
18+
export default defineConfig({
19+
...nxE2EPreset(__filename, { testDir: './src' }),
20+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
21+
use: {
22+
baseURL,
23+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
24+
trace: 'on-first-retry',
25+
},
26+
/* Run your local dev server before starting the tests */
27+
webServer: {
28+
command: 'bun nx serve bun-test',
29+
url: 'http://localhost:4200',
30+
reuseExistingServer: !process.env.CI,
31+
cwd: workspaceRoot,
32+
},
33+
projects: [
34+
{
35+
name: 'chromium',
36+
use: { ...devices['Desktop Chrome'] },
37+
},
38+
39+
{
40+
name: 'firefox',
41+
use: { ...devices['Desktop Firefox'] },
42+
},
43+
44+
{
45+
name: 'webkit',
46+
use: { ...devices['Desktop Safari'] },
47+
},
48+
49+
// Uncomment for mobile browsers support
50+
/* {
51+
name: 'Mobile Chrome',
52+
use: { ...devices['Pixel 5'] },
53+
},
54+
{
55+
name: 'Mobile Safari',
56+
use: { ...devices['iPhone 12'] },
57+
}, */
58+
59+
// Uncomment for branded browsers
60+
/* {
61+
name: 'Microsoft Edge',
62+
use: { ...devices['Desktop Edge'], channel: 'msedge' },
63+
},
64+
{
65+
name: 'Google Chrome',
66+
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
67+
} */
68+
],
69+
});

apps/bun-test-e2e/project.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "bun-test-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"sourceRoot": "apps/bun-test-e2e/src",
6+
"implicitDependencies": ["bun-test"],
7+
"// targets": "to see all targets run: nx show project bun-test-e2e --web",
8+
"targets": {}
9+
}

apps/bun-test-e2e/src/example.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('has title', async ({ page }) => {
4+
await page.goto('/');
5+
6+
// Expect h1 to contain a substring.
7+
expect(await page.locator('h1').innerText()).toContain('Welcome');
8+
});

apps/bun-test-e2e/tsconfig.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"outDir": "../../dist/out-tsc",
6+
"module": "commonjs",
7+
"sourceMap": false,
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"noImplicitOverride": true,
11+
"noPropertyAccessFromIndexSignature": true,
12+
"noImplicitReturns": true,
13+
"noFallthroughCasesInSwitch": true
14+
},
15+
"include": [
16+
"**/*.ts",
17+
"**/*.js",
18+
"playwright.config.ts",
19+
"src/**/*.spec.ts",
20+
"src/**/*.spec.js",
21+
"src/**/*.test.ts",
22+
"src/**/*.test.js",
23+
"src/**/*.d.ts"
24+
]
25+
}

apps/bun-test/.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"rules": {
12+
"@angular-eslint/directive-selector": [
13+
"error",
14+
{
15+
"type": "attribute",
16+
"prefix": "app",
17+
"style": "camelCase"
18+
}
19+
],
20+
"@angular-eslint/component-selector": [
21+
"error",
22+
{
23+
"type": "element",
24+
"prefix": "app",
25+
"style": "kebab-case"
26+
}
27+
]
28+
}
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:@nx/angular-template"],
33+
"rules": {}
34+
}
35+
]
36+
}

0 commit comments

Comments
 (0)