-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bded3a4
commit df5479f
Showing
46 changed files
with
24,367 additions
and
6,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [18, 20] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
node-version: ${{ matrix.node }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- run: npm run build:playground | ||
- name: Install playground | ||
run: npm ci | ||
working-directory: ./playground | ||
- name: Build playground | ||
run: npm run build | ||
working-directory: ./playground | ||
- name: Test step | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,12 +305,10 @@ example of revalidating page | |
|
||
## Development | ||
|
||
To develop on this plugin first open a strapi project and navigate to `src/plugins/` and clone this repo or your fork | ||
To develop on this plugin use the playground in this repo. | ||
|
||
```bash | ||
cd src/plugins | ||
git clone [email protected]:Oak-Digital/strapi-plugin-revalidator.git revalidator | ||
cd revalidator | ||
cd playground | ||
``` | ||
|
||
Install dependencies with the | ||
|
@@ -325,20 +323,7 @@ Then to make sure the build is always up to date run | |
npm run develop | ||
``` | ||
|
||
Add the following basic config to `config/plugins.ts` | ||
|
||
```typescript | ||
export default ({ env }) => ({ | ||
// ... | ||
revalidator: { | ||
enabled: true, | ||
resolve: "./src/plugins/revalidator", | ||
}, | ||
// ... | ||
}); | ||
``` | ||
|
||
In another terminal go to the root of your project and run `strapi develop --watch-admin`. This can probably also be run like the following depending on your setup. | ||
In another terminal go to the playground folder and run `strapi develop --watch-admin`. This can probably also be run like the following depending on your setup. | ||
|
||
```bash | ||
npm run develop -- --watch-admin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import pluginPkg from '../../package.json'; | ||
|
||
/* const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, ''); */ | ||
const pluginId = "revalidator"; | ||
// TODO: typescript doesn't import json as literals | ||
const pluginId = pluginPkg.strapi.name as "revalidator"; | ||
|
||
export default pluginId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testMatch: ['**/__tests__/?(*.)+(spec|test).ts'], | ||
// transform: {}, | ||
// globalSetup: './playground/__tests__/setup-strapi.ts', | ||
// setupFilesAfterEnv: ['./playground/__tests__/setup-strapi.ts'], | ||
// globalTeardown: './playground/__tests__/teardown-strapi.ts', | ||
coverageDirectory: './coverage/', | ||
collectCoverage: true, | ||
}; |
Oops, something went wrong.