sku 12.1.0 → 12.1.2

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,22 @@
1
1
  # sku
2
2
 
3
+ ## 12.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Don't use `.git` folder to find root, only glob PNPM virtual store if PNPM is detected as the package manager ([#845](https://github.com/seek-oss/sku/pull/845))
8
+
9
+ ## 12.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Improve compile package detection in PNPM apps ([#840](https://github.com/seek-oss/sku/pull/840))
14
+
15
+ - Makes some more of the array types in the sku config type into readonly versions. ([#843](https://github.com/seek-oss/sku/pull/843))
16
+ This allows for arrays that have been declared with `as const` to be passed in.
17
+
18
+ Affected fields are `sites`, `sites[].routes`, `site[].languages`, `routes`, and `routes[].languages`.
19
+
3
20
  ## 12.1.0
4
21
 
5
22
  ### Minor Changes
@@ -1,19 +1,44 @@
1
- const path = require('path');
1
+ const { posix: path } = require('path');
2
2
  const chalk = require('chalk');
3
3
  const glob = require('fast-glob');
4
4
 
5
- const { cwd } = require('../lib/cwd');
5
+ const { cwd: skuCwd } = require('../lib/cwd');
6
+ const toPosixPath = require('../lib/toPosixPath');
7
+
8
+ const { findRootSync } = require('@manypkg/find-root');
6
9
 
7
10
  /** @type {string[]} */
8
11
  let detectedCompilePackages = [];
9
12
 
10
13
  try {
14
+ const globs = ['node_modules/@seek/*/package.json'];
15
+ const cwd = skuCwd();
16
+
17
+ const { rootDir, tool } = findRootSync(cwd);
18
+
19
+ if (tool === 'pnpm') {
20
+ const pnpmVirtualStorePath = path.join(
21
+ toPosixPath(rootDir),
22
+ 'node_modules/.pnpm',
23
+ );
24
+ const pnpmVirtualStoreRelativePath = path.relative(
25
+ '.',
26
+ pnpmVirtualStorePath,
27
+ );
28
+ const pnpmVirtualStoreGlob = path.join(
29
+ pnpmVirtualStoreRelativePath,
30
+ '@seek*/node_modules/@seek/*/package.json',
31
+ );
32
+
33
+ globs.push(pnpmVirtualStoreGlob);
34
+ }
35
+
11
36
  detectedCompilePackages = glob
12
- .sync([`node_modules/@seek/*/package.json`], {
13
- cwd: cwd(),
37
+ .sync(globs, {
38
+ cwd,
14
39
  })
15
40
  .map((packagePath) => {
16
- const packageJson = require(path.join(cwd(), packagePath));
41
+ const packageJson = require(path.join(cwd, packagePath));
17
42
 
18
43
  return {
19
44
  isCompilePackage: Boolean(packageJson.skuCompilePackage),
@@ -29,4 +54,8 @@ try {
29
54
  console.error(e);
30
55
  }
31
56
 
32
- module.exports = ['sku', 'braid-design-system', ...detectedCompilePackages];
57
+ module.exports = [
58
+ 'sku',
59
+ 'braid-design-system',
60
+ ...new Set(detectedCompilePackages),
61
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "12.1.0",
3
+ "version": "12.1.2",
4
4
  "description": "Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -37,6 +37,7 @@
37
37
  "@loadable/component": "^5.14.1",
38
38
  "@loadable/server": "^5.14.0",
39
39
  "@loadable/webpack-plugin": "^5.14.0",
40
+ "@manypkg/find-root": "^2.2.0",
40
41
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
41
42
  "@storybook/builder-webpack5": "^7.0.17",
42
43
  "@storybook/cli": "^7.0.17",
package/sku-types.d.ts CHANGED
@@ -39,7 +39,7 @@ interface SkuRouteObject {
39
39
  route: string;
40
40
  name?: string;
41
41
  entry?: string;
42
- languages?: string[];
42
+ languages?: ReadonlyArray<string>;
43
43
  }
44
44
 
45
45
  type SkuRoute = string | SkuRouteObject;
@@ -47,8 +47,8 @@ type SkuRoute = string | SkuRouteObject;
47
47
  interface SkuSiteObject {
48
48
  name: string;
49
49
  host?: string;
50
- routes?: Array<SkuRoute>;
51
- languages?: string[];
50
+ routes?: ReadonlyArray<SkuRoute>;
51
+ languages?: ReadonlyArray<string>;
52
52
  }
53
53
 
54
54
  type SkuSite = string | SkuSiteObject;
@@ -320,7 +320,7 @@ export interface SkuConfig {
320
320
  * @default ['/']
321
321
  * @link https://seek-oss.github.io/sku/#/./docs/configuration?id=routes
322
322
  */
323
- routes?: Array<SkuRoute>;
323
+ routes?: ReadonlyArray<SkuRoute>;
324
324
 
325
325
  /**
326
326
  * **Only for SSR apps**
@@ -357,7 +357,7 @@ export interface SkuConfig {
357
357
  * @default []
358
358
  * @link https://seek-oss.github.io/sku/#/./docs/configuration?id=sites
359
359
  */
360
- sites?: Array<SkuSite>;
360
+ sites?: ReadonlyArray<SkuSite>;
361
361
 
362
362
  /**
363
363
  * When running `sku build`, sku will compile all your external packages (`node_modules`) through `@babel/preset-env`.