@akinon/next 1.89.0-snapshot-ZERO-3370-20250508071547 → 1.89.0
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 +1 -11
- package/bin/pz-prebuild.js +0 -1
- package/components/price.tsx +2 -2
- package/package.json +4 -15
- package/__tests__/next-config.test.ts +0 -83
- package/__tests__/tsconfig.json +0 -23
- package/babel.config.js +0 -6
- package/bin/pz-run-tests.js +0 -98
- package/jest.config.js +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
-
## 1.89.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- d8fad39: ZERO-3370: include plugins test to build stage
|
|
8
|
-
- bf354de: ZERO-3321: add babel compiler for akinon/next test
|
|
9
|
-
- 448adef: ZERO-3321: move csp test to akinon-next
|
|
10
|
-
- 6c3629c: ZERO-3321: fix jest tests in akinon-next for standalone projects
|
|
11
|
-
- 943a239: ZERO-3370: add allowJs in akinon-next test tsconfig
|
|
12
|
-
- acf0320: ZERO-3321: remove babel config
|
|
13
|
-
- b2ee69b: ZERO-3321: delete unnecessary files
|
|
3
|
+
## 1.89.0
|
|
14
4
|
|
|
15
5
|
## 1.88.0
|
|
16
6
|
|
package/bin/pz-prebuild.js
CHANGED
package/components/price.tsx
CHANGED
|
@@ -55,8 +55,8 @@ export const Price = (props: NumericFormatProps & PriceProps) => {
|
|
|
55
55
|
: formattedValue;
|
|
56
56
|
|
|
57
57
|
const currentCurrencyDecimalScale = Settings.localization.currencies.find(
|
|
58
|
-
(currency) => currency
|
|
59
|
-
)
|
|
58
|
+
(currency) => currency?.code === currencyCode_
|
|
59
|
+
)?.decimalScale;
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<NumericFormat
|
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
|
|
4
|
+
"version": "1.89.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -13,17 +13,14 @@
|
|
|
13
13
|
"pz-predev": "bin/pz-predev.js",
|
|
14
14
|
"pz-postdev": "bin/pz-postdev.js"
|
|
15
15
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"test": "jest"
|
|
18
|
-
},
|
|
19
16
|
"dependencies": {
|
|
20
|
-
"@neshca/cache-handler": "1.5.1",
|
|
21
17
|
"@opentelemetry/exporter-trace-otlp-http": "0.46.0",
|
|
22
18
|
"@opentelemetry/resources": "1.19.0",
|
|
23
19
|
"@opentelemetry/sdk-node": "0.46.0",
|
|
24
20
|
"@opentelemetry/sdk-trace-node": "1.19.0",
|
|
25
21
|
"@opentelemetry/semantic-conventions": "1.19.0",
|
|
26
22
|
"@reduxjs/toolkit": "1.9.7",
|
|
23
|
+
"@neshca/cache-handler": "1.5.1",
|
|
27
24
|
"@sentry/nextjs": "9.5.0",
|
|
28
25
|
"cross-spawn": "7.0.3",
|
|
29
26
|
"generic-pool": "3.9.0",
|
|
@@ -34,21 +31,13 @@
|
|
|
34
31
|
"set-cookie-parser": "2.6.0"
|
|
35
32
|
},
|
|
36
33
|
"devDependencies": {
|
|
37
|
-
"@akinon/eslint-plugin-projectzero": "1.89.0
|
|
38
|
-
"@babel/core": "7.26.10",
|
|
39
|
-
"@babel/preset-env": "7.26.9",
|
|
40
|
-
"@babel/preset-typescript": "7.27.0",
|
|
41
|
-
"@types/jest": "29.5.14",
|
|
34
|
+
"@akinon/eslint-plugin-projectzero": "1.89.0",
|
|
42
35
|
"@types/react-redux": "7.1.30",
|
|
43
36
|
"@types/set-cookie-parser": "2.4.7",
|
|
44
37
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|
|
45
38
|
"@typescript-eslint/parser": "6.7.4",
|
|
46
|
-
"babel-jest": "29.7.0",
|
|
47
39
|
"eslint": "8.56.0",
|
|
48
40
|
"eslint-config-next": "14.2.3",
|
|
49
|
-
"eslint-config-prettier": "8.5.0"
|
|
50
|
-
"jest": "29.7.0",
|
|
51
|
-
"ts-jest": "29.3.2",
|
|
52
|
-
"typescript": "5.2.2"
|
|
41
|
+
"eslint-config-prettier": "8.5.0"
|
|
53
42
|
}
|
|
54
43
|
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'path';
|
|
2
|
-
import type { NextConfig } from 'next';
|
|
3
|
-
|
|
4
|
-
function findBaseDir() {
|
|
5
|
-
const insideNodeModules = __dirname.includes('node_modules');
|
|
6
|
-
|
|
7
|
-
if (insideNodeModules) {
|
|
8
|
-
return resolve(__dirname, '../../../../');
|
|
9
|
-
} else {
|
|
10
|
-
return resolve(__dirname, '../../../apps/projectzeronext');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const baseDir = findBaseDir();
|
|
15
|
-
|
|
16
|
-
jest.mock('next-pwa', () => {
|
|
17
|
-
return () => (config: NextConfig) => config;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
jest.mock('@sentry/nextjs', () => ({
|
|
21
|
-
withSentryConfig: (config: NextConfig) => config
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
jest.mock('../with-pz-config.js', () => {
|
|
25
|
-
return (config: NextConfig) => {
|
|
26
|
-
const originalHeaders = config.headers;
|
|
27
|
-
|
|
28
|
-
config.headers = async () => {
|
|
29
|
-
const originalHeadersResult = (await originalHeaders?.()) ?? [];
|
|
30
|
-
|
|
31
|
-
return [
|
|
32
|
-
{
|
|
33
|
-
source: '/(.*)',
|
|
34
|
-
headers: [
|
|
35
|
-
{
|
|
36
|
-
key: 'Content-Security-Policy',
|
|
37
|
-
value: 'https://*.akifast.com akifast.com'
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
...originalHeadersResult
|
|
42
|
-
];
|
|
43
|
-
};
|
|
44
|
-
return config;
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
interface Header {
|
|
49
|
-
key: string;
|
|
50
|
-
value: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface HeaderGroup {
|
|
54
|
-
source: string;
|
|
55
|
-
headers: Header[];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const nextConfigPath = resolve(baseDir, 'next.config.mjs');
|
|
59
|
-
let nextConfig: any;
|
|
60
|
-
|
|
61
|
-
beforeAll(async () => {
|
|
62
|
-
nextConfig = await import(nextConfigPath);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe('Next.js Configuration', () => {
|
|
66
|
-
it('should contain Content-Security-Policy header with akifast domain values', async () => {
|
|
67
|
-
const headers = nextConfig.default.headers;
|
|
68
|
-
expect(headers).toBeDefined();
|
|
69
|
-
|
|
70
|
-
const headersResult = await headers();
|
|
71
|
-
|
|
72
|
-
const cspHeaders = headersResult
|
|
73
|
-
.flatMap((headerGroup: HeaderGroup) => headerGroup.headers)
|
|
74
|
-
.filter((header: Header) => header.key === 'Content-Security-Policy');
|
|
75
|
-
|
|
76
|
-
expect(cspHeaders.length).toBeGreaterThan(0);
|
|
77
|
-
|
|
78
|
-
const lastCspHeader = cspHeaders[cspHeaders.length - 1];
|
|
79
|
-
|
|
80
|
-
expect(lastCspHeader.value).toContain('akifast.com');
|
|
81
|
-
expect(lastCspHeader.value).toContain('https://*.akifast.com');
|
|
82
|
-
});
|
|
83
|
-
});
|
package/__tests__/tsconfig.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"display": "Default",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"composite": false,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"inlineSources": false,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"noUnusedLocals": false,
|
|
14
|
-
"noUnusedParameters": false,
|
|
15
|
-
"preserveWatchOutput": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"strict": true,
|
|
18
|
-
"jsx": "react-jsx",
|
|
19
|
-
"allowJs": true
|
|
20
|
-
},
|
|
21
|
-
"exclude": ["node_modules"],
|
|
22
|
-
"include": [".", "../."]
|
|
23
|
-
}
|
package/babel.config.js
DELETED
package/bin/pz-run-tests.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
const glob = require('glob');
|
|
7
|
-
const findBaseDir = require('../utils/find-base-dir');
|
|
8
|
-
|
|
9
|
-
const IS_MONOREPO = !__dirname.includes('node_modules');
|
|
10
|
-
const BASE_DIR = findBaseDir();
|
|
11
|
-
const PLUGINS = require(path.join(BASE_DIR, 'src', 'plugins.js'));
|
|
12
|
-
|
|
13
|
-
function findPluginTestFiles(akinonNextPackagePath) {
|
|
14
|
-
const pluginsRootPath = path.join(
|
|
15
|
-
akinonNextPackagePath,
|
|
16
|
-
'..',
|
|
17
|
-
'..',
|
|
18
|
-
IS_MONOREPO ? 'packages' : '@akinon'
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
if (!fs.existsSync(pluginsRootPath)) {
|
|
22
|
-
console.log('Plugins directory not found:', pluginsRootPath);
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return PLUGINS.reduce((testFiles, pluginName) => {
|
|
27
|
-
const pluginDirectoryPath = path.join(pluginsRootPath, pluginName);
|
|
28
|
-
if (fs.existsSync(pluginDirectoryPath)) {
|
|
29
|
-
const pluginTestFiles = glob.sync('**/*.test.ts', {
|
|
30
|
-
cwd: pluginDirectoryPath,
|
|
31
|
-
absolute: true
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return testFiles.concat(pluginTestFiles);
|
|
35
|
-
} else {
|
|
36
|
-
console.log(`Plugin directory not found: ${pluginName}`);
|
|
37
|
-
}
|
|
38
|
-
return testFiles;
|
|
39
|
-
}, []);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function isJestInstalled() {
|
|
43
|
-
try {
|
|
44
|
-
const jestExecutablePath = path.join(
|
|
45
|
-
BASE_DIR,
|
|
46
|
-
'node_modules',
|
|
47
|
-
'.bin',
|
|
48
|
-
'jest'
|
|
49
|
-
);
|
|
50
|
-
return fs.existsSync(jestExecutablePath);
|
|
51
|
-
} catch (error) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function getAkinonNextPackagePath() {
|
|
57
|
-
if (!IS_MONOREPO) {
|
|
58
|
-
return path.resolve(__dirname, '..');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return path.resolve(__dirname, '../../../packages/akinon-next');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (!isJestInstalled()) {
|
|
65
|
-
console.error('\x1b[31mError: Jest is not installed in the project!\x1b[0m');
|
|
66
|
-
console.error(
|
|
67
|
-
'Please install all dependencies by running one of the following commands:'
|
|
68
|
-
);
|
|
69
|
-
console.error(' npm install');
|
|
70
|
-
console.error(' yarn install');
|
|
71
|
-
process.exit(1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const jestExecutablePath = path.join(BASE_DIR, 'node_modules', '.bin', 'jest');
|
|
75
|
-
const akinonNextPackagePath = getAkinonNextPackagePath();
|
|
76
|
-
|
|
77
|
-
const testFiles = [
|
|
78
|
-
...glob.sync('__tests__/**/*.test.ts', {
|
|
79
|
-
cwd: akinonNextPackagePath,
|
|
80
|
-
absolute: true
|
|
81
|
-
}),
|
|
82
|
-
...findPluginTestFiles(akinonNextPackagePath)
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
console.log(`Found ${testFiles.length} test files to run`);
|
|
86
|
-
|
|
87
|
-
const jestArguments = [
|
|
88
|
-
...testFiles,
|
|
89
|
-
`--config ${path.join(akinonNextPackagePath, 'jest.config.js')}`,
|
|
90
|
-
'--runTestsByPath',
|
|
91
|
-
'--passWithNoTests'
|
|
92
|
-
];
|
|
93
|
-
|
|
94
|
-
spawn(jestExecutablePath, jestArguments, {
|
|
95
|
-
cwd: akinonNextPackagePath,
|
|
96
|
-
stdio: 'inherit',
|
|
97
|
-
shell: true
|
|
98
|
-
});
|
package/jest.config.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
preset: 'ts-jest',
|
|
5
|
-
testEnvironment: 'node',
|
|
6
|
-
rootDir: path.resolve(__dirname),
|
|
7
|
-
roots: [],
|
|
8
|
-
testMatch: ['**/*.test.ts'],
|
|
9
|
-
testPathIgnorePatterns: [],
|
|
10
|
-
transformIgnorePatterns: [],
|
|
11
|
-
transform: {
|
|
12
|
-
'^.+\\.(tsx?|jsx?|mjs?)$': [
|
|
13
|
-
'ts-jest',
|
|
14
|
-
{
|
|
15
|
-
tsconfig: path.resolve(__dirname, '__tests__/tsconfig.json')
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
};
|