@akinon/next 1.89.0-rc.7 → 1.89.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/__tests__/tsconfig.json +2 -1
- package/bin/pz-run-tests.js +60 -25
- package/jest.config.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.89.0-rc.8
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d8fad39: ZERO-3370: include plugins test to build stage
|
|
8
|
+
- 943a239: ZERO-3370: add allowJs in akinon-next test tsconfig
|
|
9
|
+
- 0cabbda: ZERO-3370: replace inline monorepo check with reusable utility
|
|
10
|
+
|
|
3
11
|
## 1.89.0-rc.7
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/__tests__/tsconfig.json
CHANGED
package/bin/pz-run-tests.js
CHANGED
|
@@ -5,60 +5,95 @@ const path = require('path');
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const glob = require('glob');
|
|
7
7
|
const findBaseDir = require('../utils/find-base-dir');
|
|
8
|
+
const checkMonorepo = require('../utils/check-monorepo');
|
|
8
9
|
|
|
10
|
+
const IS_MONOREPO = checkMonorepo() !== null;
|
|
9
11
|
const BASE_DIR = findBaseDir();
|
|
12
|
+
const PLUGINS = require(path.join(BASE_DIR, 'src', 'plugins.js'));
|
|
10
13
|
|
|
11
|
-
function
|
|
14
|
+
function findPluginTestFiles(akinonNextPackagePath) {
|
|
15
|
+
const pluginsRootPath = path.join(
|
|
16
|
+
akinonNextPackagePath,
|
|
17
|
+
'..',
|
|
18
|
+
'..',
|
|
19
|
+
IS_MONOREPO ? 'packages' : '@akinon'
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
if (!fs.existsSync(pluginsRootPath)) {
|
|
23
|
+
console.log('Plugins directory not found:', pluginsRootPath);
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return PLUGINS.reduce((testFiles, pluginName) => {
|
|
28
|
+
const pluginDirectoryPath = path.join(pluginsRootPath, pluginName);
|
|
29
|
+
if (fs.existsSync(pluginDirectoryPath)) {
|
|
30
|
+
const pluginTestFiles = glob.sync('**/*.test.ts', {
|
|
31
|
+
cwd: pluginDirectoryPath,
|
|
32
|
+
absolute: true
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return testFiles.concat(pluginTestFiles);
|
|
36
|
+
} else {
|
|
37
|
+
console.log(`Plugin directory not found: ${pluginName}`);
|
|
38
|
+
}
|
|
39
|
+
return testFiles;
|
|
40
|
+
}, []);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isJestInstalled() {
|
|
12
44
|
try {
|
|
13
|
-
const
|
|
14
|
-
|
|
45
|
+
const jestExecutablePath = path.join(
|
|
46
|
+
BASE_DIR,
|
|
47
|
+
'node_modules',
|
|
48
|
+
'.bin',
|
|
49
|
+
'jest'
|
|
50
|
+
);
|
|
51
|
+
return fs.existsSync(jestExecutablePath);
|
|
15
52
|
} catch (error) {
|
|
16
53
|
return false;
|
|
17
54
|
}
|
|
18
55
|
}
|
|
19
56
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (insideNodeModules) {
|
|
57
|
+
function getAkinonNextPackagePath() {
|
|
58
|
+
if (!IS_MONOREPO) {
|
|
24
59
|
return path.resolve(__dirname, '..');
|
|
25
60
|
}
|
|
26
61
|
|
|
27
62
|
return path.resolve(__dirname, '../../../packages/akinon-next');
|
|
28
63
|
}
|
|
29
64
|
|
|
30
|
-
if (!
|
|
31
|
-
console.error('\x1b[31mError: Jest is not
|
|
65
|
+
if (!isJestInstalled()) {
|
|
66
|
+
console.error('\x1b[31mError: Jest is not installed in the project!\x1b[0m');
|
|
32
67
|
console.error(
|
|
33
|
-
'Please
|
|
68
|
+
'Please install all dependencies by running one of the following commands:'
|
|
34
69
|
);
|
|
35
70
|
console.error(' npm install');
|
|
36
|
-
console.error('or');
|
|
37
71
|
console.error(' yarn install');
|
|
38
72
|
process.exit(1);
|
|
39
73
|
}
|
|
40
74
|
|
|
41
|
-
const
|
|
42
|
-
const
|
|
75
|
+
const jestExecutablePath = path.join(BASE_DIR, 'node_modules', '.bin', 'jest');
|
|
76
|
+
const akinonNextPackagePath = getAkinonNextPackagePath();
|
|
43
77
|
|
|
44
|
-
const testFiles =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
78
|
+
const testFiles = [
|
|
79
|
+
...glob.sync('__tests__/**/*.test.ts', {
|
|
80
|
+
cwd: akinonNextPackagePath,
|
|
81
|
+
absolute: true
|
|
82
|
+
}),
|
|
83
|
+
...findPluginTestFiles(akinonNextPackagePath)
|
|
84
|
+
];
|
|
48
85
|
|
|
49
|
-
|
|
86
|
+
console.log(`Found ${testFiles.length} test files to run`);
|
|
87
|
+
|
|
88
|
+
const jestArguments = [
|
|
50
89
|
...testFiles,
|
|
51
|
-
`--config ${path.join(
|
|
90
|
+
`--config ${path.join(akinonNextPackagePath, 'jest.config.js')}`,
|
|
52
91
|
'--runTestsByPath',
|
|
53
92
|
'--passWithNoTests'
|
|
54
93
|
];
|
|
55
94
|
|
|
56
|
-
|
|
57
|
-
cwd:
|
|
95
|
+
spawn(jestExecutablePath, jestArguments, {
|
|
96
|
+
cwd: akinonNextPackagePath,
|
|
58
97
|
stdio: 'inherit',
|
|
59
98
|
shell: true
|
|
60
99
|
});
|
|
61
|
-
|
|
62
|
-
jestProcess.on('close', (code) => {
|
|
63
|
-
process.exit(code);
|
|
64
|
-
});
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.89.0-rc.
|
|
4
|
+
"version": "1.89.0-rc.8",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"set-cookie-parser": "2.6.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@akinon/eslint-plugin-projectzero": "1.89.0-rc.
|
|
37
|
+
"@akinon/eslint-plugin-projectzero": "1.89.0-rc.8",
|
|
38
38
|
"@babel/core": "7.26.10",
|
|
39
39
|
"@babel/preset-env": "7.26.9",
|
|
40
40
|
"@babel/preset-typescript": "7.27.0",
|