Merge branch 'main' into fix/remove-persisted-tables-from-store

This commit is contained in:
Marc-Roig 2023-05-02 11:55:24 +02:00
commit 1a1a9eea51
No known key found for this signature in database
GPG Key ID: FB4E2C43A0BEE249
77 changed files with 2014 additions and 1075 deletions

View File

@ -0,0 +1,6 @@
'use strict';
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Github action check-pr-status',
};

14
.github/filters.yaml vendored Normal file
View File

@ -0,0 +1,14 @@
backend:
- 'packages/**/package.json'
- 'packages/**/server/**/*.(js|ts)'
- 'packages/**/strapi-server.js'
- 'packages/{utils,generators,cli,providers}/**'
- 'packages/core/*/{lib,bin,ee}/**'
- 'api-tests/**'
frontend:
- 'packages/**/package.json'
- 'packages/**/admin/src/**'
- 'packages/**/admin/ee/admin/**'
- 'packages/**/strapi-admin.js'
- 'packages/core/helper-plugin/**'
- 'packages/admin-test-utils/**'

View File

@ -1,3 +0,0 @@
module.exports = {
displayName: '.github',
};

View File

@ -11,12 +11,28 @@ concurrency:
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
nonDoc: ${{ steps.filter.outputs.nonDoc }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: .github/filters.yaml
lint:
name: 'lint (node: ${{ matrix.node }})'
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]
node: [18]
steps:
- run: echo "Skipped"
@ -34,6 +50,16 @@ jobs:
name: 'unit_front (node: ${{ matrix.node }})'
needs: [lint]
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
steps:
- run: echo "Skipped"
build:
name: 'build (node: ${{ matrix.node }})'
needs: [changes, lint, unit_front]
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18]

View File

@ -18,8 +18,25 @@ permissions:
actions: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: filter
with:
filters: .github/filters.yaml
lint:
name: 'lint (node: ${{ matrix.node }})'
needs: [changes]
runs-on: ubuntu-latest
strategy:
matrix:
@ -44,7 +61,7 @@ jobs:
unit_back:
name: 'unit_back (node: ${{ matrix.node }})'
needs: [lint]
needs: [changes, lint]
runs-on: ubuntu-latest
strategy:
matrix:
@ -69,7 +86,7 @@ jobs:
unit_front:
name: 'unit_front (node: ${{ matrix.node }})'
needs: [lint]
needs: [changes, lint]
runs-on: ubuntu-latest
strategy:
matrix:
@ -88,13 +105,13 @@ jobs:
- uses: nrwl/nx-set-shas@v3
- run: yarn install --immutable
- name: Run build:ts for admin-test-utils
run: yarn build:ts --projects=@strapi/admin-test-utils --skip-nx-cache
run: yarn build --projects=@strapi/admin-test-utils,@strapi/helper-plugin --skip-nx-cache
- name: Run test
run: yarn nx affected --target=test:front --nx-ignore-cycles
build:
name: 'build (node: ${{ matrix.node }})'
needs: [lint, unit_front]
needs: [changes, lint, unit_front]
runs-on: ubuntu-latest
strategy:
matrix:
@ -113,8 +130,9 @@ jobs:
run: yarn build --projects=@strapi/admin,@strapi/helper-plugin
api_ce_pg:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[CE] API Integration (postgres, node: ${{ matrix.node }})'
strategy:
matrix:
@ -153,8 +171,9 @@ jobs:
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
api_ce_mysql:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[CE] API Integration (mysql:latest, client: ${{ matrix.db_client }}, node: ${{ matrix.node }})'
strategy:
matrix:
@ -192,8 +211,9 @@ jobs:
dbOptions: '--dbclient=${{ matrix.db_client }} --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
api_ce_mysql_5:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[CE] API Integration (mysql:5, client: ${{ matrix.db_client }} , node: ${{ matrix.node }})'
strategy:
matrix:
@ -230,8 +250,9 @@ jobs:
dbOptions: '--dbclient=${{ matrix.db_client }} --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
api_ce_sqlite:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[CE] API Integration (sqlite, client: ${{ matrix.sqlite_pkg }}, node: ${{ matrix.node }})'
strategy:
matrix:
@ -256,9 +277,9 @@ jobs:
# EE
api_ee_pg:
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[EE] API Integration (postgres, node: ${{ matrix.node }})'
if: github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:
@ -300,9 +321,9 @@ jobs:
api_ee_mysql:
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[EE] API Integration (mysql:latest, client: ${{ matrix.db_client }}, node: ${{ matrix.node }})'
if: github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:
@ -343,9 +364,9 @@ jobs:
api_ee_sqlite:
runs-on: ubuntu-latest
needs: [lint, unit_back, unit_front]
needs: [changes, lint, unit_back, unit_front]
name: '[EE] API Integration (sqlite, client: ${{ matrix.sqlite_pkg }}, node: ${{ matrix.node }})'
if: github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:

View File

@ -2,4 +2,3 @@
. "$(dirname -- "$0")/_/husky.sh"
yarn lint-staged
yarn nx affected:lint --uncommitted --nx-ignore-cycles

View File

@ -24,14 +24,14 @@
"@strapi/provider-upload-cloudinary": "4.10.1",
"@strapi/strapi": "4.10.1",
"@vscode/sqlite3": "5.1.2",
"better-sqlite3": "8.0.1",
"better-sqlite3": "8.3.0",
"lodash": "4.17.21",
"mysql": "2.18.1",
"mysql2": "3.2.0",
"passport-google-oauth2": "0.2.0",
"pg": "8.8.0",
"react": "^17.0.2",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"sqlite3": "5.1.2"
},
"strapi": {

View File

@ -13,7 +13,7 @@
"@strapi/plugin-i18n": "4.10.1",
"@strapi/plugin-users-permissions": "4.10.1",
"@strapi/strapi": "4.10.1",
"better-sqlite3": "8.0.1"
"better-sqlite3": "8.3.0"
},
"author": {
"name": "A Strapi developer"

12
jest.config.front.js Normal file
View File

@ -0,0 +1,12 @@
'use strict';
/** @type {import('jest').Config} */
const config = {
projects: [
'<rootDir>/packages/plugins/*/jest.config.front.js',
'<rootDir>/packages/core/*/jest.config.front.js',
'<rootDir>/scripts/*/jest.config.front.js',
],
};
module.exports = config;

15
jest.config.js Normal file
View File

@ -0,0 +1,15 @@
'use strict';
/** @type {import('jest').Config} */
const config = {
projects: [
'<rootDir>/packages/plugins/*/jest.config.js',
'<rootDir>/packages/utils/*/jest.config.js',
'<rootDir>/packages/generators/*/jest.config.js',
'<rootDir>/packages/core/*/jest.config.js',
'<rootDir>/packages/providers/*/jest.config.js',
'<rootDir>/.github/actions/*/jest.config.js',
],
};
module.exports = config;

50
lint-staged.config.js Normal file
View File

@ -0,0 +1,50 @@
'use strict';
const path = require('path');
const fs = require('fs');
const findUp = require('find-up');
const includes = ['packages', '.github'];
const root = path.resolve(__dirname);
function extractPackageName(pkgJsonPath) {
return JSON.parse(fs.readFileSync(pkgJsonPath).toString()).name;
}
function getLintCommand(files) {
const affectedFolders = new Set();
for (const file of files) {
const r = findUp.sync('package.json', { cwd: file });
const relPath = path.relative(root, r);
if (includes.some((incl) => relPath.startsWith(incl))) {
affectedFolders.add(r);
}
}
const affectedPackages = [...affectedFolders].map(extractPackageName);
if (affectedPackages.length === 0) {
return null;
}
return `nx run-many -t lint -p ${affectedPackages.join()}`;
}
function getCodeCommands(files) {
const lintCmd = getLintCommand(files);
const prettierCmd = `prettier --write ${files.join(' ')}`;
if (lintCmd) {
return [lintCmd, prettierCmd];
}
return [prettierCmd];
}
module.exports = {
'*.{js,ts}': getCodeCommands,
'*.{md,css,scss,yaml,yml}': ['prettier --write'],
};

View File

@ -29,12 +29,10 @@
"dependsOn": ["^build:ts"]
},
"test:unit": {
"inputs": ["default", "{workspaceRoot}/jest-preset.unit.js"],
"dependsOn": ["build:ts"]
"inputs": ["default", "{workspaceRoot}/jest-preset.unit.js"]
},
"test:front": {
"inputs": ["default", "{workspaceRoot}/jest-preset.front.js"],
"dependsOn": ["^build"]
"inputs": ["default", "{workspaceRoot}/jest-preset.front.js"]
},
"lint": {
"inputs": [
@ -44,8 +42,7 @@
"{projectRoot}/.eslintignore",
"{projectRoot}/tsconfig.eslint.json",
"{workspaceRoot}/packages/utils/eslint-config-custom/**/*"
],
"dependsOn": ["build:ts"]
]
}
},
"tasksRunnerOptions": {

View File

@ -45,23 +45,21 @@
"format:other": "yarn prettier:other --write",
"prettier:code": "prettier --cache --cache-strategy content \"**/*.{js,ts}\"",
"prettier:other": "prettier --cache --cache-strategy content \"**/*.{md,css,scss,yaml,yml}\"",
"test:front": "cross-env IS_EE=true nx run-many --target=test:front --nx-ignore-cycles",
"test:front:watch": "cross-env IS_EE=true nx run-many --target=test:front:watch --nx-ignore-cycles",
"test:front:update": "yarn test:front -u",
"test:front:ce": "cross-env IS_EE=false nx run-many --target=test:front --nx-ignore-cycles",
"test:front:watch:ce": "cross-env IS_EE=false nx run-many --target=test:front:watch --nx-ignore-cycles",
"test:front:all": "cross-env IS_EE=true nx run-many --target=test:front --nx-ignore-cycles",
"test:front": "cross-env IS_EE=true jest --config jest.config.front.js",
"test:front:watch": "cross-env IS_EE=true run test:front --watch",
"test:front:update": "run test:front -u",
"test:front:all:ce": "cross-env IS_EE=false nx run-many --target=test:front:ce --nx-ignore-cycles",
"test:front:ce": "cross-env IS_EE=false run test:front",
"test:front:watch:ce": "cross-env IS_EE=false run test:front --watch",
"test:front:update:ce": "yarn test:front:ce -u",
"test:unit": "nx run-many --target=test:unit --nx-ignore-cycles",
"test:unit:watch": "nx run-many --target=test:unit:watch --nx-ignore-cycles",
"test:unit:all": "nx run-many --target=test:unit --nx-ignore-cycles",
"test:unit": "jest --config jest.config.js",
"test:unit:watch": "run test:unit --watch",
"test:api": "node test/api.js",
"test:generate-app": "node test/create-test-app.js",
"doc:api": "node scripts/open-api/serve.js"
},
"lint-staged": {
"*.{js,ts,md,css,scss,yaml,yml}": [
"prettier --write"
]
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/eslint-parser": "^7.19.1",
@ -71,12 +69,12 @@
"@swc/cli": "0.1.62",
"@swc/core": "1.3.37",
"@swc/jest": "0.2.24",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "5.43.0",
"@typescript-eslint/eslint-plugin": "5.59.1",
"@typescript-eslint/parser": "5.59.1",
"babel-eslint": "10.1.0",
"chalk": "4.1.2",
"chokidar": "3.5.3",
"core-js": "3.28.0",
"core-js": "3.30.1",
"cross-env": "7.0.3",
"dotenv": "14.2.0",
"eslint": "8.27.0",
@ -91,6 +89,7 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"execa": "1.0.0",
"find-up": "5.0.0",
"fs-extra": "10.1.0",
"get-port": "5.1.1",
"glob": "7.2.3",
@ -98,7 +97,7 @@
"inquirer": "8.2.5",
"jest": "29.0.3",
"jest-circus": "29.0.3",
"jest-cli": "29.0.3",
"jest-cli": "29.5.0",
"jest-environment-jsdom": "29.0.3",
"jest-watch-typeahead": "2.2.2",
"lerna": "6.5.1",

View File

@ -477,7 +477,7 @@
"content-manager.components.DraggableCard.edit.field": "Modifier {item}",
"content-manager.components.DraggableCard.move.field": "Déplacer {item}",
"content-manager.components.DynamicTable.row-line": "ligne {number}",
"content-manager.components.DynamicZone.ComponentPicker-label": "Choisir un compoosant",
"content-manager.components.DynamicZone.ComponentPicker-label": "Choisir un composant",
"content-manager.components.DynamicZone.add-component": "Ajouter un composant à {componentName}",
"content-manager.components.DynamicZone.delete-label": "Supprimer {name}",
"content-manager.components.DynamicZone.error-message": "Le composant contient une ou des erreurs",

View File

@ -95,7 +95,7 @@ const redirectWithAuth = (ctx) => {
params: { provider },
} = ctx;
const redirectUrls = utils.getPrefixedRedirectUrls();
const domain = strapi.config.get('server.admin.auth.domain');
const domain = strapi.config.get('admin.auth.domain');
const { user } = ctx.state;
const jwt = getService('token').createJwtToken(user);

View File

@ -119,7 +119,7 @@ module.exports = ({ strapi }) => {
async register() {
extendReviewWorkflowContentTypes({ strapi });
strapi.hook('strapi::content-types.afterSync').register(enableReviewWorkflow({ strapi }));
strapi.hook('strapi::content-types.beforeSync').register(persistStagesJoinTables({ strapi }));
strapi.hook('strapi::content-types.afterSync').register(persistStagesJoinTables({ strapi }));
},
};
};

View File

@ -3,4 +3,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
collectCoverageFrom: ['<rootDir>/packages/core/admin/admin/**/*.js'],
displayName: 'Core admin',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core admin',
};

View File

@ -117,7 +117,7 @@
"react-error-boundary": "3.1.4",
"react-fast-compare": "^3.2.0",
"react-helmet": "^6.1.0",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-is": "^17.0.2",
"react-query": "3.24.3",
"react-redux": "8.0.5",

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core content-manager',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'Core content-type-builder',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core content-type-builder',
};

View File

@ -34,7 +34,6 @@
"@strapi/generators": "4.10.1",
"@strapi/helper-plugin": "4.10.1",
"@strapi/icons": "1.6.6",
"@strapi/strapi": "4.10.1",
"@strapi/utils": "4.10.1",
"fs-extra": "10.0.0",
"immer": "9.0.19",
@ -43,7 +42,7 @@
"prop-types": "^15.7.2",
"qs": "6.11.1",
"react-helmet": "^6.1.0",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-redux": "8.0.5",
"redux": "^4.2.1",
"reselect": "^4.1.7",

View File

@ -6,4 +6,5 @@ module.exports = {
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Core data-transfer',
};

View File

@ -50,8 +50,7 @@
"stream-json": "1.7.4",
"tar": "6.1.13",
"tar-stream": "2.2.0",
"uuid": "9.0.0",
"ws": "8.11.0"
"ws": "8.13.0"
},
"devDependencies": {
"@tsconfig/node16": "1.0.3",
@ -64,7 +63,6 @@
"@types/stream-json": "1.7.3",
"@types/tar": "6.1.4",
"@types/tar-stream": "2.2.2",
"@types/uuid": "9.0.0",
"@types/ws": "^8.5.4",
"knex": "2.4.0",
"koa": "2.13.4",

View File

@ -727,6 +727,9 @@ class TransferEngine<
async transferAssets(): Promise<void> {
const stage: TransferStage = 'assets';
if (this.shouldSkipStage(stage)) {
return;
}
const source = await this.sourceProvider.createAssetsReadStream?.();
const destination = await this.destinationProvider.createAssetsWriteStream?.();

View File

@ -156,10 +156,16 @@ class LocalStrapiDestinationProvider implements IDestinationProvider {
`uploads_backup_${Date.now()}`
);
await fse.move(assetsDirectory, backupDirectory);
await fse.mkdir(assetsDirectory);
// Create a .gitkeep file to ensure the directory is not empty
await fse.outputFile(path.join(assetsDirectory, '.gitkeep'), '');
try {
await fse.move(assetsDirectory, backupDirectory);
await fse.mkdir(assetsDirectory);
// Create a .gitkeep file to ensure the directory is not empty
await fse.outputFile(path.join(assetsDirectory, '.gitkeep'), '');
} catch (err) {
throw new ProviderTransferError(
'The backup folder for the assets could not be created inside the public folder. Please ensure Strapi has write permissions on the public directory'
);
}
return new Writable({
objectMode: true,

View File

@ -1,5 +1,5 @@
import { WebSocket } from 'ws';
import { v4 } from 'uuid';
import { randomUUID } from 'crypto';
import { Writable } from 'stream';
import { once } from 'lodash/fp';
@ -336,7 +336,7 @@ class RemoteStrapiDestinationProvider implements IDestinationProvider {
hasStarted = true;
const assetID = v4();
const assetID = randomUUID();
const { filename, filepath, stats, stream } = asset;
try {

View File

@ -1,4 +1,4 @@
import { v4 } from 'uuid';
import { randomUUID } from 'crypto';
import { RawData, WebSocket } from 'ws';
import type { client, server } from '../../../types/remote/protocol';
@ -28,7 +28,7 @@ export const createDispatcher = (ws: WebSocket) => {
}
return new Promise<U | null>((resolve, reject) => {
const uuid = v4();
const uuid = randomUUID();
const payload = { ...message, uuid };
if (options.attachTransfer) {

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core database',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'Core email',
};

View File

@ -33,7 +33,7 @@
"@strapi/utils": "4.10.1",
"lodash": "4.17.21",
"prop-types": "^15.7.2",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"yup": "^0.32.9"
},
"devDependencies": {

View File

@ -1,4 +1,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
collectCoverageFrom: ['<rootDir>/packages/core/helper-plugin/src/**/*.js'],
displayName: 'Helper plugin',
};

View File

@ -52,7 +52,7 @@
"prop-types": "^15.7.2",
"qs": "6.11.1",
"react-helmet": "^6.1.0",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-select": "5.7.0"
},
"devDependencies": {

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core permissions',
};

View File

@ -90,7 +90,6 @@ pids
logs
results
build
!**/lib/commands/actions/build
node_modules
.node_history
package-lock.json

View File

@ -98,5 +98,3 @@ __tests__
jest.config.js
testApp
coverage
!**/lib/commands/actions/build

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core Strapi',
};

View File

@ -11,5 +11,5 @@ module.exports = ({ command }) => {
.command('build')
.option('--no-optimization', 'Build the admin app without optimizing assets')
.description('Build the strapi admin app')
.action(getLocalScript('build'));
.action(getLocalScript('build-command')); // build-command dir to avoid problems with 'build' being commonly ignored
};

View File

@ -106,12 +106,30 @@ const primaryProcess = async ({ distDir, appDir, build, isTSProject, watchAdmin,
cluster.fork();
};
const workerProcess = ({ appDir, distDir, watchAdmin, polling, isTSProject }) => {
const strapiInstance = strapi({
const workerProcess = async ({ appDir, distDir, watchAdmin, polling, isTSProject }) => {
const strapiInstance = await strapi({
distDir,
autoReload: true,
serveAdminPanel: !watchAdmin,
});
}).load();
/**
* TypeScript automatic type generation upon dev server restart
* Its implementation, configuration and behavior can change in future releases
* @experimental
*/
const shouldGenerateTypeScriptTypes = strapiInstance.config.get('typescript.autogenerate', false);
if (shouldGenerateTypeScriptTypes) {
// This is run in an uncaught promise on purpose so that it doesn't block Strapi startup
// NOTE: We should probably add some configuration options to manage the file structure output or the verbosity level
tsUtils.generators.generateSchemasDefinitions({
strapi: strapiInstance,
outDir: appDir,
verbose: false,
silent: true,
});
}
const adminWatchIgnoreFiles = strapiInstance.config.get('admin.watchIgnoreFiles', []);
watchFileChanges({
@ -179,6 +197,7 @@ function watchFileChanges({ appDir, strapiInstance, watchIgnoreFiles, polling })
'**/*.db*',
'**/exports/**',
'**/dist/**',
'**/*.d.ts',
...watchIgnoreFiles,
],
});

View File

@ -4,7 +4,7 @@ const { resolve } = require('path');
const fse = require('fs-extra');
const chalk = require('chalk');
const fetch = require('node-fetch');
const { v4: uuidv4 } = require('uuid');
const { randomUUID } = require('crypto');
const machineID = require('../../../../utils/machine-id');
const readPackageJSON = async (path) => {
@ -36,7 +36,7 @@ const generateNewPackageJSON = (packageObj) => {
return {
...packageObj,
strapi: {
uuid: uuidv4(),
uuid: randomUUID(),
telemetryDisabled: false,
},
};
@ -45,7 +45,7 @@ const generateNewPackageJSON = (packageObj) => {
...packageObj,
strapi: {
...packageObj.strapi,
uuid: packageObj.strapi.uuid ? packageObj.strapi.uuid : uuidv4(),
uuid: packageObj.strapi.uuid ? packageObj.strapi.uuid : randomUUID(),
telemetryDisabled: false,
},
};

View File

@ -5,7 +5,7 @@ const { Command } = require('commander');
const strapiCommands = {
'admin/create-user': require('./actions/admin/create-user/command'),
'admin/reset-user-password': require('./actions/admin/reset-user-password/command'),
build: require('./actions/build/command'),
build: require('./actions/build-command/command'), // in 'build-command' to avoid problems with 'build' being commonly ignored
'configuration/dump': require('./actions/configuration/dump/command'),
'configuration/restore': require('./actions/configuration/restore/command'),
console: require('./actions/console/command'),

View File

@ -1,14 +1,14 @@
'use strict';
const { machineIdSync } = require('node-machine-id');
const { v4: uuidv4 } = require('uuid');
const { randomUUID } = require('crypto');
module.exports = () => {
try {
const deviceId = machineIdSync();
return deviceId;
} catch (error) {
const deviceId = uuidv4();
const deviceId = randomUUID();
return deviceId;
}
};

View File

@ -132,8 +132,7 @@
"qs": "6.11.1",
"resolve-cwd": "3.0.0",
"semver": "7.3.8",
"statuses": "2.0.1",
"uuid": "^8.3.2"
"statuses": "2.0.1"
},
"devDependencies": {
"supertest": "6.3.3",

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'Core upload',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Core upload',
};

View File

@ -46,7 +46,7 @@
"react-copy-to-clipboard": "^5.1.0",
"react-dnd": "15.1.2",
"react-helmet": "^6.1.0",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-query": "3.24.3",
"react-redux": "8.0.5",
"react-select": "5.7.0",

View File

@ -3,4 +3,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
testMatch: ['<rootDir>/**/*.test.js'],
displayName: 'Core utils',
};

View File

@ -53,8 +53,7 @@
"node-machine-id": "^1.1.10",
"ora": "^5.4.1",
"semver": "7.3.8",
"tar": "6.1.13",
"uuid": "^8.3.2"
"tar": "6.1.13"
},
"engines": {
"node": ">=14.19.1 <=18.x.x",

View File

@ -9,6 +9,7 @@ import _ from 'lodash';
import stopProcess from './utils/stop-process';
import { trackUsage, captureStderr } from './utils/usage';
import mergeTemplate from './utils/merge-template.js';
import tryGitInit from './utils/git';
import packageJSON from './resources/json/common/package.json';
import { createDatabaseConfig, generateDbEnvariables } from './resources/templates/database';
@ -184,6 +185,12 @@ export default async function createProject(
await trackUsage({ event: 'didCreateProject', scope });
// Init git
if (await tryGitInit(rootPath)) {
console.log('Initialized a git repository.');
console.log();
}
console.log();
console.log(`Your application was created at ${chalk.green(rootPath)}.\n`);

View File

@ -3,7 +3,6 @@ import { readFileSync } from 'node:fs';
import os from 'node:os';
import readline from 'node:readline';
import crypto from 'crypto';
import { v4 as uuidv4 } from 'uuid';
import * as sentry from '@sentry/node';
import hasYarn from './utils/has-yarn';
import checkRequirements from './utils/check-requirements';
@ -44,7 +43,7 @@ export const generateNewApp = (projectDirectory: string, options: Partial<NewOpt
template: options.template,
starter: options.starter,
},
uuid: (process.env.STRAPI_UUID_PREFIX || '') + uuidv4(),
uuid: (process.env.STRAPI_UUID_PREFIX || '') + crypto.randomUUID(),
docker: process.env.DOCKER === 'true',
deviceId: machineID(),
tmpPath,

View File

@ -0,0 +1,34 @@
import execa from 'execa';
async function isInGitRepository(rootDir: string) {
try {
await execa('git', ['rev-parse', '--is-inside-work-tree'], { stdio: 'ignore', cwd: rootDir });
return true;
} catch (_) {
return false;
}
}
async function isInMercurialRepository(rootDir: string) {
try {
await execa('hg', ['-cwd', '.', 'root'], { stdio: 'ignore', cwd: rootDir });
return true;
} catch (_) {
return false;
}
}
export default async function tryGitInit(rootDir: string) {
try {
await execa('git', ['--version'], { stdio: 'ignore' });
if ((await isInGitRepository(rootDir)) || (await isInMercurialRepository(rootDir))) {
return false;
}
await execa('git', ['init'], { stdio: 'ignore', cwd: rootDir });
return true;
} catch (_) {
return false;
}
}

View File

@ -1,12 +1,12 @@
import { machineIdSync } from 'node-machine-id';
import { v4 as uuidv4 } from 'uuid';
import { randomUUID } from 'crypto';
export default () => {
try {
const deviceId = machineIdSync();
return deviceId;
} catch (error) {
const deviceId = uuidv4();
const deviceId = randomUUID();
return deviceId;
}
};

View File

@ -6,4 +6,5 @@ module.exports = {
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Generators',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'Color picker plugin',
};

View File

@ -14,7 +14,7 @@
"@strapi/icons": "1.6.6",
"prop-types": "^15.7.2",
"react-colorful": "5.6.1",
"react-intl": "6.3.2"
"react-intl": "6.4.1"
},
"devDependencies": {
"@testing-library/react": "12.1.4",

View File

@ -4,7 +4,7 @@ import { rest } from 'msw';
const handlers = [
rest.get('*/getInfos', (req, res, ctx) => {
return res(
ctx.delay(1000),
ctx.delay(100),
ctx.status(200),
ctx.json({
currentVersion: '1.0.0',

View File

@ -56,6 +56,34 @@ describe('Plugin | Documentation | SettingsPage', () => {
});
expect(firstChild).toMatchInlineSnapshot(`
.c1 {
background: #f6f6f9;
padding-top: 40px;
padding-right: 56px;
padding-bottom: 40px;
padding-left: 56px;
}
.c3 {
min-width: 0;
}
.c7 {
background: #4945ff;
padding: 8px;
padding-right: 16px;
padding-left: 16px;
border-radius: 4px;
border-color: #4945ff;
border: 1px solid #4945ff;
cursor: pointer;
}
.c13 {
padding-right: 56px;
padding-left: 56px;
}
.c14 {
background: #ffffff;
padding-top: 24px;
@ -66,46 +94,196 @@ describe('Plugin | Documentation | SettingsPage', () => {
box-shadow: 0px 1px 4px rgba(33,33,52,0.1);
}
.c11 {
font-weight: 600;
color: #32324d;
font-size: 0.75rem;
line-height: 1.33;
}
.c8 {
padding-right: 8px;
}
.c5 {
.c25 {
background: #f6f6f9;
padding: 4px;
border-radius: 4px;
border-style: solid;
border-width: 1px;
border-color: #dcdce4;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
cursor: pointer;
padding: 8px;
}
.c27 {
padding-right: 12px;
padding-left: 12px;
border-radius: 4px;
background: #ffffff;
border: 1px solid #dcdce4;
}
.c2 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
.c4 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
.c8 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
gap: 8px;
}
.c15 {
-webkit-align-items: stretch;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
align-items: stretch;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 16px;
}
.c20 {
-webkit-align-items: stretch;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
align-items: stretch;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 4px;
}
.c28 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.c6 {
font-weight: 600;
font-size: 2rem;
line-height: 1.25;
color: #32324d;
}
.c11 {
font-size: 0.75rem;
line-height: 1.33;
font-weight: 600;
color: #ffffff;
}
.c12 {
font-size: 1rem;
line-height: 1.5;
color: #666687;
}
.c16 {
font-weight: 500;
font-size: 1rem;
line-height: 1.25;
color: #32324d;
}
.c21 {
font-size: 0.75rem;
line-height: 1.33;
font-weight: 600;
color: #32324d;
}
.c30 {
font-size: 0.75rem;
line-height: 1.33;
font-weight: 600;
color: #b72b1a;
text-transform: uppercase;
}
.c32 {
font-size: 0.75rem;
line-height: 1.33;
font-weight: 600;
color: #666687;
text-transform: uppercase;
}
.c34 {
font-size: 0.75rem;
line-height: 1.33;
color: #666687;
}
.c9 {
position: relative;
outline: none;
}
.c5 svg {
.c9 svg {
height: 12px;
width: 12px;
}
.c5 svg > g,
.c5 svg path {
.c9 svg > g,
.c9 svg path {
fill: #ffffff;
}
.c5[aria-disabled='true'] {
.c9[aria-disabled='true'] {
pointer-events: none;
}
.c5:after {
.c9:after {
-webkit-transition-property: all;
transition-property: all;
-webkit-transition-duration: 0.2s;
@ -120,11 +298,11 @@ describe('Plugin | Documentation | SettingsPage', () => {
border: 2px solid transparent;
}
.c5:focus-visible {
.c9:focus-visible {
outline: none;
}
.c5:focus-visible:after {
.c9:focus-visible:after {
border-radius: 8px;
content: '';
position: absolute;
@ -135,164 +313,6 @@ describe('Plugin | Documentation | SettingsPage', () => {
border: 2px solid #4945ff;
}
.c9 {
height: 100%;
}
.c6 {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
padding: 8px 16px;
background: #4945ff;
border: none;
border: 1px solid #4945ff;
background: #4945ff;
}
.c6 .c7 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c6 .c10 {
color: #ffffff;
}
.c6[aria-disabled='true'] {
border: 1px solid #dcdce4;
background: #eaeaef;
}
.c6[aria-disabled='true'] .c10 {
color: #666687;
}
.c6[aria-disabled='true'] svg > g,
.c6[aria-disabled='true'] svg path {
fill: #666687;
}
.c6[aria-disabled='true']:active {
border: 1px solid #dcdce4;
background: #eaeaef;
}
.c6[aria-disabled='true']:active .c10 {
color: #666687;
}
.c6[aria-disabled='true']:active svg > g,
.c6[aria-disabled='true']:active svg path {
fill: #666687;
}
.c6:hover {
border: 1px solid #7b79ff;
background: #7b79ff;
}
.c6:active {
border: 1px solid #4945ff;
background: #4945ff;
}
.c15 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.c15 > * {
margin-top: 0;
margin-bottom: 0;
}
.c15 > * + * {
margin-top: 16px;
}
.c22 {
font-weight: 600;
color: #32324d;
font-size: 0.75rem;
line-height: 1.33;
}
.c29 {
font-weight: 600;
color: #b72b1a;
font-size: 0.75rem;
line-height: 1.33;
}
.c33 {
color: #666687;
font-size: 0.75rem;
line-height: 1.33;
}
.c25 {
background: #ffffff;
border-radius: 4px;
}
.c27 {
background: #fcecea;
padding-right: 32px;
padding-left: 32px;
}
.c30 {
background: #ffffff;
padding-right: 32px;
padding-left: 32px;
}
.c21 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c20 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.c20 > * {
margin-top: 0;
margin-bottom: 0;
}
.c20 > * + * {
margin-top: 4px;
}
.c24 {
border: 0;
-webkit-clip: rect(0 0 0 0);
@ -305,19 +325,89 @@ describe('Plugin | Documentation | SettingsPage', () => {
width: 1px;
}
.c10 {
height: 2rem;
}
.c10[aria-disabled='true'] {
border: 1px solid #dcdce4;
background: #eaeaef;
}
.c10[aria-disabled='true'] .c5 {
color: #666687;
}
.c10[aria-disabled='true'] svg > g,.c10[aria-disabled='true'] svg path {
fill: #666687;
}
.c10[aria-disabled='true']:active {
border: 1px solid #dcdce4;
background: #eaeaef;
}
.c10[aria-disabled='true']:active .c5 {
color: #666687;
}
.c10[aria-disabled='true']:active svg > g,.c10[aria-disabled='true']:active svg path {
fill: #666687;
}
.c10:hover {
border: 1px solid #7b79ff;
background: #7b79ff;
}
.c10:active {
border: 1px solid #4945ff;
background: #4945ff;
}
.c10 svg > g,
.c10 svg path {
fill: #ffffff;
}
.c22 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c17 {
display: grid;
grid-template-columns: repeat(12,1fr);
gap: 16px;
}
.c18 {
grid-column: span 6;
max-width: 100%;
}
.c0:focus-visible {
outline: none;
}
.c23 {
position: relative;
display: inline-block;
z-index: 0;
width: 100%;
}
.c26 {
height: 2.5rem;
border: 1px solid #dcdce4;
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
overflow: hidden;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
outline: none;
box-shadow: 0;
-webkit-transition-property: border-color,box-shadow,fill;
@ -331,109 +421,50 @@ describe('Plugin | Documentation | SettingsPage', () => {
box-shadow: #4945ff 0px 0px 0px 2px;
}
.c29 {
background-color: #ffffff;
border: 1px solid #dcdce4;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 2;
-webkit-flex: 1 1 50%;
-ms-flex: 1 1 50%;
flex: 1 1 50%;
padding-top: 6px;
padding-bottom: 6px;
}
.c31 {
text-transform: uppercase;
background-color: transparent;
border: 1px solid #f6f6f9;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 2;
-webkit-flex: 1 1 50%;
-ms-flex: 1 1 50%;
flex: 1 1 50%;
padding-top: 6px;
padding-bottom: 6px;
}
.c28 {
text-transform: uppercase;
border-right: 1px solid #dcdce4;
position: relative;
z-index: 2;
}
.c32 {
.c33 {
height: 100%;
left: 0;
opacity: 0;
position: absolute;
top: 0;
z-index: 1;
left: 4px;
top: 4px;
width: 100%;
}
.c19 {
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.c16 {
color: #32324d;
font-weight: 500;
font-size: 1rem;
line-height: 1.25;
}
.c1 {
background: #f6f6f9;
padding-top: 40px;
padding-right: 56px;
padding-bottom: 40px;
padding-left: 56px;
}
.c13 {
padding-right: 56px;
padding-left: 56px;
}
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c3 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.c4 {
color: #32324d;
font-weight: 600;
font-size: 2rem;
line-height: 1.25;
}
.c12 {
color: #666687;
font-size: 1rem;
line-height: 1.5;
}
.c0:focus-visible {
outline: none;
}
.c17 {
display: grid;
grid-template-columns: repeat(12,1fr);
gap: 16px;
}
.c18 {
grid-column: span 6;
max-width: 320px;
}
@media (max-width:68.75rem) {
@ -469,45 +500,45 @@ describe('Plugin | Documentation | SettingsPage', () => {
class="c2"
>
<div
class="c3"
class="c3 c4"
>
<h1
class="c4"
class="c5 c6"
>
Documentation
</h1>
</div>
<button
aria-disabled="false"
class="c5 c6"
class="c7 c8 c9 c10"
type="submit"
>
<div
aria-hidden="true"
class="c7 c8 c9"
class=""
>
<svg
fill="none"
height="1em"
height="1rem"
viewBox="0 0 24 24"
width="1em"
width="1rem"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20.727 2.97a.2.2 0 01.286 0l2.85 2.89a.2.2 0 010 .28L9.554 20.854a.2.2 0 01-.285 0l-9.13-9.243a.2.2 0 010-.281l2.85-2.892a.2.2 0 01.284 0l6.14 6.209L20.726 2.97z"
d="M20.727 2.97a.2.2 0 0 1 .286 0l2.85 2.89a.2.2 0 0 1 0 .28L9.554 20.854a.2.2 0 0 1-.285 0l-9.13-9.243a.2.2 0 0 1 0-.281l2.85-2.892a.2.2 0 0 1 .284 0l6.14 6.209L20.726 2.97Z"
fill="#212134"
/>
</svg>
</div>
<span
class="c10 c11"
class="c5 c11"
>
Save
</span>
</button>
</div>
<p
class="c12"
class="c5 c12"
>
Configure the documentation plugin
</p>
@ -523,7 +554,7 @@ describe('Plugin | Documentation | SettingsPage', () => {
class="c15"
>
<h2
class="c16"
class="c5 c16"
>
Settings
</h2>
@ -543,11 +574,11 @@ describe('Plugin | Documentation | SettingsPage', () => {
class="c20"
>
<div
class="c21"
class="c4"
>
<label
class="c22"
for="field-1"
class="c5 c21 c22"
for="1"
>
Restricted Access
</label>
@ -562,38 +593,42 @@ describe('Plugin | Documentation | SettingsPage', () => {
</div>
<div
class="c25 c26"
display="flex"
>
<div
aria-hidden="true"
class="c27 c21 c28"
class="c27 c28 c29"
>
<span
class="c29"
class="c5 c30"
>
Off
</span>
</div>
<div
aria-hidden="true"
class="c30 c21 c31"
class="c27 c28 c31"
>
<span
class="c22"
class="c5 c32"
>
On
</span>
</div>
<input
aria-describedby="1-hint"
aria-disabled="false"
class="c32"
aria-required="false"
class="c33"
id="1"
name="restrictedAccess"
type="checkbox"
/>
</div>
</label>
<p
class="c33"
id="field-1-hint"
class="c5 c34"
id="1-hint"
>
Make the documentation endpoint private
</p>

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'Documentation plugin',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Documentation plugin',
};

View File

@ -22,7 +22,12 @@
],
"scripts": {
"lint": "run -T eslint .",
"test:unit": "jest --verbose"
"test:unit": "jest --verbose",
"test:unit:watch": "run -T jest --watch",
"test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js",
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
"test:front:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js",
"test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
},
"dependencies": {
"@strapi/design-system": "1.6.6",
@ -40,7 +45,7 @@
"pluralize": "8.0.0",
"react-copy-to-clipboard": "^5.1.0",
"react-helmet": "^6.1.0",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-query": "3.24.3",
"react-redux": "8.0.5",
"redux": "^4.2.1",

View File

@ -89,11 +89,6 @@ describe('i18n | middlewares | addCommonFieldsToInitialDataMiddleware', () => {
expect(nextAction).toEqual({
type: 'ContentManager/CrudReducer/INIT_FORM',
rawQuery: '?plugins[i18n][relatedEntityId]=1',
data: {
name: 'test',
localizations: ['test'],
common: 'test',
},
});
});
});

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'I18N plugin',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'I18N plugin',
};

View File

@ -23,6 +23,10 @@
"scripts": {
"test:unit": "run -T jest",
"test:unit:watch": "run -T jest --watch",
"test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js",
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
"test:front:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js",
"test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
"lint": "run -T eslint ."
},
"dependencies": {
@ -35,7 +39,7 @@
"lodash": "4.17.21",
"prop-types": "^15.7.2",
"qs": "6.11.1",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-query": "3.24.3",
"react-redux": "8.0.5",
"redux": "^4.2.1",

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Sentry plugin',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.front.js',
displayName: 'Users & Permissions plugin',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Users & Permissions plugin',
};

View File

@ -44,7 +44,7 @@
"lodash": "4.17.21",
"prop-types": "^15.7.2",
"purest": "4.0.2",
"react-intl": "6.3.2",
"react-intl": "6.4.1",
"react-query": "3.24.3",
"react-redux": "8.0.5",
"url-join": "4.0.1",

View File

@ -5,4 +5,5 @@ module.exports = {
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Mailgun email provider',
};

View File

@ -5,4 +5,5 @@ module.exports = {
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'S3 upload provider',
};

View File

@ -5,4 +5,5 @@ module.exports = {
transform: {
'^.+\\.ts$': ['@swc/jest'],
},
displayName: 'Local upload provider',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../../jest-preset.unit.js',
displayName: 'Typescript utils',
};

View File

@ -2,4 +2,5 @@
module.exports = {
preset: '../../jest-preset.front.js',
displayName: 'Front scripts',
};

1143
yarn.lock

File diff suppressed because it is too large Load Diff