@forge/cli-shared 6.6.2-next.1 → 6.6.2-next.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 +6 -0
- package/out/config/config-file.d.ts +0 -1
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +0 -7
- package/out/graphql/graphql-types.d.ts +57 -0
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/shared/index.d.ts +3 -3
- package/out/shared/index.d.ts.map +1 -1
- package/out/shared/index.js +3 -3
- package/out/shared/test.d.ts +15 -0
- package/out/shared/test.d.ts.map +1 -0
- package/out/shared/test.js +52 -0
- package/package.json +1 -2
- package/out/shared/mock-logger.d.ts +0 -3
- package/out/shared/mock-logger.d.ts.map +0 -1
- package/out/shared/mock-logger.js +0 -16
package/out/shared/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
export * from './assertUnreachable';
|
|
2
|
+
export * from './cli-details';
|
|
1
3
|
export * from './directories';
|
|
2
4
|
export * from './environment';
|
|
3
5
|
export * from './error-handling';
|
|
4
|
-
export * from './mock-logger';
|
|
5
6
|
export * from './pause';
|
|
6
7
|
export * from './product';
|
|
7
8
|
export * from './read-app-config-files';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './assertUnreachable';
|
|
9
|
+
export * from './test';
|
|
10
10
|
import flatMap from 'array.prototype.flatmap';
|
|
11
11
|
declare const flat: <T>(array: T[][]) => T[];
|
|
12
12
|
export { flatMap, flat };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAEA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AAEvB,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,QAAA,MAAM,IAAI,0BAAqD,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/out/shared/index.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.flat = exports.flatMap = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./assertUnreachable"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./cli-details"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./directories"), exports);
|
|
6
8
|
tslib_1.__exportStar(require("./environment"), exports);
|
|
7
9
|
tslib_1.__exportStar(require("./error-handling"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./mock-logger"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./pause"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./product"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./read-app-config-files"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./
|
|
13
|
-
tslib_1.__exportStar(require("./assertUnreachable"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./test"), exports);
|
|
14
14
|
const array_prototype_flatmap_1 = tslib_1.__importDefault(require("array.prototype.flatmap"));
|
|
15
15
|
exports.flatMap = array_prototype_flatmap_1.default;
|
|
16
16
|
const flat = (array) => (0, array_prototype_flatmap_1.default)(array, (x) => x);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Logger } from '../ui';
|
|
2
|
+
export declare function mockLogger(traceEnabled: boolean, debugEnabled: boolean): Logger;
|
|
3
|
+
declare type TestApp = {
|
|
4
|
+
appDirectory: string;
|
|
5
|
+
entryPoints: {
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare function createTestApp({ userCode, packages }: {
|
|
11
|
+
userCode: string;
|
|
12
|
+
packages?: string[];
|
|
13
|
+
}): Promise<TestApp>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/shared/test.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAW/E;AAED,aAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC;AAEF,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,GAAG,OAAO,CAAC,OAAO,CAAC,CAwCnB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTestApp = exports.mockLogger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
|
+
const directories_1 = require("./directories");
|
|
9
|
+
function mockLogger(traceEnabled, debugEnabled) {
|
|
10
|
+
return {
|
|
11
|
+
traceEnabled,
|
|
12
|
+
debugEnabled,
|
|
13
|
+
trace: jest.fn(),
|
|
14
|
+
debug: jest.fn(),
|
|
15
|
+
info: jest.fn(),
|
|
16
|
+
warn: jest.fn(),
|
|
17
|
+
error: jest.fn(),
|
|
18
|
+
snapshotLog: jest.fn()
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.mockLogger = mockLogger;
|
|
22
|
+
async function createTestApp({ userCode, packages }) {
|
|
23
|
+
const appDirectory = (0, directories_1.tmpDir)();
|
|
24
|
+
const srcDirectory = path_1.default.join(appDirectory, 'src');
|
|
25
|
+
await (0, fs_extra_1.ensureDir)(srcDirectory);
|
|
26
|
+
const userCodePath = path_1.default.join(srcDirectory, 'index.ts');
|
|
27
|
+
await (0, promises_1.writeFile)(userCodePath, userCode);
|
|
28
|
+
await (0, promises_1.writeFile)(path_1.default.join(appDirectory, 'tsconfig.json'), JSON.stringify({}));
|
|
29
|
+
const allPackages = ['@types/node', ...(packages ?? [])];
|
|
30
|
+
await (0, promises_1.writeFile)(path_1.default.join(appDirectory, 'package.json'), JSON.stringify({
|
|
31
|
+
dependencies: Object.fromEntries(allPackages.map((pkg) => [pkg, '*']))
|
|
32
|
+
}));
|
|
33
|
+
const monorepoNodeModules = path_1.default.join(__dirname, '..', '..', '..', '..', 'node_modules');
|
|
34
|
+
const monorepoPackages = path_1.default.join(__dirname, '..', '..', '..', '..', 'packages');
|
|
35
|
+
for (const pkg of allPackages) {
|
|
36
|
+
let src;
|
|
37
|
+
if (pkg.startsWith('@forge/')) {
|
|
38
|
+
src = path_1.default.join(monorepoPackages, pkg.replace('@forge/', 'forge-'));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
src = path_1.default.join(monorepoNodeModules, pkg);
|
|
42
|
+
}
|
|
43
|
+
const dest = path_1.default.join(appDirectory, 'node_modules', pkg);
|
|
44
|
+
await (0, fs_extra_1.ensureDir)(dest);
|
|
45
|
+
await (0, fs_extra_1.copy)(src, dest);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
appDirectory,
|
|
49
|
+
entryPoints: [{ name: 'main', path: userCodePath }]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.createTestApp = createTestApp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli-shared",
|
|
3
|
-
"version": "6.6.2-next.
|
|
3
|
+
"version": "6.6.2-next.2",
|
|
4
4
|
"description": "Common functionality for Forge CLI",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"inquirer": "^8.2.6",
|
|
36
36
|
"io-ts": "^2.2.21",
|
|
37
37
|
"keytar": "^7.9.0",
|
|
38
|
-
"launchdarkly-node-client-sdk": "^3.0.2",
|
|
39
38
|
"node-fetch": "2.7.0",
|
|
40
39
|
"ora": "^5.4.1",
|
|
41
40
|
"recursive-readdir": "^2.2.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock-logger.d.ts","sourceRoot":"","sources":["../../src/shared/mock-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAW/E"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mockLogger = void 0;
|
|
4
|
-
function mockLogger(traceEnabled, debugEnabled) {
|
|
5
|
-
return {
|
|
6
|
-
traceEnabled,
|
|
7
|
-
debugEnabled,
|
|
8
|
-
trace: jest.fn(),
|
|
9
|
-
debug: jest.fn(),
|
|
10
|
-
info: jest.fn(),
|
|
11
|
-
warn: jest.fn(),
|
|
12
|
-
error: jest.fn(),
|
|
13
|
-
snapshotLog: jest.fn()
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
exports.mockLogger = mockLogger;
|