@mondaydotcomorg/z2h-cli 0.4.0 → 0.4.1
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/dist/constants.d.ts +0 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +0 -7
- package/dist/esm/constants.d.ts +0 -1
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.mjs +1 -7
- package/dist/esm/shadow/prepare.d.ts.map +1 -1
- package/dist/esm/shadow/prepare.mjs +0 -2
- package/dist/shadow/prepare.d.ts.map +1 -1
- package/dist/shadow/prepare.js +0 -2
- package/package.json +1 -1
- package/src/constants.ts +0 -7
- package/src/shadow/prepare.ts +0 -2
- package/dist/esm/shadow/yarnrc.d.ts +0 -10
- package/dist/esm/shadow/yarnrc.d.ts.map +0 -1
- package/dist/esm/shadow/yarnrc.mjs +0 -27
- package/dist/shadow/yarnrc.d.ts +0 -10
- package/dist/shadow/yarnrc.d.ts.map +0 -1
- package/dist/shadow/yarnrc.js +0 -33
- package/src/shadow/yarnrc.ts +0 -29
package/dist/constants.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export declare const SHADOW_DEV_DEPS: Record<string, string>;
|
|
|
8
8
|
export declare const MIN_PORT = 13000;
|
|
9
9
|
export declare const MAX_PORT = 19999;
|
|
10
10
|
export declare const GITIGNORE_ENTRIES: string[];
|
|
11
|
-
export declare const YARNRC_LINES: string[];
|
|
12
11
|
export declare const BUCKET_WRITE_NAME = "prod-use1-bigbrain-zth-mf-assets";
|
|
13
12
|
export declare const REGION = "us-east-1";
|
|
14
13
|
export declare const BUCKET_WRITE_URL = "https://prod-use1-bigbrain-zth-mf-assets.s3.us-east-1.amazonaws.com";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,eAAe,SAAS,CAAC;AAGtC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGjD,CAAC;AAQF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAElD,CAAC;AAMF,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAG9B,eAAO,MAAM,iBAAiB,UAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,eAAe,SAAS,CAAC;AAGtC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGjD,CAAC;AAQF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAElD,CAAC;AAMF,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAG9B,eAAO,MAAM,iBAAiB,UAAY,CAAC;AAQ3C,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,cAAc,CAAC;AAClC,eAAO,MAAM,gBAAgB,wEAA4D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAKjF,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,iBAAiB,yDAA2C,CAAC;AAM1E,eAAO,MAAM,gBAAgB,QAA2B,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -28,12 +28,6 @@ const MIN_PORT = 13000;
|
|
|
28
28
|
const MAX_PORT = 19999;
|
|
29
29
|
// ─────────── Gitignore entries auto-appended to the consumer's file ────
|
|
30
30
|
const GITIGNORE_ENTRIES = ['.zth/'];
|
|
31
|
-
// ─────────── .yarnrc.yml written to new consumer apps ────
|
|
32
|
-
const YARNRC_LINES = [
|
|
33
|
-
'nodeLinker: node-modules',
|
|
34
|
-
"npmAuthToken: '${NPM_TOKEN}'",
|
|
35
|
-
"npmRegistryServer: 'https://registry.npmjs.org/'",
|
|
36
|
-
];
|
|
37
31
|
// ─────────── Z2H deploy bucket / contract ─────────
|
|
38
32
|
// Source of truth for the bucket layout. The CLI uses these when configuring
|
|
39
33
|
// the S3 client + uploading; bigbrain-zth's STS broker imports them via
|
|
@@ -69,4 +63,3 @@ exports.REGION = REGION;
|
|
|
69
63
|
exports.SHADOW_DEV_DEPS = SHADOW_DEV_DEPS;
|
|
70
64
|
exports.SHADOW_DIR_NAME = SHADOW_DIR_NAME;
|
|
71
65
|
exports.SHADOW_SCRIPTS = SHADOW_SCRIPTS;
|
|
72
|
-
exports.YARNRC_LINES = YARNRC_LINES;
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export declare const SHADOW_DEV_DEPS: Record<string, string>;
|
|
|
8
8
|
export declare const MIN_PORT = 13000;
|
|
9
9
|
export declare const MAX_PORT = 19999;
|
|
10
10
|
export declare const GITIGNORE_ENTRIES: string[];
|
|
11
|
-
export declare const YARNRC_LINES: string[];
|
|
12
11
|
export declare const BUCKET_WRITE_NAME = "prod-use1-bigbrain-zth-mf-assets";
|
|
13
12
|
export declare const REGION = "us-east-1";
|
|
14
13
|
export declare const BUCKET_WRITE_URL = "https://prod-use1-bigbrain-zth-mf-assets.s3.us-east-1.amazonaws.com";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,eAAe,SAAS,CAAC;AAGtC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGjD,CAAC;AAQF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAElD,CAAC;AAMF,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAG9B,eAAO,MAAM,iBAAiB,UAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,eAAe,SAAS,CAAC;AAGtC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGjD,CAAC;AAQF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAElD,CAAC;AAMF,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAG9B,eAAO,MAAM,iBAAiB,UAAY,CAAC;AAQ3C,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,cAAc,CAAC;AAClC,eAAO,MAAM,gBAAgB,wEAA4D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAKjF,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,iBAAiB,yDAA2C,CAAC;AAM1E,eAAO,MAAM,gBAAgB,QAA2B,CAAC"}
|
package/dist/esm/constants.mjs
CHANGED
|
@@ -26,12 +26,6 @@ const MIN_PORT = 13000;
|
|
|
26
26
|
const MAX_PORT = 19999;
|
|
27
27
|
// ─────────── Gitignore entries auto-appended to the consumer's file ────
|
|
28
28
|
const GITIGNORE_ENTRIES = ['.zth/'];
|
|
29
|
-
// ─────────── .yarnrc.yml written to new consumer apps ────
|
|
30
|
-
const YARNRC_LINES = [
|
|
31
|
-
'nodeLinker: node-modules',
|
|
32
|
-
"npmAuthToken: '${NPM_TOKEN}'",
|
|
33
|
-
"npmRegistryServer: 'https://registry.npmjs.org/'",
|
|
34
|
-
];
|
|
35
29
|
// ─────────── Z2H deploy bucket / contract ─────────
|
|
36
30
|
// Source of truth for the bucket layout. The CLI uses these when configuring
|
|
37
31
|
// the S3 client + uploading; bigbrain-zth's STS broker imports them via
|
|
@@ -53,4 +47,4 @@ const MANIFEST_READ_URL = `${BUCKET_READ_DNS_URL}/${MANIFEST_KEY}`;
|
|
|
53
47
|
// upfront for friendlier errors.
|
|
54
48
|
const APP_NAME_PATTERN = /^[a-z][a-z0-9-]{1,49}$/;
|
|
55
49
|
|
|
56
|
-
export { APP_NAME_PATTERN, BUCKET_READ_DNS_NAME, BUCKET_READ_DNS_URL, BUCKET_WRITE_NAME, BUCKET_WRITE_URL, GITIGNORE_ENTRIES, MANIFEST_KEY, MANIFEST_READ_URL, MAX_PORT, MIN_PORT, REGION, SHADOW_DEV_DEPS, SHADOW_DIR_NAME, SHADOW_SCRIPTS
|
|
50
|
+
export { APP_NAME_PATTERN, BUCKET_READ_DNS_NAME, BUCKET_READ_DNS_URL, BUCKET_WRITE_NAME, BUCKET_WRITE_URL, GITIGNORE_ENTRIES, MANIFEST_KEY, MANIFEST_READ_URL, MAX_PORT, MIN_PORT, REGION, SHADOW_DEV_DEPS, SHADOW_DIR_NAME, SHADOW_SCRIPTS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/shadow/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/shadow/prepare.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAA8B,cAAc,EAAkB,MAAM,UAAU,CAAC;AAE3F,wBAAsB,aAAa,IAAI,OAAO,CAAC,cAAc,CAAC,CAgC7D"}
|
|
@@ -3,7 +3,6 @@ import { info } from '../util/logger.mjs';
|
|
|
3
3
|
import { cleanAppName } from '../util/app-name.mjs';
|
|
4
4
|
import { resolveConsumerPaths } from './paths.mjs';
|
|
5
5
|
import { ensureGitignore } from './gitignore.mjs';
|
|
6
|
-
import { ensureYarnRc } from './yarnrc.mjs';
|
|
7
6
|
import { ensureConsumerPkg } from './consumer-pkg.mjs';
|
|
8
7
|
import { scaffoldShadow } from './scaffold.mjs';
|
|
9
8
|
import { readMetadata, writeMetadata } from './metadata.mjs';
|
|
@@ -28,7 +27,6 @@ async function prepareShadow() {
|
|
|
28
27
|
info(`ensured consumer pkg shape at ${paths.consumerPkg}`);
|
|
29
28
|
}
|
|
30
29
|
await ensureGitignore(paths.consumerDir);
|
|
31
|
-
await ensureYarnRc(paths.consumerDir);
|
|
32
30
|
await ensureDir(paths.shadowDir);
|
|
33
31
|
const metadata = await resolvePortAndMetadata(paths, appName);
|
|
34
32
|
const port = metadata.port;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/shadow/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/shadow/prepare.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAA8B,cAAc,EAAkB,MAAM,UAAU,CAAC;AAE3F,wBAAsB,aAAa,IAAI,OAAO,CAAC,cAAc,CAAC,CAgC7D"}
|
package/dist/shadow/prepare.js
CHANGED
|
@@ -5,7 +5,6 @@ const util_logger = require('../util/logger.js');
|
|
|
5
5
|
const util_appName = require('../util/app-name.js');
|
|
6
6
|
const shadow_paths = require('./paths.js');
|
|
7
7
|
const shadow_gitignore = require('./gitignore.js');
|
|
8
|
-
const shadow_yarnrc = require('./yarnrc.js');
|
|
9
8
|
const shadow_consumerPkg = require('./consumer-pkg.js');
|
|
10
9
|
const shadow_scaffold = require('./scaffold.js');
|
|
11
10
|
const shadow_metadata = require('./metadata.js');
|
|
@@ -30,7 +29,6 @@ async function prepareShadow() {
|
|
|
30
29
|
util_logger.info(`ensured consumer pkg shape at ${paths.consumerPkg}`);
|
|
31
30
|
}
|
|
32
31
|
await shadow_gitignore.ensureGitignore(paths.consumerDir);
|
|
33
|
-
await shadow_yarnrc.ensureYarnRc(paths.consumerDir);
|
|
34
32
|
await fsExtra.ensureDir(paths.shadowDir);
|
|
35
33
|
const metadata = await resolvePortAndMetadata(paths, appName);
|
|
36
34
|
const port = metadata.port;
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -32,13 +32,6 @@ export const MAX_PORT = 19999;
|
|
|
32
32
|
// ─────────── Gitignore entries auto-appended to the consumer's file ────
|
|
33
33
|
export const GITIGNORE_ENTRIES = ['.zth/'];
|
|
34
34
|
|
|
35
|
-
// ─────────── .yarnrc.yml written to new consumer apps ────
|
|
36
|
-
export const YARNRC_LINES = [
|
|
37
|
-
'nodeLinker: node-modules',
|
|
38
|
-
"npmAuthToken: '${NPM_TOKEN}'",
|
|
39
|
-
"npmRegistryServer: 'https://registry.npmjs.org/'",
|
|
40
|
-
];
|
|
41
|
-
|
|
42
35
|
// ─────────── Z2H deploy bucket / contract ─────────
|
|
43
36
|
// Source of truth for the bucket layout. The CLI uses these when configuring
|
|
44
37
|
// the S3 client + uploading; bigbrain-zth's STS broker imports them via
|
package/src/shadow/prepare.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { info } from '../util/logger';
|
|
|
3
3
|
import { cleanAppName } from '../util/app-name';
|
|
4
4
|
import { resolveConsumerPaths } from './paths';
|
|
5
5
|
import { ensureGitignore } from './gitignore';
|
|
6
|
-
import { ensureYarnRc } from './yarnrc';
|
|
7
6
|
import { ensureConsumerPkg } from './consumer-pkg';
|
|
8
7
|
import { scaffoldShadow } from './scaffold';
|
|
9
8
|
import { readMetadata, writeMetadata } from './metadata';
|
|
@@ -33,7 +32,6 @@ export async function prepareShadow(): Promise<PreparedShadow> {
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
await ensureGitignore(paths.consumerDir);
|
|
36
|
-
await ensureYarnRc(paths.consumerDir);
|
|
37
35
|
await ensureDir(paths.shadowDir);
|
|
38
36
|
|
|
39
37
|
const metadata = await resolvePortAndMetadata(paths, appName);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure the consumer has a `.yarnrc.yml` that pins `nodeLinker: node-modules`.
|
|
3
|
-
*
|
|
4
|
-
* Yarn 4 defaults to PnP, which trident-toolkit's webpack pipeline doesn't
|
|
5
|
-
* support cleanly (webpack expects a flat node_modules). We force the
|
|
6
|
-
* classic linker so installs produce a real `node_modules/`. Idempotent —
|
|
7
|
-
* leaves any other settings the user added alone.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ensureYarnRc(consumerDir: string): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=yarnrc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yarnrc.d.ts","sourceRoot":"","sources":["../../../src/shadow/yarnrc.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAerE"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { pathExists, writeFile, readFile } from 'fs-extra';
|
|
3
|
-
import { YARNRC_LINES } from '../constants.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Ensure the consumer has a `.yarnrc.yml` that pins `nodeLinker: node-modules`.
|
|
7
|
-
*
|
|
8
|
-
* Yarn 4 defaults to PnP, which trident-toolkit's webpack pipeline doesn't
|
|
9
|
-
* support cleanly (webpack expects a flat node_modules). We force the
|
|
10
|
-
* classic linker so installs produce a real `node_modules/`. Idempotent —
|
|
11
|
-
* leaves any other settings the user added alone.
|
|
12
|
-
*/
|
|
13
|
-
async function ensureYarnRc(consumerDir) {
|
|
14
|
-
const yarnrcPath = path.join(consumerDir, '.yarnrc.yml');
|
|
15
|
-
if (!(await pathExists(yarnrcPath))) {
|
|
16
|
-
await writeFile(yarnrcPath, YARNRC_LINES.join('\n\n') + '\n');
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const body = await readFile(yarnrcPath, 'utf8');
|
|
20
|
-
if (/^\s*nodeLinker\s*:/m.test(body)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const prefix = body.length && !body.endsWith('\n') ? '\n' : '';
|
|
24
|
-
await writeFile(yarnrcPath, body + prefix + 'nodeLinker: node-modules\n');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { ensureYarnRc };
|
package/dist/shadow/yarnrc.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure the consumer has a `.yarnrc.yml` that pins `nodeLinker: node-modules`.
|
|
3
|
-
*
|
|
4
|
-
* Yarn 4 defaults to PnP, which trident-toolkit's webpack pipeline doesn't
|
|
5
|
-
* support cleanly (webpack expects a flat node_modules). We force the
|
|
6
|
-
* classic linker so installs produce a real `node_modules/`. Idempotent —
|
|
7
|
-
* leaves any other settings the user added alone.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ensureYarnRc(consumerDir: string): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=yarnrc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yarnrc.d.ts","sourceRoot":"","sources":["../../src/shadow/yarnrc.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAerE"}
|
package/dist/shadow/yarnrc.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const path = require('node:path');
|
|
4
|
-
const fsExtra = require('fs-extra');
|
|
5
|
-
const constants = require('../constants.js');
|
|
6
|
-
|
|
7
|
-
const _interopDefault = e => e && e.__esModule ? e : { default: e };
|
|
8
|
-
|
|
9
|
-
const path__default = /*#__PURE__*/_interopDefault(path);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Ensure the consumer has a `.yarnrc.yml` that pins `nodeLinker: node-modules`.
|
|
13
|
-
*
|
|
14
|
-
* Yarn 4 defaults to PnP, which trident-toolkit's webpack pipeline doesn't
|
|
15
|
-
* support cleanly (webpack expects a flat node_modules). We force the
|
|
16
|
-
* classic linker so installs produce a real `node_modules/`. Idempotent —
|
|
17
|
-
* leaves any other settings the user added alone.
|
|
18
|
-
*/
|
|
19
|
-
async function ensureYarnRc(consumerDir) {
|
|
20
|
-
const yarnrcPath = path__default.default.join(consumerDir, '.yarnrc.yml');
|
|
21
|
-
if (!(await fsExtra.pathExists(yarnrcPath))) {
|
|
22
|
-
await fsExtra.writeFile(yarnrcPath, constants.YARNRC_LINES.join('\n\n') + '\n');
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const body = await fsExtra.readFile(yarnrcPath, 'utf8');
|
|
26
|
-
if (/^\s*nodeLinker\s*:/m.test(body)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const prefix = body.length && !body.endsWith('\n') ? '\n' : '';
|
|
30
|
-
await fsExtra.writeFile(yarnrcPath, body + prefix + 'nodeLinker: node-modules\n');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
exports.ensureYarnRc = ensureYarnRc;
|
package/src/shadow/yarnrc.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { pathExists, readFile, writeFile } from 'fs-extra';
|
|
3
|
-
import { YARNRC_LINES } from '../constants';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Ensure the consumer has a `.yarnrc.yml` that pins `nodeLinker: node-modules`.
|
|
7
|
-
*
|
|
8
|
-
* Yarn 4 defaults to PnP, which trident-toolkit's webpack pipeline doesn't
|
|
9
|
-
* support cleanly (webpack expects a flat node_modules). We force the
|
|
10
|
-
* classic linker so installs produce a real `node_modules/`. Idempotent —
|
|
11
|
-
* leaves any other settings the user added alone.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export async function ensureYarnRc(consumerDir: string): Promise<void> {
|
|
15
|
-
const yarnrcPath = path.join(consumerDir, '.yarnrc.yml');
|
|
16
|
-
|
|
17
|
-
if (!(await pathExists(yarnrcPath))) {
|
|
18
|
-
await writeFile(yarnrcPath, YARNRC_LINES.join('\n\n') + '\n');
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const body = await readFile(yarnrcPath, 'utf8');
|
|
23
|
-
if (/^\s*nodeLinker\s*:/m.test(body)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const prefix = body.length && !body.endsWith('\n') ? '\n' : '';
|
|
28
|
-
await writeFile(yarnrcPath, body + prefix + 'nodeLinker: node-modules\n');
|
|
29
|
-
}
|