Skip to content

Commit 4d392a5

Browse files
committed
update template
1 parent 012b602 commit 4d392a5

File tree

11 files changed

+74
-168
lines changed

11 files changed

+74
-168
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,62 +9,35 @@ jobs:
99
prettier:
1010
name: Prettier
1111
runs-on: ubuntu-latest
12-
permissions:
13-
# Give the default GITHUB_TOKEN write permission to commit and push the
14-
# added or changed files to the repository.
15-
contents: write
16-
strategy:
17-
matrix:
18-
node-version: [20]
1912
steps:
2013
- uses: actions/checkout@v4
21-
- name: Install pnpm
22-
uses: pnpm/action-setup@v4
14+
- name: Setup Bun
15+
uses: oven-sh/setup-bun@v1
2316
with:
24-
version: 9
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v4
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
cache: "pnpm"
17+
bun-version: latest
3018
- name: Install dependencies
31-
run: pnpm install --frozen-lockfile
19+
run: bun install
3220
- name: Run prettier
33-
run: pnpm run fmt
34-
- name: Commit changes
35-
uses: stefanzweifel/git-auto-commit-action@v5
36-
with:
37-
commit_message: Apply formatting changes
38-
branch: ${{ github.head_ref }}
21+
run: bun run fmt:check
3922

4023
playwright-tests:
4124
name: Playwright tests
4225
runs-on: ubuntu-latest
43-
strategy:
44-
matrix:
45-
node-version: [20]
4626
steps:
4727
- uses: actions/checkout@v4
48-
- name: Install pnpm
49-
uses: pnpm/action-setup@v4
50-
with:
51-
version: 9
52-
- name: Use Node.js ${{ matrix.node-version }}
53-
uses: actions/setup-node@v4
28+
- name: Setup Bun
29+
uses: oven-sh/setup-bun@v1
5430
with:
55-
node-version: ${{ matrix.node-version }}
56-
cache: "pnpm"
31+
bun-version: latest
5732
- uses: actions/cache@v3
5833
id: playwright-cache
5934
with:
6035
path: |
6136
~/.cache/ms-playwright
62-
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
37+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/bun.lockb') }}
6338
- name: Install dependencies
64-
run: pnpm install --frozen-lockfile
39+
run: bun install
6540
- name: Install Playwright dependencies
66-
run: |
67-
pnpm exec playwright install --with-deps
41+
run: bunx playwright install --with-deps
6842
- name: Run tests
69-
run: |
70-
pnpm exec playwright test
43+
run: bun run test

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ next-env.d.ts
3939
/playwright-report/
4040
/blob-report/
4141
/playwright/.cache/
42+
43+
# Package manage (uncomment whichever one you use)
44+
45+
yarn.lock
46+
package-lock.json
47+
pnpm-lock.yaml
48+
# bun.lockb

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<h1 style="font-size: 2.5rem; font-weight: bold;">Project Title</h1>
99

1010
<p>
11-
<strong>This is a basic project template for new Build DAO projects</strong>
11+
<strong>a basic project template for new projects</strong>
1212
</p>
1313

1414
</div>
@@ -30,27 +30,27 @@
3030
### Installing dependencies
3131

3232
```bash
33-
pnpm install
33+
bun install
3434
```
3535

3636
### Running the app
3737

3838
First, run the development server:
3939

4040
```bash
41-
pnpm run dev
41+
bun run dev
4242
```
4343

4444
### Building for production
4545

4646
```bash
47-
pnpm run build
47+
bun run build
4848
```
4949

5050
### Running tests
5151

5252
```bash
53-
pnpm run test
53+
bun run test
5454
```
5555

5656
See the full [testing guide](./playwright-tests/README.md).

bun.lockb

3.35 KB
Binary file not shown.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"name": "builddao-project-template",
2+
"name": "project-template",
33
"version": "0.0.1",
44
"homepage": "/",
55
"scripts": {
66
"fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'",
77
"fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'",
8-
"test": "npx playwright test",
9-
"test:ui": "npx playwright test --ui"
8+
"test": "bunx playwright test",
9+
"test:ui": "bunx playwright test --ui",
10+
"dev": "cat welcome.txt"
1011
},
1112
"browserslist": {
1213
"production": [
@@ -22,6 +23,7 @@
2223
},
2324
"devDependencies": {
2425
"@playwright/test": "^1.46.1",
26+
"@types/node": "^20.11.0",
2527
"prettier": "^3.3.3"
2628
}
2729
}

playwright-tests/storage-states/admin-connected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
}
2525
],
2626
"sessionStorage": []
27-
}
27+
}

playwright-tests/storage-states/wallet-connected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
}
2525
],
2626
"sessionStorage": []
27-
}
27+
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import { test, expect } from '@playwright/test';
1+
import { test, expect } from "@playwright/test";
22

3-
test('has title', async ({ page }) => {
4-
await page.goto('https://playwright.dev/');
3+
test("has title", async ({ page }) => {
4+
await page.goto("https://playwright.dev/");
55

66
// Expect a title "to contain" a substring.
77
await expect(page).toHaveTitle(/Playwright/);
88
});
99

10-
test('get started link', async ({ page }) => {
11-
await page.goto('https://playwright.dev/');
10+
test("get started link", async ({ page }) => {
11+
await page.goto("https://playwright.dev/");
1212

1313
// Click the get started link.
14-
await page.getByRole('link', { name: 'Get started' }).click();
14+
await page.getByRole("link", { name: "Get started" }).click();
1515

1616
// Expects page to have a heading with the name of Installation.
17-
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
17+
await expect(
18+
page.getByRole("heading", { name: "Installation" }),
19+
).toBeVisible();
1820
});

playwright.config.js

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -56,45 +56,16 @@ export default defineConfig({
5656
name: "chromium",
5757
use: { ...devices["Desktop Chrome"] },
5858
},
59-
60-
/*{
61-
name: 'firefox',
62-
use: { ...devices['Desktop Firefox'] },
63-
},
64-
65-
{
66-
name: 'webkit',
67-
use: { ...devices['Desktop Safari'] },
68-
},*/
69-
70-
/* Test against mobile viewports. */
71-
// {
72-
// name: 'Mobile Chrome',
73-
// use: { ...devices['Pixel 5'] },
74-
// },
75-
// {
76-
// name: 'Mobile Safari',
77-
// use: { ...devices['iPhone 12'] },
78-
// },
79-
80-
/* Test against branded browsers. */
81-
// {
82-
// name: 'Microsoft Edge',
83-
// use: { channel: 'msedge' },
84-
// },
85-
// {
86-
// name: 'Google Chrome',
87-
// use: { channel: 'chrome' },
88-
// },
8959
],
9060

9161
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
9262
outputDir: "test-results/",
9363

9464
/* Run your local dev server before starting the tests */
95-
webServer: {
96-
command: "pnpm run dev",
97-
url: BASE_URL,
98-
reuseExistingServer: !process.env.CI,
99-
},
65+
// UNCOMMENT
66+
// webServer: {
67+
// command: "bun run dev",
68+
// url: BASE_URL,
69+
// reuseExistingServer: !process.env.CI,
70+
// },
10071
});

pnpm-lock.yaml

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)