@squidcloud/cli 1.0.401 → 1.0.402
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/index.js +34 -31
- package/package.json +2 -3
package/dist/index.js
CHANGED
@@ -980,7 +980,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
980
980
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
981
981
|
};
|
982
982
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
983
|
-
exports
|
983
|
+
exports.start = start;
|
984
984
|
const fs = __importStar(__webpack_require__(1943));
|
985
985
|
const path_1 = __importDefault(__webpack_require__(6928));
|
986
986
|
const resolve_1 = __webpack_require__(412);
|
@@ -988,7 +988,7 @@ const shell_runner_1 = __webpack_require__(3089);
|
|
988
988
|
const logging_1 = __webpack_require__(443);
|
989
989
|
const process_utils_1 = __webpack_require__(8251);
|
990
990
|
const validate_1 = __webpack_require__(2246);
|
991
|
-
async function
|
991
|
+
async function start() {
|
992
992
|
const packageJson = await (0, validate_1.validateSquidProject)();
|
993
993
|
console.log((0, logging_1.primary)('Please note:'), 'to debug your application, you need to run the "start" npm script in your IDE in debug mode');
|
994
994
|
console.log((0, logging_1.primary)('Starting...'));
|
@@ -1974,10 +1974,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
1974
1974
|
};
|
1975
1975
|
})();
|
1976
1976
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
1977
|
-
exports
|
1977
|
+
exports.initWebpack = initWebpack;
|
1978
1978
|
const fs = __importStar(__webpack_require__(1943));
|
1979
1979
|
const resolve_1 = __webpack_require__(3878);
|
1980
|
-
async function
|
1980
|
+
async function initWebpack() {
|
1981
1981
|
// Create a default webpack.config.js for a user.
|
1982
1982
|
// A user will be free to modify it as he wants.
|
1983
1983
|
await fs.copyFile(resolve_1.BUILT_IN_WEBPACK_CONFIG_PATH, resolve_1.USER_WEBPACK_CONFIG_PATH);
|
@@ -3323,6 +3323,9 @@ module.exports["default"] = isFullwidthCodePoint;
|
|
3323
3323
|
|
3324
3324
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
3325
3325
|
exports.parseSquidRegion = parseSquidRegion;
|
3326
|
+
function isStage(possibleStage) {
|
3327
|
+
return ['local', 'sandbox', 'staging'].includes(possibleStage);
|
3328
|
+
}
|
3326
3329
|
function parseSquidRegion(input) {
|
3327
3330
|
if (input === 'local') {
|
3328
3331
|
return {
|
@@ -3350,7 +3353,7 @@ function parseSquidRegion(input) {
|
|
3350
3353
|
[region, cloudId] = parts;
|
3351
3354
|
}
|
3352
3355
|
else if (parts.length === 3) {
|
3353
|
-
if (parts[2]
|
3356
|
+
if (isStage(parts[2])) {
|
3354
3357
|
// region.cloudId.prod (explicit prod stage, rare case)
|
3355
3358
|
[region, cloudId, stage] = parts;
|
3356
3359
|
}
|
@@ -4412,10 +4415,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4412
4415
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4413
4416
|
};
|
4414
4417
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
4415
|
-
exports
|
4418
|
+
exports.initEnv = initEnv;
|
4416
4419
|
const fs = __importStar(__webpack_require__(1943));
|
4417
4420
|
const path_1 = __importDefault(__webpack_require__(6928));
|
4418
|
-
async function
|
4421
|
+
async function initEnv(consoleRegion, pathStr = './', appId, apiKey, environmentId, squidDeveloperId, region) {
|
4419
4422
|
let fileContent = `SQUID_APP_ID=${appId}
|
4420
4423
|
SQUID_REGION=${region}
|
4421
4424
|
SQUID_API_KEY=${apiKey}
|
@@ -10522,7 +10525,7 @@ const requirePath = (file) => {
|
|
10522
10525
|
};
|
10523
10526
|
exports.requirePath = requirePath;
|
10524
10527
|
exports.USER_WEBPACK_CONFIG_PATH = path_1.default.resolve(process.cwd(), 'webpack.config.js');
|
10525
|
-
exports.BUILT_IN_WEBPACK_CONFIG_PATH =
|
10528
|
+
exports.BUILT_IN_WEBPACK_CONFIG_PATH = path_1.default.resolve(__dirname, './resources/user-build.webpack.config.js');
|
10526
10529
|
|
10527
10530
|
|
10528
10531
|
/***/ }),
|
@@ -11674,13 +11677,13 @@ const yargs_1 = __importDefault(__webpack_require__(1771));
|
|
11674
11677
|
const console_app_utils_1 = __webpack_require__(7580);
|
11675
11678
|
const region_utils_1 = __webpack_require__(1665);
|
11676
11679
|
const packageJson = __importStar(__webpack_require__(8330));
|
11677
|
-
const build_1 =
|
11678
|
-
const deploy_1 =
|
11679
|
-
const init_env_1 =
|
11680
|
-
const init_webpack_1 =
|
11681
|
-
const sample_1 =
|
11682
|
-
const start_1 =
|
11683
|
-
const undeploy_1 =
|
11680
|
+
const build_1 = __webpack_require__(8584);
|
11681
|
+
const deploy_1 = __webpack_require__(8705);
|
11682
|
+
const init_env_1 = __webpack_require__(1838);
|
11683
|
+
const init_webpack_1 = __webpack_require__(1134);
|
11684
|
+
const sample_1 = __webpack_require__(4328);
|
11685
|
+
const start_1 = __webpack_require__(496);
|
11686
|
+
const undeploy_1 = __webpack_require__(9478);
|
11684
11687
|
const process_utils_1 = __webpack_require__(8251);
|
11685
11688
|
const validate_1 = __webpack_require__(2246);
|
11686
11689
|
function setupDotEnv(baseDir) {
|
@@ -11709,7 +11712,7 @@ function run() {
|
|
11709
11712
|
}
|
11710
11713
|
function setupStartCommand(yargs) {
|
11711
11714
|
yargs.command('start', 'Starts the local development server', () => void 0, async () => {
|
11712
|
-
await (0, start_1.
|
11715
|
+
await (0, start_1.start)();
|
11713
11716
|
});
|
11714
11717
|
}
|
11715
11718
|
function setupDeployCommand(yargs) {
|
@@ -11741,7 +11744,7 @@ function setupDeployCommand(yargs) {
|
|
11741
11744
|
(0, process_utils_1.exitWithError)('Must provide an API key');
|
11742
11745
|
const appRegion = geAppRegionFromCommandOrEnv(argv.region);
|
11743
11746
|
const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(appRegion);
|
11744
|
-
(0, deploy_1.
|
11747
|
+
(0, deploy_1.deploy)(consoleRegion, appId, bundlePath, apiKey, !!argv.verbose, argv.direct, isUserSpecifiedPath, !!argv.skipBuild, internalApiKey, environmentId).then();
|
11745
11748
|
});
|
11746
11749
|
}
|
11747
11750
|
function setupUndeployCommand(yargs) {
|
@@ -11762,7 +11765,7 @@ function setupUndeployCommand(yargs) {
|
|
11762
11765
|
const environmentId = getEnvironmentIdFromCommandOrEnv(argv.environmentId);
|
11763
11766
|
const region = geAppRegionFromCommandOrEnv(undefined);
|
11764
11767
|
const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(region);
|
11765
|
-
(0, undeploy_1.
|
11768
|
+
(0, undeploy_1.undeploy)(consoleRegion, appId, apiKey, environmentId).then();
|
11766
11769
|
});
|
11767
11770
|
}
|
11768
11771
|
function setupInitEnvCommand(yargs) {
|
@@ -11776,13 +11779,13 @@ function setupInitEnvCommand(yargs) {
|
|
11776
11779
|
attachConsoleRegionOption(yargs);
|
11777
11780
|
}, async (argv) => {
|
11778
11781
|
await (0, validate_1.validateSquidProject)();
|
11779
|
-
await (0, init_env_1.
|
11782
|
+
await (0, init_env_1.initEnv)(argv.consoleRegion, argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region);
|
11780
11783
|
});
|
11781
11784
|
}
|
11782
11785
|
function setupInitWebpackCommand(yargs) {
|
11783
11786
|
yargs.command('init-webpack', 'Generates a webpack.config.js file in your Squid project directory. The Squid build will use this file by default when present.', () => { }, async () => {
|
11784
11787
|
await (0, validate_1.validateSquidProject)();
|
11785
|
-
await (0, init_webpack_1.
|
11788
|
+
await (0, init_webpack_1.initWebpack)();
|
11786
11789
|
});
|
11787
11790
|
}
|
11788
11791
|
function setupInitCommand(yargs) {
|
@@ -11797,7 +11800,7 @@ function setupInitCommand(yargs) {
|
|
11797
11800
|
}, async (argv) => {
|
11798
11801
|
const appRegion = geAppRegionFromCommandOrEnv(argv.region);
|
11799
11802
|
const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(appRegion);
|
11800
|
-
await (0, sample_1.
|
11803
|
+
await (0, sample_1.initSample)(consoleRegion, !!argv.consoleRegion, // If the console region is specified, we assume it's an on-prem console
|
11801
11804
|
argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region, 'backend', !!argv.verbose);
|
11802
11805
|
});
|
11803
11806
|
}
|
@@ -11814,7 +11817,7 @@ function setupInitSampleCommand(yargs) {
|
|
11814
11817
|
}, async (argv) => {
|
11815
11818
|
const appRegion = geAppRegionFromCommandOrEnv(argv.region);
|
11816
11819
|
const consoleRegion = geConsoleRegionFromCommandOrEnv(argv.consoleRegion) || getConsoleRegionFromAppRegion(appRegion);
|
11817
|
-
await (0, sample_1.
|
11820
|
+
await (0, sample_1.initSample)(consoleRegion, !!argv.consoleRegion, // If the console region is specified, we assume it's an on-prem console
|
11818
11821
|
argv.path, argv.appId, argv.apiKey, argv.environmentId, argv.squidDeveloperId, argv.region, argv.template, !!argv.verbose);
|
11819
11822
|
});
|
11820
11823
|
}
|
@@ -11827,7 +11830,7 @@ function setupBuildCommand(yargs) {
|
|
11827
11830
|
});
|
11828
11831
|
}, async (argv) => {
|
11829
11832
|
await (0, validate_1.validateSquidProject)();
|
11830
|
-
await (0, build_1.
|
11833
|
+
await (0, build_1.build)({ verbose: !!argv.verbose, dev: !!argv.dev });
|
11831
11834
|
});
|
11832
11835
|
}
|
11833
11836
|
run();
|
@@ -12043,7 +12046,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12043
12046
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
12044
12047
|
};
|
12045
12048
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
12046
|
-
exports
|
12049
|
+
exports.initSample = initSample;
|
12047
12050
|
const promises_1 = __importDefault(__webpack_require__(1943));
|
12048
12051
|
const path_1 = __importDefault(__webpack_require__(6928));
|
12049
12052
|
const communication_types_1 = __webpack_require__(3443);
|
@@ -22618,7 +22621,7 @@ function exitWithError(...messages) {
|
|
22618
22621
|
/***/ ((module) => {
|
22619
22622
|
|
22620
22623
|
"use strict";
|
22621
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.
|
22624
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.402","description":"The Squid CLI","main":"dist/index.js","scripts":{"start":"node dist/index.js","start-ts":"ts-node -r tsconfig-paths/register src/index.ts","prebuild":"rimraf dist","build":"webpack --mode=production","build:dev":"webpack --mode=development","lint":"eslint","link":"npm run build && chmod 755 dist/index.js && npm link","watch":"webpack --watch","deploy":"npm run build && npm pack --silent | xargs -I {} mv {} package.tgz && npm install -g package.tgz && rm -rf package.tgz","publish:public":"npm run build && npm publish --access public"},"files":["dist/**/*"],"bin":{"squid":"dist/index.js"},"keywords":[],"author":"","license":"ISC","engines":{"node":">=18.0.0"},"dependencies":{"@squidcloud/local-backend":"^1.0.402","copy-webpack-plugin":"^12.0.2","decompress":"^4.2.1","nodemon":"^3.1.3","terser-webpack-plugin":"^5.3.10","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.1.0","webpack":"^5.101.3","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/decompress":"^4.2.7","@types/node":"^20.19.9","terminal-link":"^3.0.0"}}');
|
22622
22625
|
|
22623
22626
|
/***/ }),
|
22624
22627
|
|
@@ -22738,7 +22741,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22738
22741
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
22739
22742
|
};
|
22740
22743
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
22741
|
-
exports
|
22744
|
+
exports.build = build;
|
22742
22745
|
const assertic_1 = __webpack_require__(3205);
|
22743
22746
|
const fsSync = __importStar(__webpack_require__(9896));
|
22744
22747
|
const fs_1 = __webpack_require__(9896);
|
@@ -22756,7 +22759,7 @@ function isEnvVarFalsy(variableName) {
|
|
22756
22759
|
return !value || value.toLowerCase() === 'false' || value === '0';
|
22757
22760
|
}
|
22758
22761
|
const useColorsInOutput = !isEnvVarFalsy('FORCE_COLOR') || isEnvVarFalsy('NO_COLOR');
|
22759
|
-
async function
|
22762
|
+
async function build({ verbose, dev }) {
|
22760
22763
|
if (verbose)
|
22761
22764
|
console.log(`Starting Squid project build. CLI package version: ${packageJson.version}`);
|
22762
22765
|
await (0, validate_1.validateSquidProject)();
|
@@ -23345,7 +23348,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
23345
23348
|
};
|
23346
23349
|
})();
|
23347
23350
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
23348
|
-
exports
|
23351
|
+
exports.deploy = deploy;
|
23349
23352
|
const assertic_1 = __webpack_require__(3205);
|
23350
23353
|
const fs = __importStar(__webpack_require__(1943));
|
23351
23354
|
const communication_types_1 = __webpack_require__(3443);
|
@@ -23353,7 +23356,7 @@ const http_1 = __webpack_require__(866);
|
|
23353
23356
|
const shell_runner_1 = __webpack_require__(3089);
|
23354
23357
|
const environment_1 = __webpack_require__(722);
|
23355
23358
|
const process_utils_1 = __webpack_require__(8251);
|
23356
|
-
async function
|
23359
|
+
async function deploy(consoleRegion, appId, bundlePath, apiKey, verbose, direct, isUserSpecifiedPath, skipBuild, internalApiKey, environmentId) {
|
23357
23360
|
if (!direct && !isUserSpecifiedPath && !skipBuild) {
|
23358
23361
|
console.log('Building code bundle...');
|
23359
23362
|
await (0, shell_runner_1.runInShell)('npm run build');
|
@@ -24871,13 +24874,13 @@ module.exports = (__webpack_require__(9896).constants) || __webpack_require__(91
|
|
24871
24874
|
"use strict";
|
24872
24875
|
|
24873
24876
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
24874
|
-
exports
|
24877
|
+
exports.undeploy = undeploy;
|
24875
24878
|
const assertic_1 = __webpack_require__(3205);
|
24876
24879
|
const communication_types_1 = __webpack_require__(3443);
|
24877
24880
|
const http_1 = __webpack_require__(866);
|
24878
24881
|
const environment_1 = __webpack_require__(722);
|
24879
24882
|
const process_utils_1 = __webpack_require__(8251);
|
24880
|
-
async function
|
24883
|
+
async function undeploy(consoleRegion, appId, apiKey, environmentId) {
|
24881
24884
|
const appIdWithEnvId = (0, communication_types_1.appIdWithEnvironmentId)(appId, environmentId);
|
24882
24885
|
const deleteApplicationCodeUrl = (0, http_1.getApplicationUrl)(consoleRegion, environment_1.environment.consoleAppId, 'webhooks/deleteApplicationCode');
|
24883
24886
|
console.log(`Undeploying code bundle for appId '${appId}' from the '${environmentId}' environment...`);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@squidcloud/cli",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.402",
|
4
4
|
"description": "The Squid CLI",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"scripts": {
|
@@ -9,7 +9,6 @@
|
|
9
9
|
"prebuild": "rimraf dist",
|
10
10
|
"build": "webpack --mode=production",
|
11
11
|
"build:dev": "webpack --mode=development",
|
12
|
-
"build:prod": "webpack --mode=production",
|
13
12
|
"lint": "eslint",
|
14
13
|
"link": "npm run build && chmod 755 dist/index.js && npm link",
|
15
14
|
"watch": "webpack --watch",
|
@@ -29,7 +28,7 @@
|
|
29
28
|
"node": ">=18.0.0"
|
30
29
|
},
|
31
30
|
"dependencies": {
|
32
|
-
"@squidcloud/local-backend": "^1.0.
|
31
|
+
"@squidcloud/local-backend": "^1.0.402",
|
33
32
|
"copy-webpack-plugin": "^12.0.2",
|
34
33
|
"decompress": "^4.2.1",
|
35
34
|
"nodemon": "^3.1.3",
|