chore: Prep stable release

pull/47/head
Boaz Poolman 2022-03-16 22:10:24 +01:00
parent 63ac38c926
commit 7573a07d76
5 changed files with 51 additions and 28 deletions

View File

@ -66,7 +66,17 @@ npm run build
npm run develop npm run develop
``` ```
The **Config Sync** plugin should appear in the **Plugins** section of Strapi sidebar after you run app again. The **Config Sync** plugin should now appear in the **Settings** section of your Strapi app.
To start tracking your config changes you have to make the first export. This will dump all your configuration data to the `/config/sync` directory. To export, run:
```bash
# using yarn
yarn config-sync export
# using npm
npm run config-sync export
```
Enjoy 🎉 Enjoy 🎉
@ -76,7 +86,7 @@ Complete installation requirements are the exact same as for Strapi itself and c
**Supported Strapi versions**: **Supported Strapi versions**:
- Strapi 4.0.7 (recently tested) - Strapi 4.1.5 (recently tested)
- Strapi ^4.x (use `strapi-plugin-config-sync@^1.0.0`) - Strapi ^4.x (use `strapi-plugin-config-sync@^1.0.0`)
- Strapi ^3.4.x (use `strapi-plugin-config-sync@0.1.6`) - Strapi ^3.4.x (use `strapi-plugin-config-sync@0.1.6`)

View File

@ -1,12 +1,12 @@
{ {
"name": "strapi-plugin-config-sync", "name": "strapi-plugin-config-sync",
"version": "1.0.0-beta.8", "version": "1.0.0-beta.8",
"description": "CLI & GUI for syncing config data across environments.", "description": "Migrate your config data across environments using the CLI or Strapi admin panel.",
"strapi": { "strapi": {
"displayName": "Config Sync", "displayName": "Config Sync",
"name": "config-sync", "name": "config-sync",
"icon": "sync", "icon": "sync",
"description": "CLI & GUI for syncing config data across environments.", "description": "Migrate your config data across environments using the CLI or Strapi admin panel.",
"required": false, "required": false,
"kind": "plugin" "kind": "plugin"
}, },
@ -57,10 +57,10 @@
}, },
"devDependencies": { "devDependencies": {
"@fortawesome/react-fontawesome": "^0.1.16", "@fortawesome/react-fontawesome": "^0.1.16",
"@strapi/design-system": "^0.0.1-alpha.75", "@strapi/design-system": "^0.0.1-alpha.79",
"@strapi/helper-plugin": "^4.0.7", "@strapi/helper-plugin": "^4.1.5",
"@strapi/icons": "^0.0.1-alpha.75", "@strapi/icons": "^0.0.1-alpha.79",
"@strapi/utils": "^4.0.7", "@strapi/utils": "^4.1.5",
"babel-eslint": "9.0.0", "babel-eslint": "9.0.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1", "eslint-config-airbnb": "^18.2.1",

View File

@ -15,9 +15,9 @@
"jest-cli": "^26.0.1" "jest-cli": "^26.0.1"
}, },
"dependencies": { "dependencies": {
"@strapi/plugin-i18n": "^4.0.2", "@strapi/plugin-i18n": "^4.0.0",
"@strapi/plugin-users-permissions": "^4.0.2", "@strapi/plugin-users-permissions": "^4.0.0",
"@strapi/strapi": "^4.0.2", "@strapi/strapi": "^4.0.0",
"sqlite3": "5.0.2", "sqlite3": "5.0.2",
"strapi-plugin-config-sync": "boazpoolman/strapi-plugin-config-sync" "strapi-plugin-config-sync": "boazpoolman/strapi-plugin-config-sync"
}, },

View File

@ -1,5 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
const fs = require('fs');
const { Command } = require('commander'); const { Command } = require('commander');
const Table = require('cli-table'); const Table = require('cli-table');
const chalk = require('chalk'); const chalk = require('chalk');
@ -68,6 +69,14 @@ const getConfigState = (diff, configName, syncType) => {
const handleAction = async (syncType, skipConfirm, configType, partials) => { const handleAction = async (syncType, skipConfirm, configType, partials) => {
const app = await strapi().load(); const app = await strapi().load();
const hasSyncDir = fs.existsSync(app.config.get('plugin.config-sync.syncDir'));
// No import with empty sync dir.
if (!hasSyncDir && syncType === 'import') {
console.log(`${chalk.yellow.bold('[warning]')} You can't import an empty sync directory. Please export before continuing.`);
process.exit(0);
}
const diff = await app.plugin('config-sync').service('main').getFormattedDiff(); const diff = await app.plugin('config-sync').service('main').getFormattedDiff();
// No changes. // No changes.
@ -109,7 +118,9 @@ const handleAction = async (syncType, skipConfirm, configType, partials) => {
}); });
// Print table. // Print table.
console.log(table.toString(), '\n'); if (hasSyncDir) {
console.log(table.toString(), '\n');
}
// Prompt to confirm. // Prompt to confirm.
let answer = {}; let answer = {};

View File

@ -814,19 +814,19 @@
dependencies: dependencies:
"@sinonjs/commons" "^1.7.0" "@sinonjs/commons" "^1.7.0"
"@strapi/design-system@^0.0.1-alpha.75": "@strapi/design-system@^0.0.1-alpha.79":
version "0.0.1-alpha.75" version "0.0.1-alpha.79"
resolved "https://registry.yarnpkg.com/@strapi/design-system/-/design-system-0.0.1-alpha.75.tgz#8a06eb07a0d25791a93537578387e401dff116d2" resolved "https://registry.yarnpkg.com/@strapi/design-system/-/design-system-0.0.1-alpha.79.tgz#23e6a7f73383b72148c926fa74ed0ba1acc32f0a"
integrity sha512-JSIRFCiAOtTbjMDIa/KULSkfyPP/mphBhJDdeBx8bLNDKhU0SX3/zSXghjMWQ48aHvmyWTfwm8SVdw6EolzpIQ== integrity sha512-o/F55Qjwao1HkqKcL8ovQ280QijJH8dLfzP+t3XMNL5Ihh3HBD2wcMS6dOsrnNDGdDE0LWQfG8bDbLPmWHmk1A==
dependencies: dependencies:
"@internationalized/number" "^3.0.2" "@internationalized/number" "^3.0.2"
compute-scroll-into-view "^1.0.17" compute-scroll-into-view "^1.0.17"
prop-types "^15.7.2" prop-types "^15.7.2"
"@strapi/helper-plugin@^4.0.7": "@strapi/helper-plugin@^4.1.5":
version "4.0.7" version "4.1.5"
resolved "https://registry.yarnpkg.com/@strapi/helper-plugin/-/helper-plugin-4.0.7.tgz#5eb91e0faf4496769ad5a2bd90a06be58f1840d2" resolved "https://registry.yarnpkg.com/@strapi/helper-plugin/-/helper-plugin-4.1.5.tgz#f6032b38af88a02d64552cbb48ca382bc48c5288"
integrity sha512-0rFjdr7ZBi7P//dD56eL3LEaA2bQ9+ooqqYz9v9hMm9NCWJm8j7ybKUghLpoIUca48DKGItb9ap2BDt0CYKSAw== integrity sha512-Pog53h0W+dgA+QjZpcrPgtt+hkBcRx9LYJ/CAW+BMCtqnqP0qcqQFtP5xPPxSJCkkmPX4GJT3XRWJUnjdPEq/A==
dependencies: dependencies:
"@fortawesome/fontawesome-free" "^5.15.2" "@fortawesome/fontawesome-free" "^5.15.2"
"@fortawesome/fontawesome-svg-core" "^1.2.35" "@fortawesome/fontawesome-svg-core" "^1.2.35"
@ -850,15 +850,17 @@
styled-components "^5.2.3" styled-components "^5.2.3"
whatwg-fetch "^3.6.2" whatwg-fetch "^3.6.2"
"@strapi/icons@^0.0.1-alpha.75": "@strapi/icons@^0.0.1-alpha.79":
version "0.0.1-alpha.75" version "0.0.1-alpha.79"
resolved "https://registry.yarnpkg.com/@strapi/icons/-/icons-0.0.1-alpha.75.tgz#12a38c2c921cedc26f5bd8c3aa91c5b82246c066" resolved "https://registry.yarnpkg.com/@strapi/icons/-/icons-0.0.1-alpha.79.tgz#eff8790ea3897419489a61cbfd72a436661d1420"
integrity sha512-h9ZlIPVg95+WaBsXEthKSw9eZQ/VsuuZE5aad/4Cx0NBEUyQl+0h5Z/JqIUSNMX4KMyJJjo9Ad4FGUyOLNHLmw== integrity sha512-mIPzpwOir92939rSRuRS22GLWFpLfQDyoK0vMZUsGD7uujNnRon//TUa9DJTjTHjdEjRwWO60JbJOePgJ+2cvg==
dependencies:
rimraf "^3.0.2"
"@strapi/utils@^4.0.7": "@strapi/utils@^4.1.5":
version "4.0.7" version "4.1.5"
resolved "https://registry.yarnpkg.com/@strapi/utils/-/utils-4.0.7.tgz#718823fcf23c028a65ce8c317a36cc6d7321eb0c" resolved "https://registry.yarnpkg.com/@strapi/utils/-/utils-4.1.5.tgz#3e80f59476cab470ba0fdb42a075b5ae47e998f2"
integrity sha512-coGjVudsnlXvb20mobyeoguCfXKnLjXnKhYiMoS6wqy4ozazu12+5MsCh7Hs9UAkvK4Fzhf7+urvyoj/UpSkaQ== integrity sha512-Oz7ur7TsoqA4IOPdk6H3YwsVZ+FOi9wp+iRReKao8yfo4YKJjSYlHQlNXUaAqOOlFnT0ol7G3KF+uF8jLcfxDA==
dependencies: dependencies:
"@sindresorhus/slugify" "1.1.0" "@sindresorhus/slugify" "1.1.0"
date-fns "2.24.0" date-fns "2.24.0"