nocobase/packages/core/build/src/constant.ts
Zeke Zhang 3b7c1345cc
test(e2e): add tests for client (#3144)
* test: add tests for lazy loading of association fields

* refactor: migrate

* test: add tests for page

* test: add tests for page menu

* test: add tests for tabs

* test: add tests for detail block

* test: add tests for list block

* test: add tests for grid card block

* test: add tests for filter collapse block

* test: add tests for markdown block

* test: add tests for table block

* test: add tests for table block

* test: add tests for lazy loading of association fields

* test: add tests for data scope

* test: add tests for filter block

* test: add tests for block template

* test: add tests for drag and sorting

* test: add tests for sorting rules

* test: make testing more stable

* Revert "test: make testing more stable"

This reverts commit 78b7badeb6.

* perf: remove enableToConfig

* test: make testing more stable

* test: make testing more stable

* test: delete newly created records to make tests more stable

* fix: fix error when deleting records

* test: make testing more stable

* test: make testing more stable

* test: fix tests

* refactor: optimize file structure

* test: fix tests

* test: fix tests

* refactor: optimize description

* refactor: optimize description

* refactor: use __e2e__ as the root directory for test files

* fix: fix build

* test: make testing more stable
2023-12-13 14:14:33 +08:00

55 lines
1.9 KiB
TypeScript

import { Package } from '@lerna/package';
import path from 'path';
export const globExcludeFiles = [
'!src/**/__tests__',
'!src/**/__test__',
'!src/**/__e2e__',
'!src/**/demos',
'!src/**/fixtures',
'!src/**/*.mdx',
'!src/**/*.md',
'!src/**/*.+(test|e2e|spec).+(js|jsx|ts|tsx)',
];
export const EsbuildSupportExts = [
'.ts',
'.tsx',
'.js',
'.jsx',
'.json',
'.css',
'.less',
'.sass',
'.scss',
'.styl',
'.txt',
'.data',
];
export const ROOT_PATH = path.join(__dirname, '../../../../');
export const PACKAGES_PATH = path.join(ROOT_PATH, 'packages');
export const PLUGINS_DIR = ['plugins', 'samples', 'pro-plugins']
.concat((process.env.PLUGINS_DIRS || '').split(','))
.filter(Boolean)
.map((name) => path.join(PACKAGES_PATH, name));
export const PRESETS_DIR = path.join(PACKAGES_PATH, 'presets');
export const getPluginPackages = (packages: Package[]) =>
packages.filter((item) => PLUGINS_DIR.some((pluginDir) => item.location.startsWith(pluginDir)));
export const getPresetsPackages = (packages: Package[]) =>
packages.filter((item) => item.location.startsWith(PRESETS_DIR));
export const CORE_APP = path.join(PACKAGES_PATH, 'core/app');
export const CORE_CLIENT = path.join(PACKAGES_PATH, 'core/client');
export const CJS_EXCLUDE_PACKAGES = [
path.join(PACKAGES_PATH, 'core/build'),
path.join(PACKAGES_PATH, 'core/cli'),
CORE_CLIENT,
];
export const getCjsPackages = (packages: Package[]) =>
packages
.filter((item) => !PLUGINS_DIR.some((dir) => item.location.startsWith(dir)))
.filter((item) => !item.location.startsWith(PRESETS_DIR))
.filter((item) => !CJS_EXCLUDE_PACKAGES.includes(item.location));
// tar
export const tarIncludesFiles = ['package.json', 'README.md', 'LICENSE', 'dist', '!node_modules', '!src'];
export const TAR_OUTPUT_DIR = process.env.TAR_PATH ? process.env.TAR_PATH : path.join(ROOT_PATH, 'storage', 'tar');