Skip to content

Commit

Permalink
Merge branch 'master' of github.com:boazpoolman/strapi-plugin-config-…
Browse files Browse the repository at this point in the history
…sync
  • Loading branch information
ae94 committed Oct 14, 2024
2 parents 38563db + 79a4a0b commit d735151
Show file tree
Hide file tree
Showing 67 changed files with 11,976 additions and 2,635 deletions.
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
"strapi": true
},
"rules": {
"import/no-unresolved": [2, {
"ignore": [
"@strapi/strapi/admin",
"@strapi/icons/symbols",
"@strapi/admin/strapi-admin"
]
}],

"template-curly-spacing" : "off",

"indent" : "off",
Expand Down
Binary file modified .github/config-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/setup-node@v3
with:
always-auth: true
node-version: 16
node-version: 18
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
Expand All @@ -31,3 +31,4 @@ jobs:
with:
commit_message: 'chore: Bump version to ${{ steps.get_version.outputs.VERSION }}'
file_pattern: 'package.json'
branch: master
15 changes: 10 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:
branches:
- master
- develop
- beta

jobs:
lint:
name: 'lint'
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]
node: [18, 20]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -32,17 +33,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]
node: [18, 20]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies plugin
run: yarn --frozen-lockfile --unsafe-perm --production
run: yarn --no-lockfile --unsafe-perm
- name: Push the package to yalc
run: yarn build
- name: Add yalc package to the playground
run: yarn playground:yalc-add
- name: Install dependencies playground
run: yarn playground:install --frozen-lockfile --unsafe-perm
run: cd playground && yarn install --unsafe-perm
- name: Build playground
run: yarn playground:build
- name: Run test
Expand All @@ -60,7 +65,7 @@ jobs:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node: [14, 16, 18]
# node: [16, 18, 20]
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
Expand Down
53 changes: 23 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,55 @@ We want this community to be friendly and respectful to each other. Please follo

## Development Workflow

To get started with the project, make sure you have a local instance of Strapi running.
See the [Strapi docs](https://github.com/strapi/strapi#getting-started) on how to setup a Strapi project.
This plugin provides a local development instance of Strapi to develop it's features. We call this instance `playground` and it can be found in the playground folder in the root of the project. For that reason it is not needed to have your own Strapi instance running to work on this plugin. Just clone the repo and you're ready to go!

#### 1. Fork the [repository](https://github.com/boazpoolman/strapi-plugin-config-sync)
#### 1. Fork the [repository](https://github.com/pluginpal/strapi-plugin-config-sync)

[Go to the repository](https://github.com/boazpoolman/strapi-plugin-config-sync) and fork it to your own GitHub account.
[Go to the repository](https://github.com/pluginpal/strapi-plugin-config-sync) and fork it to your own GitHub account.

#### 2. Clone from your repository into the plugins folder
#### 2. Clone the forked repository

```bash
cd YOUR_STRAPI_PROJECT/src/plugins
git clone [email protected]:YOUR_USERNAME/strapi-plugin-config-sync.git config-sync
git clone [email protected]:YOUR_USERNAME/strapi-plugin-config-sync.git
```

#### 3. Install the dependencies

Go to the plugin and install it's dependencies.
Go to the folder and install the dependencies

```bash
cd YOUR_STRAPI_PROJECT/src/plugins/config-sync/ && yarn plugin:install
cd strapi-plugin-config-sync && yarn install
```

#### 4. Enable the plugin
#### 4. Install the playground dependencies

Add the following lines to the `config/plugins.js` file in your Strapi project.
Run this in the root of the repository

```
const path = require('path');
// ...
{
'config-sync': {
enabled: true,
resolve: path.resolve(__dirname, '../src/plugins/config-sync'),
},
}
```bash
yarn playground:install
```

#### 5. Rebuild your Strapi project
#### 5. Run the compiler of the plugin

Rebuild your strapi project to build the admin part of the plugin.
We use `yalc` to publish the package to a local registry. Run the following command o watch for changes and push to `yalc` every time a change is made:

```bash
cd YOUR_STRAPI_PROJECT && yarn build
yarn develop
```

#### 6. Running the administration panel in development mode
#### 6. Start the playground instance

**Start the administration panel server for development**
Leave the watcher running, open up a new terminal window and browse back to the root of the plugin repo. Run the following command:

```bash
cd YOUR_STRAPI_PROJECT && yarn develop --watch-admin
yarn playground:develop
```

The administration panel will be available at http://localhost:8080/admin
This will start the playground instance that will have the plugin installed from the `yalc` registry. Browse to http://localhost:1337 and create a test admin user to log in to the playground.

#### 7. Start your contribution!

You can now start working on your contribution. If you had trouble setting up this testing environment please feel free to report an issue on Github.

### Commit message convention

Expand All @@ -82,12 +77,10 @@ The `package.json` file contains various scripts for common tasks:

- `yarn eslint`: lint files with ESLint.
- `yarn eslint:fix`: auto-fix ESLint issues.
- `yarn test:unit`: run unit tests with Jest.
- `yarn test:integration`: run integration tests with Jest.

### Sending a pull request

> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
When you're sending a pull request:

- Prefer small pull requests focused on one change.
Expand Down
Loading

0 comments on commit d735151

Please sign in to comment.