@takeshape/cli 11.142.5 → 11.142.6

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.
Files changed (2) hide show
  1. package/dist/index.js +279 -131
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -93256,6 +93256,146 @@ var require_prettyjson = __commonJS({
93256
93256
  }
93257
93257
  });
93258
93258
 
93259
+ // ../../node_modules/.pnpm/clean-stack@2.2.0/node_modules/clean-stack/index.js
93260
+ var require_clean_stack = __commonJS({
93261
+ "../../node_modules/.pnpm/clean-stack@2.2.0/node_modules/clean-stack/index.js"(exports2, module2) {
93262
+ "use strict";
93263
+ var os4 = require("os");
93264
+ var extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/;
93265
+ var pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/;
93266
+ var homeDir = typeof os4.homedir === "undefined" ? "" : os4.homedir();
93267
+ module2.exports = (stack, options2) => {
93268
+ options2 = Object.assign({ pretty: false }, options2);
93269
+ return stack.replace(/\\/g, "/").split("\n").filter((line) => {
93270
+ const pathMatches = line.match(extractPathRegex);
93271
+ if (pathMatches === null || !pathMatches[1]) {
93272
+ return true;
93273
+ }
93274
+ const match3 = pathMatches[1];
93275
+ if (match3.includes(".app/Contents/Resources/electron.asar") || match3.includes(".app/Contents/Resources/default_app.asar")) {
93276
+ return false;
93277
+ }
93278
+ return !pathRegex.test(match3);
93279
+ }).filter((line) => line.trim() !== "").map((line) => {
93280
+ if (options2.pretty) {
93281
+ return line.replace(extractPathRegex, (m3, p1) => m3.replace(p1, p1.replace(homeDir, "~")));
93282
+ }
93283
+ return line;
93284
+ }).join("\n");
93285
+ };
93286
+ }
93287
+ });
93288
+
93289
+ // ../../node_modules/.pnpm/aggregate-error@3.1.0/node_modules/aggregate-error/index.js
93290
+ var require_aggregate_error = __commonJS({
93291
+ "../../node_modules/.pnpm/aggregate-error@3.1.0/node_modules/aggregate-error/index.js"(exports2, module2) {
93292
+ "use strict";
93293
+ var indentString = require_indent_string();
93294
+ var cleanStack = require_clean_stack();
93295
+ var cleanInternalStack = (stack) => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, "");
93296
+ var AggregateError2 = class extends Error {
93297
+ constructor(errors) {
93298
+ if (!Array.isArray(errors)) {
93299
+ throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
93300
+ }
93301
+ errors = [...errors].map((error) => {
93302
+ if (error instanceof Error) {
93303
+ return error;
93304
+ }
93305
+ if (error !== null && typeof error === "object") {
93306
+ return Object.assign(new Error(error.message), error);
93307
+ }
93308
+ return new Error(error);
93309
+ });
93310
+ let message = errors.map((error) => {
93311
+ return typeof error.stack === "string" ? cleanInternalStack(cleanStack(error.stack)) : String(error);
93312
+ }).join("\n");
93313
+ message = "\n" + indentString(message, 4);
93314
+ super(message);
93315
+ this.name = "AggregateError";
93316
+ Object.defineProperty(this, "_errors", { value: errors });
93317
+ }
93318
+ *[Symbol.iterator]() {
93319
+ for (const error of this._errors) {
93320
+ yield error;
93321
+ }
93322
+ }
93323
+ };
93324
+ module2.exports = AggregateError2;
93325
+ }
93326
+ });
93327
+
93328
+ // ../../node_modules/.pnpm/p-map@4.0.0/node_modules/p-map/index.js
93329
+ var require_p_map = __commonJS({
93330
+ "../../node_modules/.pnpm/p-map@4.0.0/node_modules/p-map/index.js"(exports2, module2) {
93331
+ "use strict";
93332
+ var AggregateError2 = require_aggregate_error();
93333
+ module2.exports = async (iterable, mapper, {
93334
+ concurrency = Infinity,
93335
+ stopOnError = true
93336
+ } = {}) => {
93337
+ return new Promise((resolve2, reject) => {
93338
+ if (typeof mapper !== "function") {
93339
+ throw new TypeError("Mapper function is required");
93340
+ }
93341
+ if (!((Number.isSafeInteger(concurrency) || concurrency === Infinity) && concurrency >= 1)) {
93342
+ throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
93343
+ }
93344
+ const result = [];
93345
+ const errors = [];
93346
+ const iterator = iterable[Symbol.iterator]();
93347
+ let isRejected = false;
93348
+ let isIterableDone = false;
93349
+ let resolvingCount = 0;
93350
+ let currentIndex = 0;
93351
+ const next2 = () => {
93352
+ if (isRejected) {
93353
+ return;
93354
+ }
93355
+ const nextItem = iterator.next();
93356
+ const index2 = currentIndex;
93357
+ currentIndex++;
93358
+ if (nextItem.done) {
93359
+ isIterableDone = true;
93360
+ if (resolvingCount === 0) {
93361
+ if (!stopOnError && errors.length !== 0) {
93362
+ reject(new AggregateError2(errors));
93363
+ } else {
93364
+ resolve2(result);
93365
+ }
93366
+ }
93367
+ return;
93368
+ }
93369
+ resolvingCount++;
93370
+ (async () => {
93371
+ try {
93372
+ const element = await nextItem.value;
93373
+ result[index2] = await mapper(element, index2);
93374
+ resolvingCount--;
93375
+ next2();
93376
+ } catch (error) {
93377
+ if (stopOnError) {
93378
+ isRejected = true;
93379
+ reject(error);
93380
+ } else {
93381
+ errors.push(error);
93382
+ resolvingCount--;
93383
+ next2();
93384
+ }
93385
+ }
93386
+ })();
93387
+ };
93388
+ for (let i2 = 0; i2 < concurrency; i2++) {
93389
+ next2();
93390
+ if (isIterableDone) {
93391
+ break;
93392
+ }
93393
+ }
93394
+ });
93395
+ };
93396
+ }
93397
+ });
93398
+
93259
93399
  // ../../node_modules/.pnpm/pusher-js@7.1.1-beta/node_modules/pusher-js/dist/node/pusher.js
93260
93400
  var require_pusher = __commonJS({
93261
93401
  "../../node_modules/.pnpm/pusher-js@7.1.1-beta/node_modules/pusher-js/dist/node/pusher.js"(exports2, module2) {
@@ -206821,6 +206961,111 @@ var require_p_limit2 = __commonJS({
206821
206961
  // src/index.ts
206822
206962
  var import_meow = __toESM(require_meow());
206823
206963
 
206964
+ // package.json
206965
+ var engines = {
206966
+ node: ">=22"
206967
+ };
206968
+ var package_default = {
206969
+ name: "@takeshape/cli",
206970
+ version: "11.142.6",
206971
+ description: "TakeShape CLI",
206972
+ homepage: "https://www.takeshape.io",
206973
+ repository: {
206974
+ type: "git",
206975
+ url: "github.com:takeshape/takeshape.git"
206976
+ },
206977
+ license: "MIT",
206978
+ author: "asprouse",
206979
+ bin: {
206980
+ takeshape: "./dist/index.js"
206981
+ },
206982
+ files: [
206983
+ "dist"
206984
+ ],
206985
+ scripts: {
206986
+ build: "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
206987
+ "prebuild:ci": "pnpm clean",
206988
+ "build:ci": "pnpm build",
206989
+ clean: "del-cli build dist *.tsbuildinfo",
206990
+ lint: "trap 'RC=1' ERR; pnpm lint:biome; pnpm lint:eslint; exit $RC",
206991
+ "lint:biome": "biome check ./",
206992
+ "lint:eslint": "eslint src -c ../../eslint.config.mjs",
206993
+ "lint:ci:biome": 'mkdir -p "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}" && biome check ./ --diagnostic-level error --reporter=junit > "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/biome-results.xml"',
206994
+ "lint:ci:eslint": 'ESLINT_SUITE_NAME=${npm_package_name} ESLINT_JUNIT_OUTPUT="${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/eslint-results.xml" pnpm lint:eslint --quiet --format ../../node_modules/eslint-junit/index.js',
206995
+ "lint:code:ci": 'pnpm lint --quiet --format junit -o "${HOME}/test-results/${npm_package_name#*\\/}/eslint-results.xml"',
206996
+ test: "TZ=UTC vitest run",
206997
+ "test:ci": 'TZ=UTC vitest run --reporter=default --reporter=junit --outputFile="${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/vitest-results.xml" --coverage.enabled --coverage.reportsDirectory="${GITHUB_WORKSPACE}/coverage/${npm_package_name#*\\/}"',
206998
+ todo: "leasot 'src/**/*.{js,jsx,ts,tsx}'",
206999
+ typecheck: "tsc --noEmit",
207000
+ "typecheck:ci": 'mkdir -p "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}" && tsc --noEmit --pretty false | typescript-jest-junit-reporter | tee "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/typescript-results.xml"'
207001
+ },
207002
+ devDependencies: {
207003
+ "@graphql-codegen/core": "4.0.2",
207004
+ "@graphql-codegen/plugin-helpers": "5.1.0",
207005
+ "@graphql-codegen/typescript": "4.1.5",
207006
+ "@graphql-tools/graphql-file-loader": "8.0.1",
207007
+ "@graphql-tools/load": "8.0.2",
207008
+ "@takeshape/branches": "workspace:*",
207009
+ "@takeshape/schema": "workspace:*",
207010
+ "@takeshape/ssg": "workspace:*",
207011
+ "@takeshape/streams": "workspace:*",
207012
+ "@takeshape/util": "workspace:*",
207013
+ "@types/archiver": "3.1.1",
207014
+ "@types/async-retry": "1.4.8",
207015
+ "@types/fs-extra": "8.1.1",
207016
+ "@types/glob": "7.2.0",
207017
+ "@types/inquirer": "7.3.1",
207018
+ "@types/jsonwebtoken": "8.5.1",
207019
+ "@types/lodash": "4.17.20",
207020
+ "@types/node-fetch": "2.6.11",
207021
+ "@types/object-hash": "3.0.6",
207022
+ "@types/prettyjson": "0.0.30",
207023
+ "@types/request": "2.48.12",
207024
+ "@types/semver": "6.2.2",
207025
+ "@types/stream-to-promise": "2.2.1",
207026
+ "@types/tmp": "0.1.0",
207027
+ "@types/unzipper": "0.10.3",
207028
+ archiver: "1.3.0",
207029
+ "async-retry": "1.3.1",
207030
+ chalk: "5.6.2",
207031
+ chokidar: "2.1.8",
207032
+ commander: "2.20.3",
207033
+ "cross-env": "5.2.1",
207034
+ "date-fns": "2.30.0",
207035
+ dotenv: "16.4.7",
207036
+ "dotenv-stringify": "3.0.1",
207037
+ "fs-extra": "7.0.1",
207038
+ "get-port": "5.1.1",
207039
+ glob: "7.2.3",
207040
+ graphql: "16.10.0",
207041
+ ignore: "5.3.2",
207042
+ inquirer: "7.3.3",
207043
+ jsonwebtoken: "8.5.1",
207044
+ lodash: "4.17.21",
207045
+ lokka: "1.7.0",
207046
+ "lokka-transport-http": "1.6.1",
207047
+ nock: "13.5.4",
207048
+ "node-fetch": "2.7.0",
207049
+ "object-hash": "1.3.1",
207050
+ open: "7.4.2",
207051
+ ora: "3.4.0",
207052
+ "p-map": "4.0.0",
207053
+ "pretty-bytes": "5.4.1",
207054
+ prettyjson: "1.2.1",
207055
+ "pusher-js": "7.1.1-beta",
207056
+ request: "2.88.2",
207057
+ semver: "6.3.1",
207058
+ "stream-to-promise": "2.2.0",
207059
+ tmp: "0.0.33",
207060
+ unzipper: "0.10.11"
207061
+ },
207062
+ engines,
207063
+ publishConfig: {
207064
+ access: "public",
207065
+ provenance: false
207066
+ }
207067
+ };
207068
+
206824
207069
  // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
206825
207070
  var ANSI_BACKGROUND_OFFSET = 10;
206826
207071
  var wrapAnsi16 = (offset = 0) => (code2) => `\x1B[${code2 + offset}m`;
@@ -207319,111 +207564,6 @@ var source_default = chalk;
207319
207564
  // src/check-version.ts
207320
207565
  var import_semver = __toESM(require_semver4());
207321
207566
 
207322
- // package.json
207323
- var engines = {
207324
- node: ">=22"
207325
- };
207326
- var package_default = {
207327
- name: "@takeshape/cli",
207328
- version: "11.142.5",
207329
- description: "TakeShape CLI",
207330
- homepage: "https://www.takeshape.io",
207331
- repository: {
207332
- type: "git",
207333
- url: "github.com:takeshape/takeshape.git"
207334
- },
207335
- license: "MIT",
207336
- author: "asprouse",
207337
- bin: {
207338
- takeshape: "./dist/index.js"
207339
- },
207340
- files: [
207341
- "dist"
207342
- ],
207343
- scripts: {
207344
- build: "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
207345
- "prebuild:ci": "pnpm clean",
207346
- "build:ci": "pnpm build",
207347
- clean: "del-cli build dist *.tsbuildinfo",
207348
- lint: "trap 'RC=1' ERR; pnpm lint:biome; pnpm lint:eslint; exit $RC",
207349
- "lint:biome": "biome check ./",
207350
- "lint:eslint": "eslint src -c ../../eslint.config.mjs",
207351
- "lint:ci:biome": 'mkdir -p "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}" && biome check ./ --diagnostic-level error --reporter=junit > "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/biome-results.xml"',
207352
- "lint:ci:eslint": 'ESLINT_SUITE_NAME=${npm_package_name} ESLINT_JUNIT_OUTPUT="${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/eslint-results.xml" pnpm lint:eslint --quiet --format ../../node_modules/eslint-junit/index.js',
207353
- "lint:code:ci": 'pnpm lint --quiet --format junit -o "${HOME}/test-results/${npm_package_name#*\\/}/eslint-results.xml"',
207354
- test: "TZ=UTC vitest run",
207355
- "test:ci": 'TZ=UTC vitest run --reporter=default --reporter=junit --outputFile="${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/vitest-results.xml" --coverage.enabled --coverage.reportsDirectory="${GITHUB_WORKSPACE}/coverage/${npm_package_name#*\\/}"',
207356
- todo: "leasot 'src/**/*.{js,jsx,ts,tsx}'",
207357
- typecheck: "tsc --noEmit",
207358
- "typecheck:ci": 'mkdir -p "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}" && tsc --noEmit --pretty false | typescript-jest-junit-reporter | tee "${GITHUB_WORKSPACE}/test-results/${npm_package_name#*\\/}/typescript-results.xml"'
207359
- },
207360
- dependencies: {},
207361
- devDependencies: {
207362
- "@graphql-codegen/core": "4.0.2",
207363
- "@graphql-codegen/plugin-helpers": "5.1.0",
207364
- "@graphql-codegen/typescript": "4.1.5",
207365
- "@graphql-tools/graphql-file-loader": "8.0.1",
207366
- "@graphql-tools/load": "8.0.2",
207367
- "@takeshape/branches": "workspace:*",
207368
- "@takeshape/schema": "workspace:*",
207369
- "@takeshape/ssg": "workspace:*",
207370
- "@takeshape/streams": "workspace:*",
207371
- "@takeshape/util": "workspace:*",
207372
- "@types/archiver": "3.1.1",
207373
- "@types/async-retry": "1.4.8",
207374
- "@types/fs-extra": "8.1.1",
207375
- "@types/glob": "7.2.0",
207376
- "@types/inquirer": "7.3.1",
207377
- "@types/jsonwebtoken": "8.5.1",
207378
- "@types/lodash": "4.17.20",
207379
- "@types/node-fetch": "2.6.11",
207380
- "@types/prettyjson": "0.0.30",
207381
- "@types/request": "2.48.12",
207382
- "@types/semver": "6.2.2",
207383
- "@types/stream-to-promise": "2.2.1",
207384
- "@types/tmp": "0.1.0",
207385
- "@types/unzipper": "0.10.3",
207386
- archiver: "1.3.0",
207387
- "async-retry": "1.3.1",
207388
- bluebird: "3.7.2",
207389
- chalk: "5.6.2",
207390
- chokidar: "2.1.8",
207391
- commander: "2.20.3",
207392
- "cross-env": "5.2.1",
207393
- "date-fns": "2.30.0",
207394
- dotenv: "6.2.0",
207395
- "dotenv-stringify": "1.0.0",
207396
- "fs-extra": "7.0.1",
207397
- "get-port": "5.1.1",
207398
- glob: "7.2.3",
207399
- graphql: "16.10.0",
207400
- ignore: "5.3.2",
207401
- inquirer: "7.3.3",
207402
- jsonwebtoken: "8.5.1",
207403
- lodash: "4.17.21",
207404
- lokka: "1.7.0",
207405
- "lokka-transport-http": "1.6.1",
207406
- nock: "13.5.4",
207407
- "node-fetch": "2.7.0",
207408
- "object-hash": "1.3.1",
207409
- open: "7.4.2",
207410
- ora: "3.4.0",
207411
- "pretty-bytes": "5.4.1",
207412
- prettyjson: "1.2.1",
207413
- "pusher-js": "7.1.1-beta",
207414
- request: "2.88.2",
207415
- semver: "6.3.1",
207416
- "stream-to-promise": "2.2.0",
207417
- tmp: "0.0.33",
207418
- unzipper: "0.10.11"
207419
- },
207420
- engines,
207421
- publishConfig: {
207422
- access: "public",
207423
- provenance: false
207424
- }
207425
- };
207426
-
207427
207567
  // src/log.ts
207428
207568
  function log(...args) {
207429
207569
  console.log.apply(null, args);
@@ -214732,18 +214872,18 @@ async function generate(config, params) {
214732
214872
  };
214733
214873
  }
214734
214874
 
214735
- // src/util/cached-connector.js
214875
+ // src/util/cached-connector.ts
214736
214876
  var import_node_path5 = __toESM(require("node:path"));
214737
214877
  var import_fs_extra2 = __toESM(require_lib3());
214738
214878
  var import_object_hash = __toESM(require_object_hash());
214739
214879
  var cacheDir = ".cache";
214740
214880
  function connectorWithCache(connector) {
214741
- const decorated = async (params) => {
214881
+ const decorated = async (params, context) => {
214742
214882
  const cachePath = import_node_path5.default.join(cacheDir, `${(0, import_object_hash.default)(params)}.json`);
214743
214883
  if (await (0, import_fs_extra2.pathExists)(cachePath)) {
214744
214884
  return (0, import_fs_extra2.readJSON)(cachePath);
214745
214885
  }
214746
- const [result] = await Promise.all([connector(params), (0, import_fs_extra2.mkdirs)(cacheDir)]);
214886
+ const [result] = await Promise.all([connector(params, context), (0, import_fs_extra2.mkdirs)(cacheDir)]);
214747
214887
  await (0, import_fs_extra2.writeJSON)(cachePath, result);
214748
214888
  return result;
214749
214889
  };
@@ -214759,19 +214899,22 @@ function createConnector2(params, branchParams, options2) {
214759
214899
  return options2?.cache ? connectorWithCache(connector) : connector;
214760
214900
  }
214761
214901
 
214762
- // src/util/get-client-schema.js
214902
+ // src/util/get-client-schema.ts
214763
214903
  var import_fs_extra3 = __toESM(require_lib3());
214764
214904
  var import_graphql7 = __toESM(require_graphql2());
214765
214905
 
214766
- // src/util/ora-wrapper.js
214906
+ // src/util/ora-wrapper.ts
214767
214907
  var import_ora = __toESM(require_ora());
214768
214908
 
214769
- // src/util/format-error.js
214909
+ // src/util/format-error.ts
214770
214910
  function formatError4(error) {
214771
- return error.message || JSON.stringify(error, null, 2);
214911
+ if (error && typeof error === "object" && "message" in error) {
214912
+ return String(error.message);
214913
+ }
214914
+ return JSON.stringify(error, null, 2);
214772
214915
  }
214773
214916
 
214774
- // src/util/ora-wrapper.js
214917
+ // src/util/ora-wrapper.ts
214775
214918
  function oraWrapper(fn, start, success, failure) {
214776
214919
  return async (...args) => {
214777
214920
  const spinner = (0, import_ora.default)(start).start();
@@ -214785,7 +214928,7 @@ function oraWrapper(fn, start, success, failure) {
214785
214928
  };
214786
214929
  }
214787
214930
 
214788
- // src/util/get-client-schema.js
214931
+ // src/util/get-client-schema.ts
214789
214932
  var SCHEMA_FILE_NAME = "takeshape-project.graphql";
214790
214933
  async function getClientSchema2(connector) {
214791
214934
  const res = await connector({ query: (0, import_graphql7.getIntrospectionQuery)() });
@@ -217010,13 +217153,13 @@ var commandHandler = async (cli2, params) => {
217010
217153
  };
217011
217154
  var branch_default = commandHandler;
217012
217155
 
217013
- // src/commands/build-or-watch.js
217156
+ // src/commands/build-or-watch.ts
217014
217157
  var import_node_path8 = __toESM(require("node:path"));
217015
217158
 
217016
- // src/files.js
217159
+ // src/files.ts
217017
217160
  var import_node_path7 = __toESM(require("node:path"));
217018
- var import_bluebird3 = __toESM(require_bluebird());
217019
217161
  var import_fs_extra5 = __toESM(require_lib3());
217162
+ var import_p_map = __toESM(require_p_map());
217020
217163
  async function copyStatic(config) {
217021
217164
  return (0, import_fs_extra5.mkdirs)(config.buildPath).then(
217022
217165
  async () => (0, import_fs_extra5.copy)(config.staticPath, config.buildPath, { preserveTimestamps: true })
@@ -217028,19 +217171,19 @@ function syncStatic(config) {
217028
217171
  const destPath = import_node_path7.default.join(config.buildPath, relativePath);
217029
217172
  if (event === "addDir") {
217030
217173
  log(`takeshape watch - copied ${relativePath}`);
217031
- (0, import_fs_extra5.mkdirs)(destPath);
217174
+ void (0, import_fs_extra5.mkdirs)(destPath);
217032
217175
  } else if (event === "unlink" || event === "unlinkDir") {
217033
217176
  log(`takeshape watch - deleted ${relativePath}`);
217034
- (0, import_fs_extra5.remove)(destPath);
217177
+ void (0, import_fs_extra5.remove)(destPath);
217035
217178
  } else {
217036
217179
  log(`takeshape watch - copied ${relativePath}`);
217037
- (0, import_fs_extra5.copy)(sourcePath, destPath);
217180
+ void (0, import_fs_extra5.copy)(sourcePath, destPath);
217038
217181
  }
217039
217182
  };
217040
217183
  }
217041
217184
  function writePages(outputPath) {
217042
217185
  return (generated) => {
217043
- return import_bluebird3.default.map(generated.pages, async (page) => {
217186
+ return (0, import_p_map.default)(generated.pages, async (page) => {
217044
217187
  const filePath = import_node_path7.default.join(outputPath, page.path);
217045
217188
  return (0, import_fs_extra5.mkdirs)(import_node_path7.default.dirname(filePath)).then(async () => (0, import_fs_extra5.writeFile)(filePath, page.contents, "utf8"));
217046
217189
  }).then(() => generated.stats);
@@ -217069,7 +217212,7 @@ async function subscribe(params, callback) {
217069
217212
  channel.bind("server-action", handleAction(callback));
217070
217213
  }
217071
217214
 
217072
- // src/util/runner.js
217215
+ // src/util/runner.ts
217073
217216
  function createRunner(name, task) {
217074
217217
  let running = false;
217075
217218
  return async (...args) => {
@@ -217098,7 +217241,7 @@ ${formatError4(error)}`)}`);
217098
217241
  };
217099
217242
  }
217100
217243
 
217101
- // src/util/watcher.js
217244
+ // src/util/watcher.ts
217102
217245
  var import_chokidar = __toESM(require_chokidar());
217103
217246
  function createWatcher(description, handler, path16) {
217104
217247
  const watcher = (0, import_chokidar.watch)(path16);
@@ -217117,11 +217260,11 @@ function createWatcher(description, handler, path16) {
217117
217260
  });
217118
217261
  }
217119
217262
 
217120
- // src/commands/build-or-watch.js
217263
+ // src/commands/build-or-watch.ts
217121
217264
  function buildHandler(config, params) {
217122
217265
  const { connector } = params;
217123
217266
  return async (clearCache) => {
217124
- if (clearCache && connector.clearCache) {
217267
+ if (clearCache && "clearCache" in connector && connector.clearCache) {
217125
217268
  await connector.clearCache();
217126
217269
  }
217127
217270
  const pages = await generate(config, params);
@@ -217133,7 +217276,9 @@ var build_or_watch_default = linkedCommand(async (cli2, params) => {
217133
217276
  const sitePath = import_node_path8.default.dirname(params.configFilePath);
217134
217277
  const fileLoader = createFileSystemLoader(sitePath);
217135
217278
  const templateFileLoader = createSyncFileSystemLoader(sitePath);
217136
- const config = await loadConfig(fileLoader, import_node_path8.default.basename(params.configFilePath), { env: process.env });
217279
+ const config = await loadConfig(fileLoader, import_node_path8.default.basename(params.configFilePath), {
217280
+ env: process.env
217281
+ });
217137
217282
  const connector = createConnector2(params, getBranchParams(cli2), {
217138
217283
  cache: params.cache
217139
217284
  });
@@ -402266,7 +402411,7 @@ var import_size = __toESM(require_size(), 1);
402266
402411
  var import_uniqBy2 = __toESM(require_uniqBy(), 1);
402267
402412
 
402268
402413
  // ../../node_modules/.pnpm/p-map@7.0.3/node_modules/p-map/index.js
402269
- async function pMap(iterable, mapper, {
402414
+ async function pMap2(iterable, mapper, {
402270
402415
  concurrency = Number.POSITIVE_INFINITY,
402271
402416
  stopOnError = true,
402272
402417
  signal
@@ -404565,7 +404710,7 @@ async function validateResolverReferences(context, basePath, baseResolver) {
404565
404710
  const layerState = await context.resolveLayer(ref.layerId);
404566
404711
  return layerState.status === "ok" ? !(0, import_get12.default)(layerState.schema, propertyRefItemToPath(value(""), ref)) : !allowDisconnected(context, layerState.status);
404567
404712
  };
404568
- await pMap(enumerateBasicResolvers(baseResolver, basePath), async ([resolver, path16]) => {
404713
+ await pMap2(enumerateBasicResolvers(baseResolver, basePath), async ([resolver, path16]) => {
404569
404714
  if (resolver.name === "graphql:query" || resolver.name === "graphql:mutation") {
404570
404715
  const { service, fieldName } = resolver;
404571
404716
  const operationProp = resolver.name === "graphql:query" ? "query" : "mutation";
@@ -404590,7 +404735,7 @@ async function validateResolverReferences(context, basePath, baseResolver) {
404590
404735
  }
404591
404736
  } else if (isAIResolver(resolver)) {
404592
404737
  if (resolver.tools) {
404593
- await pMap(resolver.tools, async (tool, i2) => {
404738
+ await pMap2(resolver.tools, async (tool, i2) => {
404594
404739
  const toolRef = getToolRef(tool);
404595
404740
  if (await isInvalidPropertyRef(toolRef)) {
404596
404741
  errors.push({
@@ -404838,7 +404983,7 @@ async function validateRefs(context, projectSchema) {
404838
404983
  layerIds.add(item2.layerId);
404839
404984
  }
404840
404985
  }
404841
- const layersById = Object.fromEntries(await pMap(layerIds, async (layerId) => [layerId, await resolveLayer(layerId)]));
404986
+ const layersById = Object.fromEntries(await pMap2(layerIds, async (layerId) => [layerId, await resolveLayer(layerId)]));
404842
404987
  for (const item2 of refs) {
404843
404988
  if (item2.template && !isValidTemplate(item2.template)) {
404844
404989
  errors.push({
@@ -413504,7 +413649,10 @@ var help = `
413504
413649
  $ takeshape branch url --production
413505
413650
 
413506
413651
  `;
413507
- var cli = (0, import_meow.default)(help, options);
413652
+ var cli = (0, import_meow.default)(help, {
413653
+ ...options,
413654
+ pkg: package_default
413655
+ });
413508
413656
  var cwd3 = process.cwd();
413509
413657
  checkVersion(process.version);
413510
413658
  void main_default(cli, loadConfig2(cwd3, cli));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/cli",
3
- "version": "11.142.5",
3
+ "version": "11.142.6",
4
4
  "description": "TakeShape CLI",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -15,7 +15,6 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "dependencies": {},
19
18
  "devDependencies": {
20
19
  "@graphql-codegen/core": "4.0.2",
21
20
  "@graphql-codegen/plugin-helpers": "5.1.0",
@@ -30,6 +29,7 @@
30
29
  "@types/jsonwebtoken": "8.5.1",
31
30
  "@types/lodash": "4.17.20",
32
31
  "@types/node-fetch": "2.6.11",
32
+ "@types/object-hash": "3.0.6",
33
33
  "@types/prettyjson": "0.0.30",
34
34
  "@types/request": "2.48.12",
35
35
  "@types/semver": "6.2.2",
@@ -38,14 +38,13 @@
38
38
  "@types/unzipper": "0.10.3",
39
39
  "archiver": "1.3.0",
40
40
  "async-retry": "1.3.1",
41
- "bluebird": "3.7.2",
42
41
  "chalk": "5.6.2",
43
42
  "chokidar": "2.1.8",
44
43
  "commander": "2.20.3",
45
44
  "cross-env": "5.2.1",
46
45
  "date-fns": "2.30.0",
47
- "dotenv": "6.2.0",
48
- "dotenv-stringify": "1.0.0",
46
+ "dotenv": "16.4.7",
47
+ "dotenv-stringify": "3.0.1",
49
48
  "fs-extra": "7.0.1",
50
49
  "get-port": "5.1.1",
51
50
  "glob": "7.2.3",
@@ -61,6 +60,7 @@
61
60
  "object-hash": "1.3.1",
62
61
  "open": "7.4.2",
63
62
  "ora": "3.4.0",
63
+ "p-map": "4.0.0",
64
64
  "pretty-bytes": "5.4.1",
65
65
  "prettyjson": "1.2.1",
66
66
  "pusher-js": "7.1.1-beta",
@@ -69,11 +69,11 @@
69
69
  "stream-to-promise": "2.2.0",
70
70
  "tmp": "0.0.33",
71
71
  "unzipper": "0.10.11",
72
- "@takeshape/branches": "11.142.5",
73
- "@takeshape/schema": "11.142.5",
74
- "@takeshape/streams": "11.142.5",
75
- "@takeshape/util": "11.142.5",
76
- "@takeshape/ssg": "11.142.5"
72
+ "@takeshape/streams": "11.142.6",
73
+ "@takeshape/util": "11.142.6",
74
+ "@takeshape/branches": "11.142.6",
75
+ "@takeshape/schema": "11.142.6",
76
+ "@takeshape/ssg": "11.142.6"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=22"