Skip to content

Commit aab72e7

Browse files
refactor: move into npm workspace (#1304)
* refactor: move into npm workspace * ci: move demo sites to use monorepos * fix: correct tsconfig * chore: use plugin wrapper * ci: always install using latest node * ci: don't SSR private env var * ci: configure release-please Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent eb35615 commit aab72e7

Some content is hidden

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

49 files changed

+694
-343
lines changed

.github/workflows/release-please.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,27 @@ jobs:
1616
id: release
1717
with:
1818
token: ${{ steps.get-token.outputs.token }}
19-
release-type: node
20-
package-name: '@netlify/plugin-nextjs'
19+
command: manifest
2120
- uses: actions/checkout@v2
22-
if: ${{ steps.release.outputs.release_created }}
21+
if: ${{ steps.release.outputs.releases_created }}
2322
- uses: actions/setup-node@v2
2423
with:
2524
node-version: '*'
2625
cache: 'npm'
2726
check-latest: true
2827
registry-url: 'https://registry.npmjs.org'
29-
if: ${{ steps.release.outputs.release_created }}
28+
if: ${{ steps.release.outputs.releases_created }}
3029
- name: Install dependencies
3130
run: npm ci
32-
if: ${{ steps.release.outputs.release_created }}
31+
working-directory: plugin
32+
if: ${{ steps.release.outputs.releases_created }}
3333
- run: npm publish
34-
if: ${{ steps.release.outputs.release_created }}
34+
working-directory: plugin
35+
if: ${{ steps.release.outputs.releases_created }}
3536
env:
3637
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3738
- uses: netlify/submit-build-plugin-action@v1
38-
if: ${{ steps.release.outputs.release_created }}
39+
if: ${{ steps.release.outputs.releases_created }}
3940
with:
4041
github-token: ${{ steps.get-token.outputs.token }}
42+
package-json-dir: plugin

.github/workflows/test.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v2
28-
- name: Use Node.js ${{ matrix.node-version }}
28+
- name: Installing with latest Node.js
2929
uses: actions/setup-node@v2
30+
if: "${{ matrix.node-version != '*' }}"
3031
with:
31-
node-version: ${{ matrix.node-version }}
32+
node-version: '*'
3233
check-latest: true
3334
- name: NPM Install
3435
run: npm ci
36+
- name: Switching to Node.js ${{ matrix.node-version }} to run tests
37+
uses: actions/setup-node@v2
38+
if: "${{ matrix.node-version != '*' }}"
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
check-latest: true
3542
- name: Linting
3643
run: npm run format:ci
3744
if: "${{ matrix.node-version == '*' }}"
@@ -55,14 +62,21 @@ jobs:
5562
if: github.ref_name == 'main'
5663
steps:
5764
- uses: actions/checkout@v2
58-
- name: Use Node.js ${{ matrix.node-version }}
65+
- name: Installing with latest Node.js
5966
uses: actions/setup-node@v2
67+
if: "${{ matrix.node-version != '*' }}"
6068
with:
61-
node-version: ${{ matrix.node-version }}
69+
node-version: '*'
6270
check-latest: true
6371
- name: NPM Install
6472
run: npm ci
6573
- name: Install Next.js Canary
6674
run: npm install -D next@canary --legacy-peer-deps
75+
- name: Switching to Node.js ${{ matrix.node-version }} to run tests
76+
uses: actions/setup-node@v2
77+
if: "${{ matrix.node-version != '*' }}"
78+
with:
79+
node-version: ${{ matrix.node-version }}
80+
check-latest: true
6781
- name: Run tests against next@canary
6882
run: npm test

.nvmrc

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

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ logs
33
*.log
44
npm-debug.log*
55

6+
package.json
7+
68
# Dependency directories
79
node_modules
810

.release-please-manifest.json

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

demos/base-path/netlify.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
1212
framework = "#static"
1313

1414
[[plugins]]
15-
package = "./local-plugin"
15+
package = "../plugin-wrapper/"
1616

1717
[[plugins]]
1818
package = "@netlify/plugin-local-install-core"
19-
2019
# [[context.deploy-preview.plugins]]
21-
# package = "netlify-plugin-cypress"
20+
# package = "netlify-plugin-cypress"

demos/base-path/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "base-path-demo",
3+
"version": "1.0.0",
4+
"description": "",
5+
"devDependencies": {
6+
"@netlify/plugin-nextjs": "*"
7+
},
8+
"scripts": {
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/netlify/netlify-plugin-nextjs.git"
14+
},
15+
"author": "",
16+
"private": true,
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/netlify/netlify-plugin-nextjs/issues"
20+
},
21+
"homepage": "https://github.com/netlify/netlify-plugin-nextjs#readme"
22+
}

demos/default/local-plugin/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

demos/default/local-plugin/manifest.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

demos/default/local-plugin/package.json

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

0 commit comments

Comments
 (0)