Skip to content

Commit dc39291

Browse files
feat!: v2 (#100)
* feat: init v2 * docs: reword message * feat: reconfigure `package.json` and `vite.config.ts` * chore: use exact dev version * docs: add missing TSDoc * test: add PrismicNextLink tests * test: more APIs * ci: use modern Node.js versions * ci: use latest Node.js for single-Node.js jobs * chore: fix eslint setup * ci: simplify workflow * ci: don't fail fast * test: fix for Node 18 compat * chore: remove unused asset * chore: stuff * feat: base setup * test: add full preview test * test: add all tests * ci: fix env secret name * ci: trigger * ci: use different env var * ci: add Prismic auth * ci: fix secrets * tests: fix deps * ci: use unique playwright report name * test: fix Node.js 18 compat * chore: remove unused vitest deps * ci: adjust workflow * ci: remove Codecov * test: isolate Playwright tests (#102) * test: isolate Playwright tests * ci: try multiple workers * feat: attempt persisted, shared repository * test: implement own prismic client * test: remove slice machine from e2e projects * test: create storage state file on start * test: remove console.log * test: isolate xsrf token * test: fix preview tests * test: refactor * test: add teardown * chore: use workspaces * ci: fix installation * ci: run size-limit maybe? * chore: update infra * feat: cleanup * fix: remove PR template * test: refactor infra organization * test: fix setup/teardown test filters * fix: preview reloading with pages router * ci: use correct env var name and remove npm token * ci: replace last remaining _USERNAME var * test: add Next.js 14 test projects * chore: update `package-lock.json` * test: use correct Next.js config file format * test: add `experimental.outputFileTracingRoot` to Next.js 14 projects * chore: release alpha as major * test: remove Next.js 14 test apps * test: increase timeout * fix: use `redirect: "manual"` * docs: remove irrelevant TSDocs * chore(release): 2.0.0-alpha.0 * fix: don't hard-refresh the page on preview updates * chore(release): 2.0.0-alpha.1 * fix: treat `PrismicNextImage` as a server component * Revert "fix: treat `PrismicNextImage` as a server component" This reverts commit 9acfdc2. * chore: clean up peer dependency versions * fix: use `FC` over `JSX` to support React 18 * chore(release): 2.0.0-alpha.2 * feat: forward ref to `<PrismicNextImage>`
1 parent 3e6f316 commit dc39291

File tree

95 files changed

+6474
-8016
lines changed

Some content is hidden

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

95 files changed

+6474
-8016
lines changed

.env.test.example

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
###############################################################################
2+
# The following environment variables are used to run Playwright tests.
3+
# Create a specific account for testing to avoid issues.
4+
###############################################################################
5+
6+
# The email address for your Prismic account.
7+
PLAYWRIGHT_PRISMIC_EMAIL=
8+
# The password to your Prismic account.
9+
PLAYWRIGHT_PRISMIC_PASSWORD=

.eslintignore

-40
This file was deleted.

.eslintrc.cjs

-45
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

-27
This file was deleted.

.github/prismic-oss-ecosystem.svg

-60
This file was deleted.

.github/workflows/ci.yml

+22-115
Original file line numberDiff line numberDiff line change
@@ -3,131 +3,38 @@ name: ci
33
on: push
44

55
jobs:
6-
prepare:
7-
name: Prepare (${{ matrix.os}}, Node ${{ matrix.node }})
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
os: [ubuntu-latest]
12-
node: [16, 18, 20]
13-
14-
steps:
15-
- name: Set up Node
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: ${{ matrix.node }}
19-
20-
- name: Checkout
21-
uses: actions/checkout@master
22-
23-
- name: Cache node_modules
24-
id: cache
25-
uses: actions/cache@v3
26-
with:
27-
path: node_modules
28-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
29-
30-
- name: Install dependencies
31-
if: steps.cache.outputs.cache-hit != 'true'
32-
run: npm ci
6+
ci:
7+
name: Prepare (${{ matrix.os}}, Node.js ${{ matrix.node }})
338

34-
suite:
35-
needs: prepare
36-
name: Suite (${{ matrix.os}}, Node ${{ matrix.node }})
37-
runs-on: ${{ matrix.os }}
389
strategy:
39-
fail-fast: false
4010
matrix:
4111
os: [ubuntu-latest]
42-
node: [16, 18, 20]
43-
44-
steps:
45-
- name: Set up Node
46-
uses: actions/setup-node@v3
47-
with:
48-
node-version: ${{ matrix.node }}
49-
50-
- name: Checkout
51-
uses: actions/checkout@master
52-
53-
- name: Retrieve node_modules
54-
uses: actions/cache@v3
55-
with:
56-
path: node_modules
57-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
58-
59-
- name: Lint
60-
run: npm run lint
61-
62-
- name: Unit
63-
run: npm run unit
64-
65-
- name: Build
66-
run: npm run build
67-
68-
- name: Coverage
69-
if: matrix.os == 'ubuntu-latest' && matrix.node == 16
70-
uses: codecov/codecov-action@v3
71-
72-
types:
73-
needs: prepare
74-
name: Types (${{ matrix.os}}, Node ${{ matrix.node }}, TS ${{ matrix.typescript }})
75-
runs-on: ${{ matrix.os }}
76-
strategy:
12+
node: [18, 20, 22]
7713
fail-fast: false
78-
matrix:
79-
os: [ubuntu-latest]
80-
node: [16]
81-
typescript: ["4.7", "4.8", "4.9", "5.0"]
8214

83-
steps:
84-
- name: Set up Node
85-
uses: actions/setup-node@v3
86-
with:
87-
node-version: ${{ matrix.node }}
88-
89-
- name: Checkout
90-
uses: actions/checkout@master
91-
92-
- name: Retrieve node_modules
93-
uses: actions/cache@v3
94-
with:
95-
path: node_modules
96-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
97-
98-
- name: Overwrite TypeScript
99-
run: npm install --no-save typescript@${{ matrix.typescript }} && npx tsc --version
100-
101-
- name: Types
102-
run: npm run types
103-
104-
size:
105-
needs: prepare
106-
if: github.event_name == 'pull_request'
107-
name: Size (${{ matrix.os}}, Node ${{ matrix.node }})
10815
runs-on: ${{ matrix.os }}
109-
strategy:
110-
fail-fast: false
111-
matrix:
112-
os: [ubuntu-latest]
113-
node: [16]
11416

11517
steps:
116-
- name: Set up Node
117-
uses: actions/setup-node@v3
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
11820
with:
11921
node-version: ${{ matrix.node }}
120-
121-
- name: Checkout
122-
uses: actions/checkout@master
123-
124-
- name: Retrieve node_modules
125-
uses: actions/cache@v3
126-
with:
127-
path: node_modules
128-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
129-
130-
- name: Size
131-
uses: andresz1/size-limit-action@v1
22+
registry-url: "https://registry.npmjs.org/"
23+
- run: npm ci
24+
- run: npx playwright install --with-deps
25+
- run: npm run lint
26+
- run: npm run build
27+
- uses: andresz1/size-limit-action@v1
28+
if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == 22 }}
13229
with:
13330
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
- run: npm run e2e
32+
env:
33+
PLAYWRIGHT_PRISMIC_EMAIL: ${{ secrets.PLAYWRIGHT_PRISMIC_EMAIL }}
34+
PLAYWRIGHT_PRISMIC_PASSWORD: ${{ secrets.PLAYWRIGHT_PRISMIC_PASSWORD }}
35+
- uses: actions/upload-artifact@v4
36+
if: ${{ !cancelled() }}
37+
with:
38+
name: playwright-report (${{ matrix.os }}, Node.js ${{ matrix.node }})
39+
path: playwright-report/
40+
retention-days: 30

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# custom
22
dist
33
examples/**/package-lock.json
4+
*.tgz
45

56
# os
67
.DS_Store
@@ -35,4 +36,9 @@ coverage
3536
.vscode/*
3637
!.vscode/tasks.json
3738
!.vscode/launch.json
38-
*.code-workspace
39+
*.code-workspace
40+
/test-results/
41+
/playwright-report/
42+
/blob-report/
43+
/playwright/.cache/
44+
/tests/infra/.storage-state.json

.prettierignore

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# custom
22
dist
3-
example/**/package-lock.json
4-
example/**/.next
3+
examples/**/package-lock.json
4+
*.tgz
55
CHANGELOG.md
6+
e2e-projects/**/.next
67

78
# os
89
.DS_Store
@@ -38,3 +39,8 @@ coverage
3839
!.vscode/tasks.json
3940
!.vscode/launch.json
4041
*.code-workspace
42+
/test-results/
43+
/playwright-report/
44+
/blob-report/
45+
/playwright/.cache/
46+
/tests/.storage-state.json

0 commit comments

Comments
 (0)