@akinon/next 1.89.0-rc.7 → 1.89.0-rc.9

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 CHANGED
@@ -1,5 +1,57 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.89.0-rc.9
4
+
5
+ ### Minor Changes
6
+
7
+ - 5dfeea04: ZERO-2801: Revert ZERO-2801
8
+ - 63774a6: ZERO-3351: Add commerce redirection ignore list functionality and related utility
9
+ - 2d9b2b2c: ZERO-2816: Add segment to headers
10
+ - 5e1feca6: Revert "ZERO-3286: Add notFound handling for chunk URLs starting with \_next"
11
+ - d8fad39: ZERO-3370: include plugins test to build stage
12
+ - 40a46853: ZERO-3182: Optimize basket update mutation with optimistic update
13
+ - f49bb74f: ZERO-3097: Add setCookie to logging in payment redirection middlewares
14
+ - e9541a13: ZERO-2816: Add headers to url
15
+ - 72fd4d67: ZERO-3084: Fix URL search parameters encoding in default middleware
16
+ - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
17
+ - 64699d3f: ZERO-2761: Fix invalid import for plugin module
18
+ - bf354de: ZERO-3321: add babel compiler for akinon/next test
19
+ - 7727ae55: ZERO-3073: Refactor basket page to use server-side data fetching and simplify component structure
20
+ - d552629f: ZERO-3182: Refactor basketApi to use invalidatesTags and comment out onQueryStarted logic
21
+ - 448adef: ZERO-3321: move csp test to akinon-next
22
+ - 17f87524: ZERO-2816: Make the incoming currency lowercase
23
+ - 65d3b862: ZERO-3054: Update headers in appFetch
24
+ - bbe18b9f: ZERO-2575: Fix build error
25
+ - 17bfadc4: ZERO-3275: Disable OpenTelemetry monitoring in production environment
26
+ - 4920742c: Disable getCachedTranslations
27
+ - b6e5b624: ZERO-3257: Enhance locale middleware to redirect using existing or default locale and support 303 status for POST requests
28
+ - 6c3629c: ZERO-3321: fix jest tests in akinon-next for standalone projects
29
+ - 7e56d6b6: ZERO-2841: Update api tagTypes
30
+ - dfaceff: ZERO-3356: Add useLoyaltyAvailability hook and update checkout state management
31
+ - 33377cfd: ZERO-3267: Refactor import statement for ROUTES in error-page component
32
+ - 43c182ee: ZERO-3054: Update Redis variable checks to conditionally include CACHE_SECRET
33
+ - 943a239: ZERO-3370: add allowJs in akinon-next test tsconfig
34
+ - eeb20bea: Revert "ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing"
35
+ - 3bf63c8a: ZERO-3286: Add notFound handling for chunk URLs starting with \_next
36
+ - 9be2c081: ZERO-3243: Improve basket update query handling with optimistic updates
37
+ - f2c92d5c: ZERO-2816: Update cookie name
38
+ - 7bd3d992: ZERO-2801: Refactor locale middleware to handle single locale configuration
39
+ - fdd255ee: ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing
40
+ - acf0320: ZERO-3321: remove babel config
41
+ - 387356b: ZERO-3323: Refactor locale filtering logic in URL matcher regex
42
+ - 49eeebfa: ZERO-2909: Add deleteCollectionItem query to wishlistApi
43
+ - 3f9b8d7e: ZERO-2761: Update plugins.js for akinon-next
44
+ - b2ee69b: ZERO-3321: delete unnecessary files
45
+ - 0cabbda: ZERO-3370: replace inline monorepo check with reusable utility
46
+
47
+ ## 1.89.0-rc.8
48
+
49
+ ### Minor Changes
50
+
51
+ - d8fad39: ZERO-3370: include plugins test to build stage
52
+ - 943a239: ZERO-3370: add allowJs in akinon-next test tsconfig
53
+ - 0cabbda: ZERO-3370: replace inline monorepo check with reusable utility
54
+
3
55
  ## 1.89.0-rc.7
4
56
 
5
57
  ### Minor Changes
@@ -15,7 +15,8 @@
15
15
  "preserveWatchOutput": true,
16
16
  "skipLibCheck": true,
17
17
  "strict": true,
18
- "jsx": "react-jsx"
18
+ "jsx": "react-jsx",
19
+ "allowJs": true
19
20
  },
20
21
  "exclude": ["node_modules"],
21
22
  "include": [".", "../."]
@@ -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 isJestAvailable() {
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 jestPath = path.join(BASE_DIR, 'node_modules', '.bin', 'jest');
14
- return fs.existsSync(jestPath);
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 findAkinonNextPath() {
21
- const insideNodeModules = __dirname.includes('node_modules');
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 (!isJestAvailable()) {
31
- console.error('\x1b[31mError: Jest is not available!\x1b[0m');
65
+ if (!isJestInstalled()) {
66
+ console.error('\x1b[31mError: Jest is not installed in the project!\x1b[0m');
32
67
  console.error(
33
- 'Please make sure you have installed all dependencies by running:'
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 jestPath = path.join(BASE_DIR, 'node_modules', '.bin', 'jest');
42
- const akinonNextPath = findAkinonNextPath();
75
+ const jestExecutablePath = path.join(BASE_DIR, 'node_modules', '.bin', 'jest');
76
+ const akinonNextPackagePath = getAkinonNextPackagePath();
43
77
 
44
- const testFiles = glob.sync('__tests__/**/*.test.ts', {
45
- cwd: akinonNextPath,
46
- absolute: true
47
- });
78
+ const testFiles = [
79
+ ...glob.sync('__tests__/**/*.test.ts', {
80
+ cwd: akinonNextPackagePath,
81
+ absolute: true
82
+ }),
83
+ ...findPluginTestFiles(akinonNextPackagePath)
84
+ ];
48
85
 
49
- const jestArgs = [
86
+ console.log(`Found ${testFiles.length} test files to run`);
87
+
88
+ const jestArguments = [
50
89
  ...testFiles,
51
- `--config ${path.join(akinonNextPath, 'jest.config.js')}`,
90
+ `--config ${path.join(akinonNextPackagePath, 'jest.config.js')}`,
52
91
  '--runTestsByPath',
53
92
  '--passWithNoTests'
54
93
  ];
55
94
 
56
- const jestProcess = spawn(jestPath, jestArgs, {
57
- cwd: akinonNextPath,
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
@@ -4,7 +4,7 @@ module.exports = {
4
4
  preset: 'ts-jest',
5
5
  testEnvironment: 'node',
6
6
  rootDir: path.resolve(__dirname),
7
- roots: [path.resolve(__dirname, '__tests__')],
7
+ roots: [],
8
8
  testMatch: ['**/*.test.ts'],
9
9
  testPathIgnorePatterns: [],
10
10
  transformIgnorePatterns: [],
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.7",
4
+ "version": "1.89.0-rc.9",
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.7",
37
+ "@akinon/eslint-plugin-projectzero": "1.89.0-rc.9",
38
38
  "@babel/core": "7.26.10",
39
39
  "@babel/preset-env": "7.26.9",
40
40
  "@babel/preset-typescript": "7.27.0",