mirror of
https://github.com/strapi/strapi.git
synced 2025-06-27 00:41:25 +00:00
Expand nx usage and migrate logger to ts (#15957)
This commit is contained in:
parent
edc2bdcecd
commit
aaeb988a0b
@ -1,18 +0,0 @@
|
|||||||
**/node_modules/**
|
|
||||||
**/build/**
|
|
||||||
**/dist/**
|
|
||||||
**/OLD/**
|
|
||||||
testApp/**
|
|
||||||
examples/**
|
|
||||||
cypress/**
|
|
||||||
packages/generators/generators/lib/files/
|
|
||||||
packages/generators/app/lib/resources/files/
|
|
||||||
packages/core/admin/admin/src/plugins.js
|
|
||||||
packages/core/helper-plugin/build/**
|
|
||||||
packages/core/helper-plugin/lib/src/old/components/**
|
|
||||||
packages/core/helper-plugin/lib/src/testUtils/**
|
|
||||||
packages/core/helper-plugin/lib/src/utils/**
|
|
||||||
packages/core/data-transfer/lib
|
|
||||||
.eslintrc.js
|
|
||||||
.eslintrc.front.js
|
|
||||||
.eslintrc.back.js
|
|
@ -1,19 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
project: './tsconfig.eslint.json',
|
|
||||||
},
|
|
||||||
plugins: ['@typescript-eslint'],
|
|
||||||
// TODO: This should be turned on but causes hundreds of violations in .d.ts files throughout Strapi that would need to be fixed
|
|
||||||
// extends: ['@strapi/eslint-config/typescript'],
|
|
||||||
globals: {
|
|
||||||
strapi: false,
|
|
||||||
},
|
|
||||||
// Instead of extending (which includes values that interfere with this configuration), only take the rules field
|
|
||||||
rules: {
|
|
||||||
...require('./.eslintrc.back.js').rules,
|
|
||||||
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts'] }],
|
|
||||||
},
|
|
||||||
};
|
|
42
.eslintrc.js
42
.eslintrc.js
@ -1,42 +0,0 @@
|
|||||||
const frontPaths = [
|
|
||||||
'packages/**/admin/src/**/*.js',
|
|
||||||
'packages/generators/app/lib/resources/files/admin/app.js',
|
|
||||||
'packages/**/ee/admin/**/*.js',
|
|
||||||
'packages/core/helper-plugin/**/*.js',
|
|
||||||
'packages/**/tests/front/**/*.js',
|
|
||||||
'test/config/front/**/*.js',
|
|
||||||
];
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
// Backend javascript
|
|
||||||
{
|
|
||||||
files: ['packages/**/*.js', 'test/**/*.js', 'scripts/**/*.js', 'jest.*.js'],
|
|
||||||
excludedFiles: frontPaths,
|
|
||||||
...require('./.eslintrc.back.js'),
|
|
||||||
},
|
|
||||||
|
|
||||||
// Backend typescript
|
|
||||||
{
|
|
||||||
files: ['packages/**/*.ts', 'test/**/*.ts', 'scripts/**/*.ts', 'jest.*.ts'],
|
|
||||||
excludedFiles: [...frontPaths, '**/*.d.ts'],
|
|
||||||
...require('./.eslintrc.back.typescript.js'),
|
|
||||||
},
|
|
||||||
|
|
||||||
// Type definitions
|
|
||||||
{
|
|
||||||
files: ['packages/**/*.d.ts', 'test/**/*.d.ts', 'scripts/**/*.d.ts'],
|
|
||||||
excludedFiles: frontPaths,
|
|
||||||
...require('./.eslintrc.back.type-definitions.js'),
|
|
||||||
},
|
|
||||||
|
|
||||||
// Frontend
|
|
||||||
{
|
|
||||||
files: frontPaths,
|
|
||||||
...require('./.eslintrc.front.js'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
3
.github/actions/check-pr-status/.eslintignore
vendored
Normal file
3
.github/actions/check-pr-status/.eslintignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
||||||
|
dist/
|
4
.github/actions/check-pr-status/.eslintrc.js
vendored
Normal file
4
.github/actions/check-pr-status/.eslintrc.js
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -1,10 +1,11 @@
|
|||||||
const action = require('../index');
|
'use strict';
|
||||||
|
|
||||||
jest.mock('@actions/github');
|
jest.mock('@actions/github');
|
||||||
jest.mock('@actions/core');
|
jest.mock('@actions/core');
|
||||||
|
|
||||||
const github = require('@actions/github');
|
const github = require('@actions/github');
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
|
const action = require('../index');
|
||||||
|
|
||||||
test.each(action.BLOCKING_LABELS)('Test blocking labels %s', async (label) => {
|
test.each(action.BLOCKING_LABELS)('Test blocking labels %s', async (label) => {
|
||||||
github.context = {
|
github.context = {
|
||||||
|
10
.github/actions/check-pr-status/dist/index.js
vendored
10
.github/actions/check-pr-status/dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
.github/actions/check-pr-status/index.js
vendored
2
.github/actions/check-pr-status/index.js
vendored
@ -1,3 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
const github = require('@actions/github');
|
const github = require('@actions/github');
|
||||||
|
|
||||||
|
9
.github/actions/check-pr-status/package.json
vendored
9
.github/actions/check-pr-status/package.json
vendored
@ -6,11 +6,14 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "NODE_ENV=production ncc build index.js -o dist --minify",
|
"build": "NODE_ENV=production ncc build index.js -o dist --minify",
|
||||||
"watch": "NODE_ENV=production ncc build index.js -w -o dist --minify"
|
"watch": "NODE_ENV=production ncc build index.js -w -o dist --minify",
|
||||||
|
"lint": "eslint ."
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "1.10.0",
|
||||||
|
"@actions/github": "5.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/core": "1.10.0",
|
|
||||||
"@actions/github": "5.1.1",
|
|
||||||
"@vercel/ncc": "0.36.1"
|
"@vercel/ncc": "0.36.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
39
.github/workflows/tests.yml
vendored
39
.github/workflows/tests.yml
vendored
@ -15,6 +15,7 @@ concurrency:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
actions: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@ -25,6 +26,8 @@ jobs:
|
|||||||
node: [14, 16, 18]
|
node: [14, 16, 18]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
@ -32,12 +35,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: '**/node_modules'
|
path: '**/node_modules'
|
||||||
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
- uses: nrwl/nx-set-shas@v3
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- name: Build TypeScript packages # for lint we need to build ts, for rules checking if paths exist
|
|
||||||
run: yarn build:ts
|
|
||||||
- name: Run lint
|
- name: Run lint
|
||||||
run: yarn run -s lint
|
run: yarn nx affected --target=lint --parallel --nx-ignore-cycles
|
||||||
|
|
||||||
unit_back:
|
unit_back:
|
||||||
name: 'unit_back (node: ${{ matrix.node }})'
|
name: 'unit_back (node: ${{ matrix.node }})'
|
||||||
@ -48,6 +49,8 @@ jobs:
|
|||||||
node: [14, 16, 18]
|
node: [14, 16, 18]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
@ -55,18 +58,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: '**/node_modules'
|
path: '**/node_modules'
|
||||||
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
- uses: nrwl/nx-set-shas@v3
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- name: Build TypeScript packages # for unit tests we need to build ts, for finding and mocking ts packages
|
|
||||||
run: yarn build:ts
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: yarn run -s test:unit --coverage
|
run: yarn nx affected --target=test:unit --nx-ignore-cycles
|
||||||
- name: Upload coverage to Codecov
|
|
||||||
uses: codecov/codecov-action@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
directory: ./coverage
|
|
||||||
flags: back,unit_back
|
|
||||||
|
|
||||||
unit_front:
|
unit_front:
|
||||||
name: 'unit_front (node: ${{ matrix.node }})'
|
name: 'unit_front (node: ${{ matrix.node }})'
|
||||||
@ -77,6 +72,8 @@ jobs:
|
|||||||
node: [18]
|
node: [18]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
@ -84,18 +81,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: '**/node_modules'
|
path: '**/node_modules'
|
||||||
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
- uses: nrwl/nx-set-shas@v3
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- name: Build
|
|
||||||
run: yarn build
|
|
||||||
- name: Run test
|
- name: Run test
|
||||||
run: yarn run -s test:front --coverage
|
run: yarn nx affected --target=test:front --nx-ignore-cycles
|
||||||
- name: Upload coverage to Codecov
|
|
||||||
uses: codecov/codecov-action@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
directory: ./coverage
|
|
||||||
flags: front,unit_front
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: 'build (node: ${{ matrix.node }})'
|
name: 'build (node: ${{ matrix.node }})'
|
||||||
@ -115,7 +104,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build --scope @strapi/admin --scope @strapi/helper-plugin
|
run: yarn build --projects=@strapi/admin,@strapi/helper-plugin
|
||||||
|
|
||||||
api_ce_pg:
|
api_ce_pg:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -79,7 +79,6 @@ $RECYCLE.BIN/
|
|||||||
*#
|
*#
|
||||||
.idea
|
.idea
|
||||||
nbproject
|
nbproject
|
||||||
.vscode/
|
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
|
|
||||||
@ -135,6 +134,8 @@ schema.graphql
|
|||||||
# Visual Studio Code
|
# Visual Studio Code
|
||||||
############################
|
############################
|
||||||
|
|
||||||
|
.vscode/
|
||||||
|
!.vscode/settings.json
|
||||||
front-workspace.code-workspace
|
front-workspace.code-workspace
|
||||||
.yarn
|
.yarn
|
||||||
.yarnrc
|
.yarnrc
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
npx --no lint-staged
|
yarn lint-staged
|
||||||
|
yarn nx affected:lint --uncommitted --nx-ignore-cycles
|
||||||
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"eslint.workingDirectories": [{ "mode": "auto" }]
|
||||||
|
}
|
85
jest-preset.front.js
Normal file
85
jest-preset.front.js
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const IS_EE = process.env.IS_EE === 'true';
|
||||||
|
|
||||||
|
const moduleNameMapper = {
|
||||||
|
'.*\\.(css|less|styl|scss|sass)$': path.join(
|
||||||
|
__dirname,
|
||||||
|
'packages/admin-test-utils/lib/mocks/cssModule.js'
|
||||||
|
),
|
||||||
|
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/image.js'),
|
||||||
|
'^ee_else_ce(/.*)$': IS_EE
|
||||||
|
? [
|
||||||
|
path.join(__dirname, 'packages/core/admin/ee/admin$1'),
|
||||||
|
path.join(__dirname, 'packages/core/content-manager/ee/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/content-type-builder/ee/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/upload/ee/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/email/ee/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/plugins/*/ee/admin/src$1'),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
path.join(__dirname, 'packages/core/admin/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/content-manager/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/content-type-builder/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/upload/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/core/email/admin/src$1'),
|
||||||
|
path.join(__dirname, 'packages/plugins/*/admin/src$1'),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
rootDir: __dirname,
|
||||||
|
moduleNameMapper,
|
||||||
|
testPathIgnorePatterns: ['/node_modules/', '__tests__'],
|
||||||
|
globalSetup: path.join(__dirname, 'test/config/front/global-setup.js'),
|
||||||
|
setupFiles: [
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/setup/test-bundler.js'),
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/fetch.js'),
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/LocalStorageMock.js'),
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/IntersectionObserver.js'),
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/ResizeObserver.js'),
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/windowMatchMedia.js'),
|
||||||
|
path.join(__dirname, 'packages/admin-test-utils/lib/mocks/mockRangeApi.js'),
|
||||||
|
],
|
||||||
|
setupFilesAfterEnv: [
|
||||||
|
path.join(__dirname, '/packages/admin-test-utils/lib/setup/styled-components.js'),
|
||||||
|
path.join(__dirname, '/packages/admin-test-utils/lib/setup/strapi.js'),
|
||||||
|
path.join(__dirname, '/packages/admin-test-utils/lib/setup/prop-types.js'),
|
||||||
|
],
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
|
transform: {
|
||||||
|
'^.+\\.js$': [
|
||||||
|
'@swc/jest',
|
||||||
|
{
|
||||||
|
env: {
|
||||||
|
coreJs: '3.28.0',
|
||||||
|
mode: 'usage',
|
||||||
|
},
|
||||||
|
|
||||||
|
jsc: {
|
||||||
|
parser: {
|
||||||
|
jsx: true,
|
||||||
|
dynamicImport: true,
|
||||||
|
},
|
||||||
|
// this should match the minimum supported node.js version
|
||||||
|
target: 'es2020',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||||
|
path.join(__dirname, 'fileTransformer.js'),
|
||||||
|
},
|
||||||
|
transformIgnorePatterns: [
|
||||||
|
'node_modules/(?!(react-dnd|dnd-core|react-dnd-html5-backend|@strapi/design-system|@strapi/icons|fractional-indexing)/)',
|
||||||
|
],
|
||||||
|
testMatch: ['/**/tests/**/?(*.)+(spec|test).[jt]s?(x)'],
|
||||||
|
testEnvironmentOptions: {
|
||||||
|
url: 'http://localhost:1337/admin',
|
||||||
|
},
|
||||||
|
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
|
||||||
|
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
|
||||||
|
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
|
||||||
|
};
|
@ -1,11 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
rootDir: __dirname,
|
setupFilesAfterEnv: [__dirname + '/test/unit.setup.js'],
|
||||||
setupFilesAfterEnv: ['<rootDir>/test/unit.setup.js'],
|
|
||||||
modulePathIgnorePatterns: ['.cache', 'dist'],
|
modulePathIgnorePatterns: ['.cache', 'dist'],
|
||||||
testPathIgnorePatterns: ['.testdata.js', '.test.utils.js'],
|
testPathIgnorePatterns: ['.testdata.js', '.test.utils.js'],
|
||||||
// TODO: testMatch should only include files with (test|spec) even within __tests__ so that utilities can be included and ignored there
|
|
||||||
testMatch: ['/**/__tests__/**/*.[jt]s?(x)'],
|
testMatch: ['/**/__tests__/**/*.[jt]s?(x)'],
|
||||||
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
|
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
|
||||||
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
|
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
|
@ -1,91 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const IS_EE = process.env.IS_EE === 'true';
|
|
||||||
|
|
||||||
const moduleNameMapper = {
|
|
||||||
'.*\\.(css|less|styl|scss|sass)$': '<rootDir>/packages/admin-test-utils/lib/mocks/cssModule.js',
|
|
||||||
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/image.js',
|
|
||||||
'^ee_else_ce(/.*)$': IS_EE
|
|
||||||
? [
|
|
||||||
'<rootDir>/packages/core/admin/ee/admin$1',
|
|
||||||
'<rootDir>/packages/core/content-manager/ee/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/content-type-builder/ee/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/upload/ee/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/email/ee/admin/src$1',
|
|
||||||
'<rootDir>/packages/plugins/*/ee/admin/src$1',
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
'<rootDir>/packages/core/admin/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/content-manager/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/content-type-builder/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/upload/admin/src$1',
|
|
||||||
'<rootDir>/packages/core/email/admin/src$1',
|
|
||||||
'<rootDir>/packages/plugins/*/admin/src$1',
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
rootDir: __dirname,
|
|
||||||
moduleNameMapper,
|
|
||||||
collectCoverageFrom: [
|
|
||||||
'<rootDir>/packages/core/*/admin/src/**/*.js',
|
|
||||||
'<rootDir>/packages/core/admin/ee/admin/**/*.js',
|
|
||||||
'<rootDir>/packages/plugins/*/admin/src/**/*.js',
|
|
||||||
],
|
|
||||||
testPathIgnorePatterns: [
|
|
||||||
'/node_modules/',
|
|
||||||
'<rootDir>/examples/getstarted/',
|
|
||||||
'<rootDir>/examples/kitchensink/',
|
|
||||||
'<rootDir>/packages/strapi-helper-plugin/dist/',
|
|
||||||
'__tests__',
|
|
||||||
],
|
|
||||||
globalSetup: '<rootDir>/test/config/front/global-setup.js',
|
|
||||||
setupFiles: [
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/setup/test-bundler.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/fetch.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/LocalStorageMock.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/IntersectionObserver.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/ResizeObserver.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/windowMatchMedia.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/mocks/mockRangeApi.js',
|
|
||||||
],
|
|
||||||
setupFilesAfterEnv: [
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/setup/styled-components.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/setup/strapi.js',
|
|
||||||
'<rootDir>/packages/admin-test-utils/lib/setup/prop-types.js',
|
|
||||||
],
|
|
||||||
testEnvironment: 'jsdom',
|
|
||||||
transform: {
|
|
||||||
'^.+\\.js$': [
|
|
||||||
'@swc/jest',
|
|
||||||
{
|
|
||||||
env: {
|
|
||||||
coreJs: '3.28.0',
|
|
||||||
mode: 'usage',
|
|
||||||
},
|
|
||||||
|
|
||||||
jsc: {
|
|
||||||
parser: {
|
|
||||||
jsx: true,
|
|
||||||
dynamicImport: true,
|
|
||||||
},
|
|
||||||
// this should match the minimum supported node.js version
|
|
||||||
target: 'es2020',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
|
||||||
'<rootDir>/fileTransformer.js',
|
|
||||||
},
|
|
||||||
transformIgnorePatterns: [
|
|
||||||
'node_modules/(?!(react-dnd|dnd-core|react-dnd-html5-backend|@strapi/design-system|@strapi/icons|fractional-indexing)/)',
|
|
||||||
],
|
|
||||||
testMatch: ['/**/tests/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
||||||
testEnvironmentOptions: {
|
|
||||||
url: 'http://localhost:1337/admin',
|
|
||||||
},
|
|
||||||
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
|
|
||||||
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
|
|
||||||
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
|
|
||||||
};
|
|
@ -1,11 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const baseConfig = require('./jest.base-config.front');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...baseConfig,
|
|
||||||
projects: [
|
|
||||||
'<rootDir>/packages/**/jest.config.front.js',
|
|
||||||
'<rootDir>/scripts/**/jest.config.front.js',
|
|
||||||
],
|
|
||||||
};
|
|
@ -1,6 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
coverageDirectory: '<rootDir>/coverage',
|
|
||||||
projects: ['<rootDir>/packages/**/jest.config.js', '<rootDir>/.github'],
|
|
||||||
};
|
|
53
nx.json
Normal file
53
nx.json
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"namedInputs": {
|
||||||
|
"default": ["{projectRoot}/**/*"],
|
||||||
|
"production": [
|
||||||
|
"default",
|
||||||
|
"!{projectRoot}/**/*.test.ts",
|
||||||
|
"!{projectRoot}/**/*.test.js",
|
||||||
|
"!{projectRoot}/**/*.md"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"targetDefaults": {
|
||||||
|
"build": {
|
||||||
|
"inputs": ["production", "^production"],
|
||||||
|
"dependsOn": ["^build"],
|
||||||
|
"outputs": ["{projectRoot}/lib", "{projectRoot}/build", "{projectRoot}/dist"]
|
||||||
|
},
|
||||||
|
"build:ts": {
|
||||||
|
"inputs": ["production", "^production", "{workspaceRoot}/packages/utils/tsconfig/**/*"],
|
||||||
|
"dependsOn": ["^build:ts"],
|
||||||
|
"outputs": ["{projectRoot}/lib", "{projectRoot}/build", "{projectRoot}/dist"]
|
||||||
|
},
|
||||||
|
"test:unit": {
|
||||||
|
"inputs": ["default", "{projectRoot}/jest.config.js", "{workspaceRoot}/jest-preset.unit.js"],
|
||||||
|
"dependsOn": ["build:ts"]
|
||||||
|
},
|
||||||
|
"test:front": {
|
||||||
|
"inputs": [
|
||||||
|
"default",
|
||||||
|
"{projectRoot}/jest.config.front.js",
|
||||||
|
"{workspaceRoot}/jest-preset.front.js"
|
||||||
|
],
|
||||||
|
"dependsOn": ["^build"]
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"inputs": [
|
||||||
|
"default",
|
||||||
|
"{projectRoot}/.eslintrc.js",
|
||||||
|
"{projectRoot}/.eslintignore",
|
||||||
|
"{projectRoot}/tsconfig.eslint.json",
|
||||||
|
"{workspaceRoot}/packages/utils/eslint-config-custom/**/*"
|
||||||
|
],
|
||||||
|
"dependsOn": ["build:ts"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tasksRunnerOptions": {
|
||||||
|
"default": {
|
||||||
|
"runner": "nx/tasks-runners/default",
|
||||||
|
"options": {
|
||||||
|
"cacheableOperations": ["build", "build:ts", "lint", "test:unit", "test:front"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
50
package.json
50
package.json
@ -25,61 +25,54 @@
|
|||||||
"packages/*",
|
"packages/*",
|
||||||
"packages/*/*",
|
"packages/*/*",
|
||||||
"examples/*",
|
"examples/*",
|
||||||
".github/actions/*"
|
".github/actions/*",
|
||||||
|
"scripts/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"setup": "yarn && yarn clean && yarn build",
|
"setup": "yarn && yarn clean && yarn build",
|
||||||
"clean": "lerna run --stream clean --no-private",
|
"clean": "nx run-many --target=clean --nx-ignore-cycles",
|
||||||
"watch": "lerna run --stream watch --no-private --parallel",
|
"watch": "nx run-many --target=watch --nx-ignore-cycles",
|
||||||
"build": "lerna run --stream build --no-private",
|
"build": "nx run-many --target=build --nx-ignore-cycles",
|
||||||
"build:ts": "lerna run --stream build:ts --no-private",
|
"build:ts": "nx run-many --target=build:ts --nx-ignore-cycles",
|
||||||
"generate": "plop --plopfile ./packages/generators/admin/plopfile.js",
|
"generate": "plop --plopfile ./packages/generators/admin/plopfile.js",
|
||||||
"lint": "npm-run-all -p lint:code lint:css",
|
"lint": "nx run-many --target=lint --nx-ignore-cycles && yarn lint:css && yarn lint:other",
|
||||||
"lint:code": "eslint --cache --cache-strategy content --cache-location ./node_modules/.cache/eslint .",
|
|
||||||
"lint:css": "stylelint packages/**/admin/src/**/*.js",
|
"lint:css": "stylelint packages/**/admin/src/**/*.js",
|
||||||
"lint:fix": "eslint --fix .",
|
"lint:fix": "nx run-many --target=lint --nx-ignore-cycles -- --fix",
|
||||||
"lint:other": "npm run prettier:other -- --check",
|
"lint:other": "npm run prettier:other -- --check",
|
||||||
"format": "npm-run-all -p format:*",
|
"format": "npm-run-all -p format:*",
|
||||||
"format:code": "npm run prettier:code -- --write",
|
"format:code": "npm run prettier:code -- --write",
|
||||||
"format:other": "npm run prettier:other -- --write",
|
"format:other": "npm run prettier:other -- --write",
|
||||||
"prettier:code": "prettier --cache --cache-strategy content \"**/*.{js,ts}\"",
|
"prettier:code": "prettier --cache --cache-strategy content \"**/*.{js,ts}\"",
|
||||||
"prettier:other": "prettier --cache --cache-strategy content \"**/*.{md,css,scss,yaml,yml}\"",
|
"prettier:other": "prettier --cache --cache-strategy content \"**/*.{md,css,scss,yaml,yml}\"",
|
||||||
"test:clean": "rimraf ./coverage",
|
"test:front": "cross-env IS_EE=true nx run-many --target=test:front --nx-ignore-cycles",
|
||||||
"test:front": "npm run test:clean && cross-env IS_EE=true jest --config ./jest.config.front.js",
|
"test:front:watch": "cross-env IS_EE=true nx run-many --target=test:front:watch --nx-ignore-cycles",
|
||||||
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
"test:front:update": "yarn test:front -u",
|
||||||
"test:front:update": "cross-env IS_EE=true jest --config ./jest.config.front.js --u",
|
"test:front:ce": "cross-env IS_EE=false nx run-many --target=test:front --nx-ignore-cycles",
|
||||||
"test:front:ce": "npm run test:clean && cross-env IS_EE=false jest --config ./jest.config.front.js --coverage",
|
"test:front:watch:ce": "cross-env IS_EE=false nx run-many --target=test:front:watch --nx-ignore-cycles",
|
||||||
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
"test:front:update:ce": "yarn test:front:ce -u",
|
||||||
"test:front:update:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --u",
|
"test:unit": "nx run-many --target=test:unit --nx-ignore-cycles",
|
||||||
"test:unit": "jest --verbose",
|
"test:unit:watch": "nx run-many --target=test:unit:watch --nx-ignore-cycles",
|
||||||
"test:api": "node test/api.js",
|
"test:api": "node test/api.js",
|
||||||
"test:generate-app": "node test/create-test-app.js",
|
"test:generate-app": "node test/create-test-app.js",
|
||||||
"doc:api": "node scripts/open-api/serve.js"
|
"doc:api": "node scripts/open-api/serve.js"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{js,ts,md,css,scss,yaml,yml}": [
|
"*.{js,ts,md,css,scss,yaml,yml}": [
|
||||||
"prettier --cache --cache-strategy content --write"
|
"prettier --write"
|
||||||
],
|
|
||||||
"*.{js,ts}": [
|
|
||||||
"eslint --cache --cache-strategy content --cache-location ./node_modules/.cache/eslint --fix"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.12",
|
"@babel/core": "^7.20.12",
|
||||||
"@babel/eslint-parser": "^7.19.1",
|
|
||||||
"@babel/preset-react": "7.18.6",
|
"@babel/preset-react": "7.18.6",
|
||||||
"@strapi/eslint-config": "0.1.2",
|
"@swc/cli": "0.1.62",
|
||||||
"@swc/core": "1.3.35",
|
"@swc/core": "1.3.37",
|
||||||
"@swc/jest": "0.2.24",
|
"@swc/jest": "0.2.24",
|
||||||
"@typescript-eslint/parser": "5.43.0",
|
|
||||||
"babel-eslint": "10.1.0",
|
|
||||||
"chalk": "4.1.2",
|
"chalk": "4.1.2",
|
||||||
"chokidar": "3.5.3",
|
"chokidar": "3.5.3",
|
||||||
"core-js": "3.28.0",
|
"core-js": "3.28.0",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"dotenv": "14.2.0",
|
"dotenv": "14.2.0",
|
||||||
"eslint": "8.27.0",
|
|
||||||
"execa": "1.0.0",
|
"execa": "1.0.0",
|
||||||
"fs-extra": "10.1.0",
|
"fs-extra": "10.1.0",
|
||||||
"get-port": "5.1.1",
|
"get-port": "5.1.1",
|
||||||
@ -91,11 +84,11 @@
|
|||||||
"jest-cli": "29.0.3",
|
"jest-cli": "29.0.3",
|
||||||
"jest-environment-jsdom": "29.0.3",
|
"jest-environment-jsdom": "29.0.3",
|
||||||
"jest-watch-typeahead": "2.2.2",
|
"jest-watch-typeahead": "2.2.2",
|
||||||
"lerna": "5.4.3",
|
"lerna": "6.5.1",
|
||||||
"lint-staged": "13.0.3",
|
"lint-staged": "13.0.3",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"npm-run-all": "4.1.5",
|
"npm-run-all": "4.1.5",
|
||||||
"nx": "14.8.6",
|
"nx": "15.8.3",
|
||||||
"plop": "2.7.6",
|
"plop": "2.7.6",
|
||||||
"prettier": "2.8.4",
|
"prettier": "2.8.4",
|
||||||
"qs": "6.11.0",
|
"qs": "6.11.0",
|
||||||
@ -106,6 +99,7 @@
|
|||||||
"stylelint-processor-styled-components": "1.10.0",
|
"stylelint-processor-styled-components": "1.10.0",
|
||||||
"supertest": "6.3.3",
|
"supertest": "6.3.3",
|
||||||
"ts-jest": "29.0.3",
|
"ts-jest": "29.0.3",
|
||||||
|
"typedoc": "0.23.26",
|
||||||
"typescript": "4.6.2",
|
"typescript": "4.6.2",
|
||||||
"yargs": "17.6.0"
|
"yargs": "17.6.0"
|
||||||
},
|
},
|
||||||
|
2
packages/admin-test-utils/.eslintignore
Normal file
2
packages/admin-test-utils/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
7
packages/admin-test-utils/.eslintrc.js
Normal file
7
packages/admin-test-utils/.eslintrc.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
rules: {
|
||||||
|
'import/no-extraneous-dependencies': 'off',
|
||||||
|
},
|
||||||
|
};
|
@ -31,7 +31,7 @@
|
|||||||
"redux": "^4.2.1"
|
"redux": "^4.2.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.19.1 <=18.x.x"
|
"node": ">=14.19.1 <=18.x.x"
|
||||||
|
2
packages/cli/create-strapi-app/.eslintignore
Normal file
2
packages/cli/create-strapi-app/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
4
packages/cli/create-strapi-app/.eslintrc.js
Normal file
4
packages/cli/create-strapi-app/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -40,7 +40,7 @@
|
|||||||
"create-strapi-app": "./index.js"
|
"create-strapi-app": "./index.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"no tests yet\""
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.19.1 <=18.x.x",
|
"node": ">=14.19.1 <=18.x.x",
|
||||||
|
2
packages/cli/create-strapi-starter/.eslintignore
Normal file
2
packages/cli/create-strapi-starter/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
4
packages/cli/create-strapi-starter/.eslintrc.js
Normal file
4
packages/cli/create-strapi-starter/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -35,7 +35,7 @@
|
|||||||
"create-strapi-starter": "./index.js"
|
"create-strapi-starter": "./index.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"no tests yet\""
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strapi/generate-new": "4.8.2",
|
"@strapi/generate-new": "4.8.2",
|
||||||
|
4
packages/core/admin/.eslintignore
Normal file
4
packages/core/admin/.eslintignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
||||||
|
build/
|
||||||
|
admin/src/plugins.js
|
14
packages/core/admin/.eslintrc.js
Normal file
14
packages/core/admin/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*', 'ee/admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*', 'ee/admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,11 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config.front');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.front.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
collectCoverageFrom: ['<rootDir>/packages/core/admin/admin/**/*.js'],
|
collectCoverageFrom: ['<rootDir>/packages/core/admin/admin/**/*.js'],
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -30,12 +30,14 @@
|
|||||||
"build": "rimraf build && node ./scripts/build.js",
|
"build": "rimraf build && node ./scripts/build.js",
|
||||||
"build:mesure": "rimraf build && cross-env MESURE_BUILD_SPEED=true node ./scripts/build.js",
|
"build:mesure": "rimraf build && cross-env MESURE_BUILD_SPEED=true node ./scripts/build.js",
|
||||||
"test": "echo \"no tests yet\"",
|
"test": "echo \"no tests yet\"",
|
||||||
"test:unit": "jest --verbose",
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
||||||
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
||||||
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
||||||
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
||||||
"test:front:ce:cov": "cross-env IS_EE=false jest --config ./jest.config.front.js --coverage"
|
"test:front:ce:cov": "cross-env IS_EE=false jest --config ./jest.config.front.js --coverage",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.20.12",
|
"@babel/core": "^7.20.12",
|
||||||
|
@ -90,7 +90,7 @@ describe('Admin Controller', () => {
|
|||||||
['uuid', null],
|
['uuid', null],
|
||||||
]);
|
]);
|
||||||
expect(result.data).toBeDefined();
|
expect(result.data).toBeDefined();
|
||||||
expect(result.data).toStrictEqual({
|
expect(result.data).toMatchObject({
|
||||||
currentEnvironment: 'development',
|
currentEnvironment: 'development',
|
||||||
autoReload: false,
|
autoReload: false,
|
||||||
strapiVersion: '1.0.0',
|
strapiVersion: '1.0.0',
|
||||||
@ -100,7 +100,6 @@ describe('Admin Controller', () => {
|
|||||||
},
|
},
|
||||||
nodeVersion: process.version,
|
nodeVersion: process.version,
|
||||||
communityEdition: false,
|
communityEdition: false,
|
||||||
useYarn: true,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
2
packages/core/content-manager/.eslintignore
Normal file
2
packages/core/content-manager/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/core/content-manager/.eslintrc.js
Normal file
14
packages/core/content-manager/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --verbose"
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sindresorhus/slugify": "1.1.0",
|
"@sindresorhus/slugify": "1.1.0",
|
||||||
|
2
packages/core/content-type-builder/.eslintignore
Normal file
2
packages/core/content-type-builder/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/core/content-type-builder/.eslintrc.js
Normal file
14
packages/core/content-type-builder/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config.front');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.front.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -20,11 +20,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --verbose",
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
||||||
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
||||||
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
||||||
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
|
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sindresorhus/slugify": "1.1.0",
|
"@sindresorhus/slugify": "1.1.0",
|
||||||
|
5
packages/core/data-transfer/.eslintignore
Normal file
5
packages/core/data-transfer/.eslintignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
node_modules/
|
||||||
|
lib/
|
||||||
|
.eslintrc.js
|
||||||
|
jest.config.js
|
||||||
|
coverage/
|
4
packages/core/data-transfer/.eslintrc.js
Normal file
4
packages/core/data-transfer/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/typescript'],
|
||||||
|
};
|
@ -1,12 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
testMatch: ['**/__tests__/**/*.test.ts'],
|
testMatch: ['**/__tests__/**/*.test.ts'],
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(t|j)sx?$': ['@swc/jest'],
|
'^.+\\.(t|j)sx?$': ['@swc/jest'],
|
||||||
|
@ -27,13 +27,14 @@
|
|||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn build:ts",
|
"build": "tsc",
|
||||||
"build:ts": "tsc -p tsconfig.json",
|
"build:ts": "tsc",
|
||||||
"build:clean": "yarn clean && yarn build",
|
|
||||||
"clean": "rimraf ./lib",
|
"clean": "rimraf ./lib",
|
||||||
"prepublishOnly": "yarn build:clean",
|
"prepublishOnly": "yarn clean && yarn build",
|
||||||
"test:unit": "jest --verbose",
|
"test:unit": "jest",
|
||||||
"watch": "yarn build:ts -w --preserveWatchOutput"
|
"test:unit:watch": "jest --watch",
|
||||||
|
"watch": "tsc -w --preserveWatchOutput",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "./lib"
|
"lib": "./lib"
|
||||||
|
8
packages/core/data-transfer/tsconfig.eslint.json
Normal file
8
packages/core/data-transfer/tsconfig.eslint.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
},
|
||||||
|
"include": ["types", "src"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{
|
||||||
"extends": "@tsconfig/node16/tsconfig.json",
|
"extends": "tsconfig/base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strict": true,
|
"outDir": "lib"
|
||||||
"lib": ["ES2020"],
|
|
||||||
"target": "ES2020",
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"outDir": "lib",
|
|
||||||
"declaration": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"esModuleInterop": true
|
|
||||||
},
|
},
|
||||||
"include": ["types", "src/**/*.ts"],
|
"include": ["types", "src"],
|
||||||
"exclude": ["node_modules", "src/**/__tests__"]
|
"exclude": ["node_modules", "**/__tests__/**"]
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import type { PipelineSource, PipelineDestination, Readable, Writable } from 'stream';
|
||||||
import type {
|
import type {
|
||||||
IDestinationProviderTransferResults,
|
IDestinationProviderTransferResults,
|
||||||
IProviderTransferResults,
|
IProviderTransferResults,
|
||||||
@ -6,7 +7,6 @@ import type {
|
|||||||
MaybePromise,
|
MaybePromise,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import type { IMetadata } from './common-entities';
|
import type { IMetadata } from './common-entities';
|
||||||
import type { PipelineSource, PipelineDestination, Readable, Writable } from 'stream';
|
|
||||||
|
|
||||||
type ProviderType = 'source' | 'destination';
|
type ProviderType = 'source' | 'destination';
|
||||||
|
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
import type { PassThrough } from 'stream';
|
import type { PassThrough } from 'stream';
|
||||||
import type { IAsset, IEntity, ILink } from './common-entities';
|
import type { ITransferResults, TransferTransforms, TransferProgress } from './utils';
|
||||||
import type { ITransferResults, TransferTransform, TransferTransforms } from './utils';
|
|
||||||
import type { ISourceProvider, IDestinationProvider } from './providers';
|
import type { ISourceProvider, IDestinationProvider } from './providers';
|
||||||
import type { Schema } from '@strapi/strapi';
|
|
||||||
import type { ITransferResults, TransferTransform, TransferProgress } from './utils';
|
|
||||||
import type { ISourceProvider, IDestinationProvider } from './providers';
|
|
||||||
import type { Severity } from '../src/errors';
|
|
||||||
import type { DiagnosticReporter } from '../src/engine/diagnostic';
|
import type { DiagnosticReporter } from '../src/engine/diagnostic';
|
||||||
|
|
||||||
export type TransferFilterPreset = 'content' | 'files' | 'config';
|
export type TransferFilterPreset = 'content' | 'files' | 'config';
|
||||||
|
18
packages/core/data-transfer/types/utils.d.ts
vendored
18
packages/core/data-transfer/types/utils.d.ts
vendored
@ -1,9 +1,9 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/ban-types */
|
||||||
import type { Readable, Writable, Duplex, Transform } from 'stream';
|
import type { Readable, Writable, Duplex, Transform } from 'stream';
|
||||||
|
import type { Schema } from '@strapi/strapi';
|
||||||
|
import type { KnexTransaction } from 'knex';
|
||||||
import type { IDestinationProvider, ISourceProvider } from './providers';
|
import type { IDestinationProvider, ISourceProvider } from './providers';
|
||||||
import type { IAsset, IEntity, ILink } from './common-entities';
|
import type { IAsset, IEntity, ILink } from './common-entities';
|
||||||
import type { Schema } from '@strapi/strapi';
|
|
||||||
import type { ITransferEngineOptions } from './transfer-engine';
|
|
||||||
import type { KnexTransaction } from 'knex';
|
|
||||||
|
|
||||||
export type MaybePromise<T> = T | Promise<T>;
|
export type MaybePromise<T> = T | Promise<T>;
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ export type TransferMap<T> = {
|
|||||||
map: (data: T) => T;
|
map: (data: T) => T;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Stream = Readable | Writable | Duplex | Transform;
|
export type Stream = Readable | Writable | Duplex | Transform;
|
||||||
export type TransformFunction = (chunk: any, encoding?: string) => any;
|
export type TransformFunction = (chunk: any, encoding?: string) => any;
|
||||||
export type StreamItem = Stream | TransformFunction;
|
export type StreamItem = Stream | TransformFunction;
|
||||||
|
|
||||||
@ -48,18 +48,18 @@ export type TransferTransforms = {
|
|||||||
[key in TransferTransformOption]?: TransferTransformArray<key>;
|
[key in TransferTransformOption]?: TransferTransformArray<key>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Filters
|
* Filters
|
||||||
**/
|
*/
|
||||||
export type TransferFilterArray<T> = TransferFilter<TransferStageTypeMap[T]>[];
|
export type TransferFilterArray<T> = TransferFilter<TransferStageTypeMap[T]>[];
|
||||||
|
|
||||||
export type TransferFilters = {
|
export type TransferFilters = {
|
||||||
[key in TransferTransformOption]?: boolean | TransferFilterArray<key>;
|
[key in TransferTransformOption]?: boolean | TransferFilterArray<key>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Progress
|
* Progress
|
||||||
**/
|
*/
|
||||||
export type TransferProgress = {
|
export type TransferProgress = {
|
||||||
[key in TransferStage]?: {
|
[key in TransferStage]?: {
|
||||||
count: number;
|
count: number;
|
||||||
@ -86,7 +86,7 @@ export type IProviderTransferResults = {};
|
|||||||
export type ISourceProviderTransferResults = {};
|
export type ISourceProviderTransferResults = {};
|
||||||
export type IDestinationProviderTransferResults = {};
|
export type IDestinationProviderTransferResults = {};
|
||||||
|
|
||||||
export type KnexTransaction = KnexTransaction;
|
export type { KnexTransaction };
|
||||||
export type TransactionCallback = (trx?: KnexTransaction) => Promise<void>;
|
export type TransactionCallback = (trx?: KnexTransaction) => Promise<void>;
|
||||||
export type Transaction = {
|
export type Transaction = {
|
||||||
attach<T = undefined>(callback: TransactionCallback): Promise<T | undefined>;
|
attach<T = undefined>(callback: TransactionCallback): Promise<T | undefined>;
|
||||||
|
2
packages/core/database/.eslintignore
Normal file
2
packages/core/database/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
4
packages/core/database/.eslintrc.js
Normal file
4
packages/core/database/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,9 @@
|
|||||||
"lib": "./lib"
|
"lib": "./lib"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --verbose"
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"date-fns": "2.29.3",
|
"date-fns": "2.29.3",
|
||||||
|
2
packages/core/email/.eslintignore
Normal file
2
packages/core/email/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/core/email/.eslintrc.js
Normal file
14
packages/core/email/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config.front');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.front.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
||||||
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
||||||
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
||||||
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
|
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strapi/design-system": "1.6.6",
|
"@strapi/design-system": "1.6.6",
|
||||||
|
4
packages/core/helper-plugin/.eslintignore
Normal file
4
packages/core/helper-plugin/.eslintignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
||||||
|
build/
|
||||||
|
lib/src/utils/**
|
4
packages/core/helper-plugin/.eslintrc.js
Normal file
4
packages/core/helper-plugin/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/front'],
|
||||||
|
};
|
@ -1,9 +1,4 @@
|
|||||||
const baseConfig = require('../../../jest.base-config.front');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.front.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
collectCoverageFrom: ['<rootDir>/packages/core/helper-plugin/lib/src/**/*.js'],
|
collectCoverageFrom: ['<rootDir>/packages/core/helper-plugin/lib/src/**/*.js'],
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,8 @@
|
|||||||
"test:front": "jest --config ./jest.config.front.js",
|
"test:front": "jest --config ./jest.config.front.js",
|
||||||
"test:front:cov": "jest --config ./jest.config.front.js --coverage",
|
"test:front:cov": "jest --config ./jest.config.front.js --coverage",
|
||||||
"test:front:watch": "jest --config ./jest.config.front.js --watchAll",
|
"test:front:watch": "jest --config ./jest.config.front.js --watchAll",
|
||||||
"watch": "cross-env NODE_ENV=development webpack-cli -w"
|
"watch": "cross-env NODE_ENV=development webpack-cli -w",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "1.3.4",
|
"axios": "1.3.4",
|
||||||
|
2
packages/core/permissions/.eslintignore
Normal file
2
packages/core/permissions/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
4
packages/core/permissions/.eslintrc.js
Normal file
4
packages/core/permissions/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,9 @@
|
|||||||
],
|
],
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --verbose"
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@casl/ability": "5.4.4",
|
"@casl/ability": "5.4.4",
|
||||||
|
2
packages/core/strapi/.eslintignore
Normal file
2
packages/core/strapi/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
4
packages/core/strapi/.eslintrc.js
Normal file
4
packages/core/strapi/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -76,7 +76,9 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "node lib/utils/success.js",
|
"postinstall": "node lib/utils/success.js",
|
||||||
"test:unit": "jest --verbose"
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@koa/cors": "3.4.3",
|
"@koa/cors": "3.4.3",
|
||||||
|
2
packages/core/upload/.eslintignore
Normal file
2
packages/core/upload/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/core/upload/.eslintrc.js
Normal file
14
packages/core/upload/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config.front');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.front.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -16,11 +16,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --verbose",
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
||||||
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
||||||
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
||||||
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
|
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strapi/design-system": "1.6.6",
|
"@strapi/design-system": "1.6.6",
|
||||||
|
2
packages/core/utils/.eslintignore
Normal file
2
packages/core/utils/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
4
packages/core/utils/.eslintrc.js
Normal file
4
packages/core/utils/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -1,11 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.unit.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
testMatch: ['<rootDir>/**/*.test.js'],
|
testMatch: ['<rootDir>/**/*.test.js'],
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,9 @@
|
|||||||
"lib": "./lib"
|
"lib": "./lib"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:unit": "jest --verbose"
|
"test:unit": "jest",
|
||||||
|
"test:unit:watch": "jest --watch",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sindresorhus/slugify": "1.1.0",
|
"@sindresorhus/slugify": "1.1.0",
|
||||||
|
3
packages/generators/app/.eslintignore
Normal file
3
packages/generators/app/.eslintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
||||||
|
lib/resources/files/
|
4
packages/generators/app/.eslintrc.js
Normal file
4
packages/generators/app/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -33,7 +33,8 @@
|
|||||||
"lib": "./lib"
|
"lib": "./lib"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"no tests yet\""
|
"test": "echo \"no tests yet\"",
|
||||||
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/node": "6.19.7",
|
"@sentry/node": "6.19.7",
|
||||||
|
3
packages/generators/generators/.eslintignore
Normal file
3
packages/generators/generators/.eslintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
||||||
|
lib/files/
|
4
packages/generators/generators/.eslintrc.js
Normal file
4
packages/generators/generators/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['custom/back'],
|
||||||
|
};
|
@ -28,6 +28,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint ."
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sindresorhus/slugify": "1.1.0",
|
"@sindresorhus/slugify": "1.1.0",
|
||||||
"@strapi/typescript-utils": "4.8.2",
|
"@strapi/typescript-utils": "4.8.2",
|
||||||
|
2
packages/plugins/color-picker/.eslintignore
Normal file
2
packages/plugins/color-picker/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/plugins/color-picker/.eslintrc.js
Normal file
14
packages/plugins/color-picker/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,10 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config.front');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...baseConfig,
|
preset: '../../../jest-preset.front.js',
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
};
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...baseConfig,
|
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
|
@ -30,6 +30,13 @@
|
|||||||
"react-router-dom": "5.3.4",
|
"react-router-dom": "5.3.4",
|
||||||
"styled-components": "5.3.3"
|
"styled-components": "5.3.3"
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
||||||
|
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
||||||
|
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
||||||
|
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
||||||
|
"lint": "eslint ."
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/strapi/strapi.git",
|
"url": "https://github.com/strapi/strapi.git",
|
||||||
|
2
packages/plugins/documentation/.eslintignore
Normal file
2
packages/plugins/documentation/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/plugins/documentation/.eslintrc.js
Normal file
14
packages/plugins/documentation/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"no tests yet\""
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@strapi/design-system": "1.6.6",
|
"@strapi/design-system": "1.6.6",
|
||||||
|
2
packages/plugins/graphql/.eslintignore
Normal file
2
packages/plugins/graphql/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
.eslintrc.js
|
14
packages/plugins/graphql/.eslintrc.js
Normal file
14
packages/plugins/graphql/.eslintrc.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['admin/**/*'],
|
||||||
|
extends: ['custom/front'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*'],
|
||||||
|
excludedFiles: ['admin/**/*'],
|
||||||
|
extends: ['custom/back'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -1,10 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const baseConfig = require('../../../jest.base-config');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...baseConfig,
|
|
||||||
displayName: (pkg.strapi && pkg.strapi.name) || pkg.name,
|
|
||||||
roots: [__dirname],
|
|
||||||
};
|
|
@ -21,10 +21,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:front": "cross-env IS_EE=true jest --config ./jest.config.front.js",
|
"lint": "eslint ."
|
||||||
"test:front:watch": "cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
|
||||||
"test:front:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js",
|
|
||||||
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@graphql-tools/schema": "8.5.1",
|
"@graphql-tools/schema": "8.5.1",
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user