@constructor-io/constructorio-connect-cli 1.15.3 → 1.15.4
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/customer/config.d.ts +3 -1
- package/dist/customer/config.d.ts.map +1 -1
- package/dist/customer/config.js +13 -11
- package/dist/helpers/lint-config-file.d.ts.map +1 -1
- package/dist/helpers/lint-config-file.js +6 -1
- package/dist/helpers/refresh-connections-list.d.ts.map +1 -1
- package/dist/helpers/refresh-connections-list.js +7 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,9 @@ export declare function getRepositoryConfigFile(): Promise<Config>;
|
|
|
10
10
|
* Reads the content of the connectrc.js file and returns the connections object and the content of the file
|
|
11
11
|
* @returns The connections object and the content of the connectrc.js file in {@link RawConfigContent}
|
|
12
12
|
*/
|
|
13
|
-
export declare function getRepositoryConnectionsAndConfig(
|
|
13
|
+
export declare function getRepositoryConnectionsAndConfig({ shouldPrintExecutionWarnings, }?: {
|
|
14
|
+
shouldPrintExecutionWarnings?: boolean | undefined;
|
|
15
|
+
}): Promise<RawConfigContent>;
|
|
14
16
|
interface RawConfigContent {
|
|
15
17
|
fileContent: string;
|
|
16
18
|
existingConnections: ConnectionConfigDict;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/customer/config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIlE;;;;;GAKG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAsC/D;AAED;;;GAGG;AACH,wBAAsB,iCAAiC,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/customer/config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIlE;;;;;GAKG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAsC/D;AAED;;;GAGG;AACH,wBAAsB,iCAAiC,CAAC,EACtD,4BAAmC,GACpC;;CAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+CjC;AA+HD,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,oBAAoB,CAAC;CAC3C"}
|
package/dist/customer/config.js
CHANGED
|
@@ -80,7 +80,7 @@ pointing to the correct connectrc.js directory.`,
|
|
|
80
80
|
* Reads the content of the connectrc.js file and returns the connections object and the content of the file
|
|
81
81
|
* @returns The connections object and the content of the connectrc.js file in {@link RawConfigContent}
|
|
82
82
|
*/
|
|
83
|
-
async function getRepositoryConnectionsAndConfig() {
|
|
83
|
+
async function getRepositoryConnectionsAndConfig({ shouldPrintExecutionWarnings = true, } = {}) {
|
|
84
84
|
const configPath = (0, path_1.getCustomerOSSpecificPath)("connectrc.js");
|
|
85
85
|
const fileContent = await readRawConfigFile(configPath);
|
|
86
86
|
// Get the connections object from the content of the connectrc.js file
|
|
@@ -106,16 +106,18 @@ async function getRepositoryConnectionsAndConfig() {
|
|
|
106
106
|
if (hasParseObjectError(error) && !connectionsStr.includes("process.env")) {
|
|
107
107
|
return handleParseObjectError(error, connectionsStr, fileContent);
|
|
108
108
|
}
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
if (shouldPrintExecutionWarnings) {
|
|
110
|
+
(0, print_warnings_1.printExecutionWarnings)({
|
|
111
|
+
warnings: [
|
|
112
|
+
{
|
|
113
|
+
type: "Config",
|
|
114
|
+
critical: true,
|
|
115
|
+
message: `Failed to parse the connections object in connectrc.js. Are you running a custom setup?`,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
showDocsLink: false,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
119
121
|
return { fileContent, existingConnections: {} };
|
|
120
122
|
}
|
|
121
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint-config-file.d.ts","sourceRoot":"","sources":["../../src/helpers/lint-config-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lint-config-file.d.ts","sourceRoot":"","sources":["../../src/helpers/lint-config-file.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAsB,cAAc,kBAQnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,iBAgCpD"}
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.lintConfigFile = lintConfigFile;
|
|
37
37
|
exports.addRuleToConfig = addRuleToConfig;
|
|
38
38
|
const child_process_1 = require("child_process");
|
|
39
|
+
const fs_1 = require("fs");
|
|
39
40
|
const fs = __importStar(require("fs/promises"));
|
|
40
41
|
const path_1 = require("../customer/path");
|
|
41
42
|
/**
|
|
@@ -56,7 +57,11 @@ async function lintConfigFile() {
|
|
|
56
57
|
* where '@stylistic/js/quote-props' is in single quotes
|
|
57
58
|
*/
|
|
58
59
|
async function addRuleToConfig(rules) {
|
|
59
|
-
|
|
60
|
+
// eslint config file should be present as checked in the refresh-connections-list.ts file
|
|
61
|
+
// It will either be eslint.config.js or eslint.config.mjs
|
|
62
|
+
const eslintConfigPath = (0, fs_1.existsSync)("eslint.config.js")
|
|
63
|
+
? "eslint.config.js"
|
|
64
|
+
: "eslint.config.mjs";
|
|
60
65
|
const eslintConfig = await fs.readFile(eslintConfigPath, "utf-8");
|
|
61
66
|
const missingRules = rules.filter((rule) => {
|
|
62
67
|
// Extract rule names (part between single quotes, eg: "@stylistic/js/quote-props")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-connections-list.d.ts","sourceRoot":"","sources":["../../src/helpers/refresh-connections-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"refresh-connections-list.d.ts","sourceRoot":"","sources":["../../src/helpers/refresh-connections-list.ts"],"names":[],"mappings":"AAgBA,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB5D"}
|
|
@@ -44,6 +44,7 @@ const build_config_file_1 = require("./build-config-file");
|
|
|
44
44
|
const lint_config_file_1 = require("./lint-config-file");
|
|
45
45
|
const should_update_connections_list_1 = require("./should-update-connections-list");
|
|
46
46
|
const ux_action_1 = require("./ux-action");
|
|
47
|
+
const fs_1 = require("fs");
|
|
47
48
|
async function refreshConnectionsList() {
|
|
48
49
|
try {
|
|
49
50
|
const shouldUpdate = await checkConfigFileState();
|
|
@@ -51,7 +52,9 @@ async function refreshConnectionsList() {
|
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
await updateConfigFile();
|
|
54
|
-
|
|
55
|
+
if ((0, fs_1.existsSync)("eslint.config.js") || (0, fs_1.existsSync)("eslint.config.mjs")) {
|
|
56
|
+
await (0, lint_config_file_1.lintConfigFile)();
|
|
57
|
+
}
|
|
55
58
|
}
|
|
56
59
|
catch (error) {
|
|
57
60
|
core_1.ux.stdout(`Error refreshing connections list: ${error.message}`);
|
|
@@ -85,7 +88,9 @@ async function checkConfigFileState() {
|
|
|
85
88
|
async function updateConfigFile() {
|
|
86
89
|
const formattedConnections = await fetchNewConnections();
|
|
87
90
|
const rcPath = (0, path_1.getCustomerOSSpecificPath)("connectrc.js");
|
|
88
|
-
const { fileContent } = await (0, config_1.getRepositoryConnectionsAndConfig)(
|
|
91
|
+
const { fileContent } = await (0, config_1.getRepositoryConnectionsAndConfig)({
|
|
92
|
+
shouldPrintExecutionWarnings: false,
|
|
93
|
+
});
|
|
89
94
|
if (!fileContent) {
|
|
90
95
|
return;
|
|
91
96
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED