sku 11.6.2 → 11.7.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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # sku
2
2
 
3
+ ## 11.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `package.json` configuration flags that enable you to skip sku configuration and peer dep validation ([#727](https://github.com/seek-oss/sku/pull/727))
8
+
9
+ **NOTE**: These settings disable critical functionality of sku, so you likely
10
+ don't want to use them unless you know what you're doing
11
+
12
+ - `skuSkipConfigure`: Skip generation of config files. E.g. .prettierrc, tsconfig.json, etc.
13
+ - `skuSkipValidatePeerDeps`: Skip checking for multiple copies of the same package. You likely want to try and fix the warnings found by this check rather than disabling it.
14
+
15
+ **EXAMPLE USAGE**:
16
+
17
+ ```jsonc
18
+ // package.json
19
+ {
20
+ "skuSkipConfigure": true,
21
+ "skuSkipValidatePeerDeps": true
22
+ }
23
+ ```
24
+
3
25
  ## 11.6.2
4
26
 
5
27
  ### Patch Changes
package/bin/sku.js CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ const fs = require('fs-extra');
2
3
  const debug = require('debug');
3
4
  const args = require('../config/args');
4
- const validatePeersDeps = require('../lib/validatePeersDeps');
5
+ const _validatePeerDeps = require('../lib/validatePeerDeps');
6
+ const { getPathFromCwd } = require('../lib/cwd');
5
7
  const log = debug('sku:bin');
6
8
 
7
9
  const { script } = args;
@@ -13,11 +15,42 @@ if (args.debug) {
13
15
  debug.enable(process.env.DEBUG);
14
16
  }
15
17
 
18
+ let skipConfigure = false;
19
+ let skipValidatePeerDeps = false;
20
+ const packageJson = getPathFromCwd('./package.json');
21
+ const packageJsonExists = fs.existsSync(packageJson);
22
+
23
+ if (packageJsonExists) {
24
+ const {
25
+ skuSkipConfigure = false,
26
+ skuSkipValidatePeerDeps = false,
27
+ } = require(packageJson);
28
+ skipConfigure = skuSkipConfigure;
29
+ skipValidatePeerDeps = skuSkipValidatePeerDeps;
30
+ }
31
+
16
32
  const configureProject = async () => {
33
+ if (skipConfigure) {
34
+ log(`"skuSkipConfigure" set in ${packageJson}, skipping sku configuration`);
35
+ return;
36
+ }
37
+
17
38
  const configure = require('../lib/configure');
18
39
  await configure();
19
40
  };
20
41
 
42
+ const validatePeerDeps = () => {
43
+ if (skipValidatePeerDeps) {
44
+ log(
45
+ `"skuSkipValidatePeerDeps" set in ${packageJson}, skipping sku peer dependency validation`,
46
+ );
47
+ return;
48
+ }
49
+
50
+ // Intentionally not awaiting async function as it's just for logging warnings
51
+ _validatePeerDeps();
52
+ };
53
+
21
54
  const runScript = (scriptName) => {
22
55
  require(`../scripts/${scriptName}`);
23
56
  };
@@ -52,8 +85,7 @@ log(`Starting script: ${script}`);
52
85
  case 'serve': {
53
86
  await configureProject();
54
87
 
55
- // Intentionally not awaiting async function as it's just for logging warnings
56
- validatePeersDeps();
88
+ validatePeerDeps();
57
89
  runScript(script);
58
90
  break;
59
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "11.6.2",
3
+ "version": "11.7.0",
4
4
  "description": "Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest",
5
5
  "main": "index.js",
6
6
  "bin": {