@intuned/runtime-dev 0.1.0-test.15 → 0.1.0-test.17
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/.babelrc +1 -2
- package/WebTemplate/api.ts +90 -92
- package/WebTemplate/controllers/authSessions/create.ts +2 -2
- package/WebTemplate/controllers/authSessions/store.ts +1 -1
- package/WebTemplate/controllers/runApi/helpers.ts +14 -12
- package/WebTemplate/index.playwright.ts +32 -42
- package/WebTemplate/jobs.ts +13 -2
- package/WebTemplate/utils.ts +53 -1
- package/api/test2.ts +6 -1
- package/auth-sessions/check.ts +3 -1
- package/auth-sessions/create.ts +10 -10
- package/dist/commands/api/run.js +41 -29
- package/dist/commands/auth-sessions/load.js +13 -11
- package/dist/commands/auth-sessions/run-check.js +21 -14
- package/dist/commands/auth-sessions/run-create.js +32 -25
- package/dist/commands/browser/save-state.js +10 -7
- package/dist/commands/browser/start-browser.js +10 -7
- package/dist/commands/build.js +30 -27
- package/dist/commands/common/browserUtils.js +28 -15
- package/dist/commands/common/getFirstLineNumber.js +20 -13
- package/dist/commands/common/getFirstLineNumber.test.js +52 -48
- package/dist/commands/common/sendMessageToClient.js +9 -2
- package/dist/commands/common/tsNodeImport.d.ts +1 -0
- package/dist/commands/common/tsNodeImport.js +18 -0
- package/dist/commands/common/utils/fileUtils.js +16 -6
- package/dist/commands/common/utils/settings.js +13 -7
- package/dist/commands/common/utils/unixSocket.js +9 -2
- package/dist/commands/common/utils/webTemplate.js +17 -9
- package/dist/commands/interface/run.js +163 -134
- package/dist/commands/ts-check.js +13 -10
- package/dist/common/Logger/Logger/index.js +16 -9
- package/dist/common/Logger/Logger/types.js +5 -1
- package/dist/common/Logger/index.js +16 -9
- package/dist/common/Logger/types.js +5 -1
- package/dist/common/asyncLocalStorage/index.js +12 -4
- package/dist/common/cleanEnvironmentVariables.js +7 -1
- package/dist/common/constants.js +7 -1
- package/dist/common/contextStorageStateHelpers.js +9 -2
- package/dist/common/getPlaywrightConstructs.js +39 -29
- package/dist/common/jwtTokenManager.js +18 -8
- package/dist/common/runApi/errors.js +42 -24
- package/dist/common/runApi/index.js +97 -103
- package/dist/common/runApi/types.d.ts +19 -5
- package/dist/common/runApi/types.js +42 -31
- package/dist/common/settingsSchema.js +10 -2
- package/dist/common/telemetry.js +12 -3
- package/dist/index.js +69 -4
- package/dist/runtime/RunError.js +8 -1
- package/dist/runtime/downloadDirectory.js +11 -5
- package/dist/runtime/enums.d.js +5 -1
- package/dist/runtime/enums.js +8 -2
- package/dist/runtime/executionHelpers.test.js +22 -20
- package/dist/runtime/export.d.js +5 -1
- package/dist/runtime/extendPayload.js +11 -5
- package/dist/runtime/extendTimeout.js +9 -3
- package/dist/runtime/index.js +53 -6
- package/dist/runtime/requestMoreInfo.js +9 -2
- package/dist/runtime/runInfo.js +11 -5
- package/package.json +3 -5
- package/dist/commands/common/getDefaultExportFromFile.d.ts +0 -0
- package/dist/commands/common/getDefaultExportFromFile.js +0 -0
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _getFirstLineNumber = _interopRequireDefault(require("./getFirstLineNumber.js"));
|
|
5
|
+
var fs = _interopRequireWildcard(require("fs"));
|
|
6
|
+
var path = _interopRequireWildcard(require("path"));
|
|
7
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
(0, _vitest.describe)("getFirstLineNumber", () => {
|
|
11
|
+
const testFilesDir = path.join(path.dirname(__filename), "testFiles");
|
|
8
12
|
const createTestFile = (fileName, content) => {
|
|
9
13
|
const filePath = path.join(testFilesDir, fileName);
|
|
10
14
|
fs.writeFileSync(filePath, content);
|
|
11
15
|
return filePath;
|
|
12
16
|
};
|
|
13
|
-
beforeAll(() => {
|
|
17
|
+
(0, _vitest.beforeAll)(() => {
|
|
14
18
|
if (!fs.existsSync(testFilesDir)) {
|
|
15
19
|
fs.mkdirSync(testFilesDir);
|
|
16
20
|
}
|
|
17
21
|
});
|
|
18
|
-
afterAll(() => {
|
|
22
|
+
(0, _vitest.afterAll)(() => {
|
|
19
23
|
fs.readdirSync(testFilesDir).forEach(file => fs.unlinkSync(path.join(testFilesDir, file)));
|
|
20
24
|
fs.rmdirSync(testFilesDir);
|
|
21
25
|
});
|
|
22
|
-
it("correctly identifies first line in a default exported named function", async () => {
|
|
26
|
+
(0, _vitest.it)("correctly identifies first line in a default exported named function", async () => {
|
|
23
27
|
const filePath = createTestFile("defaultFunction.ts", `import {
|
|
24
28
|
EnhancedPlaywrightPage,
|
|
25
29
|
EnhancedPlaywrightBrowserContext,
|
|
@@ -42,10 +46,10 @@ describe("getFirstLineNumber", () => {
|
|
|
42
46
|
return { done: "true", name: "custom name from api1" };
|
|
43
47
|
}
|
|
44
48
|
`);
|
|
45
|
-
const result = await
|
|
46
|
-
expect(result.lineNumber).toBe(4);
|
|
49
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
50
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
47
51
|
});
|
|
48
|
-
it("correctly identifies first line in a default exported anonymous function", async () => {
|
|
52
|
+
(0, _vitest.it)("correctly identifies first line in a default exported anonymous function", async () => {
|
|
49
53
|
const filePath = createTestFile("defaultFunction.ts", `import {
|
|
50
54
|
EnhancedPlaywrightPage,
|
|
51
55
|
EnhancedPlaywrightBrowserContext,
|
|
@@ -68,10 +72,10 @@ describe("getFirstLineNumber", () => {
|
|
|
68
72
|
return { done: "true", name: "custom name from api1" };
|
|
69
73
|
}
|
|
70
74
|
`);
|
|
71
|
-
const result = await
|
|
72
|
-
expect(result.lineNumber).toBe(4);
|
|
75
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
76
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
73
77
|
});
|
|
74
|
-
it("correctly identifies first line in a default exported function identifier", async () => {
|
|
78
|
+
(0, _vitest.it)("correctly identifies first line in a default exported function identifier", async () => {
|
|
75
79
|
const filePath = createTestFile("defaultFunction.ts", `import {
|
|
76
80
|
EnhancedPlaywrightPage,
|
|
77
81
|
EnhancedPlaywrightBrowserContext,
|
|
@@ -95,10 +99,10 @@ describe("getFirstLineNumber", () => {
|
|
|
95
99
|
}
|
|
96
100
|
export default runApi;
|
|
97
101
|
`);
|
|
98
|
-
const result = await
|
|
99
|
-
expect(result.lineNumber).toBe(4);
|
|
102
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
103
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
100
104
|
});
|
|
101
|
-
it("correctly identifies first line in a file with multiple exports including a default function", async () => {
|
|
105
|
+
(0, _vitest.it)("correctly identifies first line in a file with multiple exports including a default function", async () => {
|
|
102
106
|
const filePath = createTestFile("multipleExports.ts", `import {
|
|
103
107
|
EnhancedPlaywrightPage,
|
|
104
108
|
EnhancedPlaywrightBrowserContext,
|
|
@@ -122,10 +126,10 @@ describe("getFirstLineNumber", () => {
|
|
|
122
126
|
return { done: "true", name: "custom name from api1" };
|
|
123
127
|
}
|
|
124
128
|
export default runApi;`);
|
|
125
|
-
const result = await
|
|
126
|
-
expect(result.lineNumber).toBe(7);
|
|
129
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
130
|
+
(0, _vitest.expect)(result.lineNumber).toBe(7);
|
|
127
131
|
});
|
|
128
|
-
it("correctly identifies first line in a default exported arrow function identifier", async () => {
|
|
132
|
+
(0, _vitest.it)("correctly identifies first line in a default exported arrow function identifier", async () => {
|
|
129
133
|
const filePath = createTestFile("multipleExports.ts", `import {
|
|
130
134
|
EnhancedPlaywrightPage,
|
|
131
135
|
EnhancedPlaywrightBrowserContext,
|
|
@@ -148,10 +152,10 @@ describe("getFirstLineNumber", () => {
|
|
|
148
152
|
return { done: "true", name: "custom name from api1" };
|
|
149
153
|
}
|
|
150
154
|
export default runApi;`);
|
|
151
|
-
const result = await
|
|
152
|
-
expect(result.lineNumber).toBe(4);
|
|
155
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
156
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
153
157
|
});
|
|
154
|
-
it("correctly identifies first line in a default exported anonymous arrow function", async () => {
|
|
158
|
+
(0, _vitest.it)("correctly identifies first line in a default exported anonymous arrow function", async () => {
|
|
155
159
|
const filePath = createTestFile("multipleExports.ts", `import {
|
|
156
160
|
EnhancedPlaywrightPage,
|
|
157
161
|
EnhancedPlaywrightBrowserContext,
|
|
@@ -173,52 +177,52 @@ describe("getFirstLineNumber", () => {
|
|
|
173
177
|
await page.getByLabel("Search Wikipedia").press("Enter");
|
|
174
178
|
return { done: "true", name: "custom name from api1" };
|
|
175
179
|
};`);
|
|
176
|
-
const result = await
|
|
177
|
-
expect(result.lineNumber).toBe(4);
|
|
180
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
181
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
178
182
|
});
|
|
179
|
-
it("identifies first executable line in a default exported arrow function", async () => {
|
|
183
|
+
(0, _vitest.it)("identifies first executable line in a default exported arrow function", async () => {
|
|
180
184
|
const filePath = createTestFile("defaultArrowFunction.ts", `export default () => {
|
|
181
185
|
console.log("Hello, Arrow World!");
|
|
182
186
|
};`);
|
|
183
|
-
const result = await
|
|
184
|
-
expect(result.lineNumber).toBe(4);
|
|
187
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
188
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
185
189
|
});
|
|
186
|
-
it("identifies first executable line within nested functions of a default export", async () => {
|
|
190
|
+
(0, _vitest.it)("identifies first executable line within nested functions of a default export", async () => {
|
|
187
191
|
const filePath = createTestFile("nestedFunctions.ts", `const x = 4;
|
|
188
192
|
export default function() {
|
|
189
193
|
const nested = (x) => console.log("Nested function call");
|
|
190
194
|
nested(x);
|
|
191
195
|
}`);
|
|
192
|
-
const result = await
|
|
193
|
-
expect(result.lineNumber).toBe(5);
|
|
196
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
197
|
+
(0, _vitest.expect)(result.lineNumber).toBe(5);
|
|
194
198
|
});
|
|
195
|
-
it("handles async default exported function correctly", async () => {
|
|
199
|
+
(0, _vitest.it)("handles async default exported function correctly", async () => {
|
|
196
200
|
const filePath = createTestFile("asyncDefaultFunction.ts", `export default async function() {
|
|
197
201
|
await Promise.resolve(console.log("Async Hello, World!"));
|
|
198
202
|
}`);
|
|
199
|
-
const result = await
|
|
200
|
-
expect(result.lineNumber).toBe(4);
|
|
203
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
204
|
+
(0, _vitest.expect)(result.lineNumber).toBe(4);
|
|
201
205
|
});
|
|
202
|
-
it("returns -1 for a default exported class", async () => {
|
|
206
|
+
(0, _vitest.it)("returns -1 for a default exported class", async () => {
|
|
203
207
|
const filePath = createTestFile("defaultClass.ts", `export default class MyClass {
|
|
204
208
|
constructor() {}
|
|
205
209
|
}`);
|
|
206
|
-
const result = await
|
|
207
|
-
expect(result.lineNumber).toBe(-1);
|
|
210
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
211
|
+
(0, _vitest.expect)(result.lineNumber).toBe(-1);
|
|
208
212
|
});
|
|
209
|
-
it("returns -1 for a default exported variable", async () => {
|
|
213
|
+
(0, _vitest.it)("returns -1 for a default exported variable", async () => {
|
|
210
214
|
const filePath = createTestFile("defaultVariable.ts", `export default 42;`);
|
|
211
|
-
const result = await
|
|
212
|
-
expect(result.lineNumber).toBe(-1);
|
|
215
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
216
|
+
(0, _vitest.expect)(result.lineNumber).toBe(-1);
|
|
213
217
|
});
|
|
214
|
-
it("returns -1 when there is no default export", async () => {
|
|
218
|
+
(0, _vitest.it)("returns -1 when there is no default export", async () => {
|
|
215
219
|
const filePath = createTestFile("noDefaultExport.ts", `export const foo = () => console.log("bar");`);
|
|
216
|
-
const result = await
|
|
217
|
-
expect(result.lineNumber).toBe(-1);
|
|
220
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
221
|
+
(0, _vitest.expect)(result.lineNumber).toBe(-1);
|
|
218
222
|
});
|
|
219
|
-
it("returns -1 for an empty file", async () => {
|
|
223
|
+
(0, _vitest.it)("returns -1 for an empty file", async () => {
|
|
220
224
|
const filePath = createTestFile("emptyFile.ts", ``);
|
|
221
|
-
const result = await
|
|
222
|
-
expect(result.lineNumber).toBe(-1);
|
|
225
|
+
const result = await (0, _getFirstLineNumber.default)(filePath);
|
|
226
|
+
(0, _vitest.expect)(result.lineNumber).toBe(-1);
|
|
223
227
|
});
|
|
224
228
|
});
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sendBreakPointOnToClient = void 0;
|
|
7
|
+
const sendBreakPointOnToClient = (sourceFileName, lineNumber) => {
|
|
2
8
|
console.log(`breakpoint on ${sourceFileName}:${lineNumber}`);
|
|
3
|
-
};
|
|
9
|
+
};
|
|
10
|
+
exports.sendBreakPointOnToClient = sendBreakPointOnToClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tsNodeImport(apiFilePath: string): Promise<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.tsNodeImport = tsNodeImport;
|
|
7
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
async function tsNodeImport(apiFilePath) {
|
|
10
|
+
require("ts-node").register({
|
|
11
|
+
transpileOnly: true,
|
|
12
|
+
compilerOptions: {
|
|
13
|
+
lib: ["dom", "es2020"]
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const imported = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(apiFilePath);
|
|
17
|
+
return imported.default;
|
|
18
|
+
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getFullPathInProject = getFullPathInProject;
|
|
7
|
+
exports.listProjectFilesAndFolders = listProjectFilesAndFolders;
|
|
8
|
+
var path = _interopRequireWildcard(require("path"));
|
|
9
|
+
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
10
|
+
var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
_dotenv.default.config();
|
|
15
|
+
function getFullPathInProject(...paths) {
|
|
6
16
|
return path.resolve(process.cwd(), process.env.ROOT || "./", ...paths);
|
|
7
17
|
}
|
|
8
|
-
|
|
18
|
+
async function listProjectFilesAndFolders() {
|
|
9
19
|
const projectPath = path.resolve(process.cwd(), process.env.ROOT || "./");
|
|
10
20
|
try {
|
|
11
21
|
const files = await fs.readdir(projectPath, {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSettings = getSettings;
|
|
7
|
+
var _fileUtils = require("./fileUtils.js");
|
|
8
|
+
var _settingsSchema = require("../../../common/settingsSchema");
|
|
9
|
+
var _fsExtra = require("fs-extra");
|
|
10
|
+
async function getSettings() {
|
|
11
|
+
const settingsFilePath = (0, _fileUtils.getFullPathInProject)("Intuned.json");
|
|
6
12
|
console.log("loading settings");
|
|
7
|
-
const settings = await readJSON(settingsFilePath);
|
|
13
|
+
const settings = await (0, _fsExtra.readJSON)(settingsFilePath);
|
|
8
14
|
if (settings) {
|
|
9
|
-
const parsed = settingsSchema.safeParse(settings);
|
|
15
|
+
const parsed = _settingsSchema.settingsSchema.safeParse(settings);
|
|
10
16
|
console.log(parsed);
|
|
11
17
|
if (parsed.success) {
|
|
12
18
|
return parsed.data;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.JSONUnixSocket = void 0;
|
|
7
|
+
class JSONUnixSocket {
|
|
2
8
|
static LENGTH_HEADER_LENGTH = 4;
|
|
3
9
|
constructor(socket) {
|
|
4
10
|
this.socket = socket;
|
|
@@ -35,4 +41,5 @@ export class JSONUnixSocket {
|
|
|
35
41
|
yield JSON.parse(data.toString());
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
|
-
}
|
|
44
|
+
}
|
|
45
|
+
exports.JSONUnixSocket = JSONUnixSocket;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.moveWebTemplateFiles = void 0;
|
|
7
|
+
var fs = _interopRequireWildcard(require("fs-extra"));
|
|
8
|
+
var path = _interopRequireWildcard(require("path"));
|
|
9
|
+
var _fileUtils = require("./fileUtils.js");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const moveWebTemplateFiles = async () => {
|
|
6
13
|
await fs.remove("./intuned");
|
|
7
14
|
await fs.ensureDir("./intuned");
|
|
8
|
-
const currentFileLocation = path.resolve(path.dirname(
|
|
15
|
+
const currentFileLocation = path.resolve(path.dirname(__filename), "..", "..", "..", "..", "WebTemplate");
|
|
9
16
|
await fs.copy(`${currentFileLocation}`, "./intuned/WebTemplate", {
|
|
10
17
|
filter: (src, dest) => {
|
|
11
18
|
if (src.includes(".d.ts")) {
|
|
@@ -14,10 +21,11 @@ export const moveWebTemplateFiles = async () => {
|
|
|
14
21
|
return true;
|
|
15
22
|
}
|
|
16
23
|
});
|
|
17
|
-
const filesAndFolders = await listProjectFilesAndFolders();
|
|
18
|
-
const pathsIgnoreList = [getFullPathInProject("intuned"), getFullPathInProject("node_modules"), getFullPathInProject("package.json"), getFullPathInProject("yarn.lock"), getFullPathInProject(".env")];
|
|
24
|
+
const filesAndFolders = await (0, _fileUtils.listProjectFilesAndFolders)();
|
|
25
|
+
const pathsIgnoreList = [(0, _fileUtils.getFullPathInProject)("intuned"), (0, _fileUtils.getFullPathInProject)("node_modules"), (0, _fileUtils.getFullPathInProject)("package.json"), (0, _fileUtils.getFullPathInProject)("yarn.lock"), (0, _fileUtils.getFullPathInProject)(".env")];
|
|
19
26
|
const filesToCopy = filesAndFolders.filter(file => !pathsIgnoreList.includes(file.fullPath));
|
|
20
27
|
for (const file of filesToCopy) {
|
|
21
28
|
await fs.copy(file.fullPath, `./intuned/WebTemplate/${file.name}`);
|
|
22
29
|
}
|
|
23
|
-
};
|
|
30
|
+
};
|
|
31
|
+
exports.moveWebTemplateFiles = moveWebTemplateFiles;
|