@awsless/cli 0.1.0 → 0.1.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/dist/bin.js CHANGED
@@ -169029,7 +169029,7 @@ var createLambdaServer = (props) => {
169029
169029
  };
169030
169030
 
169031
169031
  // src/dev/sdk.ts
169032
- import { readdir as readdir10, readFile as readFile23, mkdir as mkdir9, rm as rm11, symlink } from "fs/promises";
169032
+ import { readdir as readdir10, readFile as readFile23, mkdir as mkdir9, rm as rm11, stat as stat9, symlink } from "fs/promises";
169033
169033
  import { createRequire } from "module";
169034
169034
  import { dirname as dirname23, join as join54 } from "path";
169035
169035
  var linkSdkPackages = async (buildDir, onWarn) => {
@@ -169058,23 +169058,31 @@ var linkSdkPackages = async (buildDir, onWarn) => {
169058
169058
  }
169059
169059
  };
169060
169060
  for (const name of packages) {
169061
+ const target2 = join54(buildDir, "node_modules", name);
169061
169062
  try {
169062
- projectRequire.resolve(`${name}/package.json`);
169063
- continue;
169064
- } catch (_4) {}
169065
- let source = await resolveFromStore(name);
169066
- if (!source) {
169067
169063
  try {
169068
- source = dirname23(ownRequire.resolve(`${name}/package.json`));
169069
- } catch (_4) {
169070
- onWarn?.(`The bundle imports "${name}", which is neither a project dependency nor shipped with the cli. Add it to your project dependencies.`);
169064
+ projectRequire.resolve(`${name}/package.json`);
169065
+ await rm11(target2, { recursive: true, force: true });
169066
+ debug(`Sdk link ${name}: project resolves`);
169071
169067
  continue;
169068
+ } catch (_4) {}
169069
+ let source = await resolveFromStore(name);
169070
+ if (!source) {
169071
+ try {
169072
+ source = dirname23(ownRequire.resolve(`${name}/package.json`));
169073
+ } catch (_4) {
169074
+ onWarn?.(`The bundle imports "${name}", which is neither a project dependency nor shipped with the cli. Add it to your project dependencies.`);
169075
+ continue;
169076
+ }
169072
169077
  }
169078
+ await mkdir9(dirname23(target2), { recursive: true });
169079
+ await rm11(target2, { recursive: true, force: true });
169080
+ await symlink(source, target2, "dir");
169081
+ await stat9(join54(target2, "package.json"));
169082
+ debug(`Sdk link ${name}: ${source}`);
169083
+ } catch (error3) {
169084
+ onWarn?.(`Linking the "${name}" sdk package failed: ${error3 instanceof Error ? error3.message : String(error3)}`);
169073
169085
  }
169074
- const target2 = join54(buildDir, "node_modules", name);
169075
- await mkdir9(dirname23(target2), { recursive: true });
169076
- await rm11(target2, { recursive: true, force: true });
169077
- await symlink(source, target2, "dir");
169078
169086
  }
169079
169087
  };
169080
169088
 
@@ -169244,12 +169252,12 @@ var startDev = async (props) => {
169244
169252
  }
169245
169253
  detail(breakdown(timings));
169246
169254
  });
169247
- await phase({ start: "Starting the bundle worker...", done: "Started the bundle worker" }, async () => {
169255
+ await phase({ start: "Starting the bundle worker...", done: "Started the bundle worker" }, async (detail) => {
169248
169256
  try {
169249
169257
  await worker.start();
169250
169258
  } catch (error3) {
169259
+ detail("FAILED - the next invoke retries");
169251
169260
  log(`The bundle worker failed to start: ${error3 instanceof Error ? error3.message : String(error3)}`);
169252
- log("Fix the error - the next invoke retries.");
169253
169261
  dirty = true;
169254
169262
  restartNeeded = true;
169255
169263
  }
@@ -1031979,6 +1031979,8 @@ var onFailureQueueArn = `arn:aws:sqs:${REGION}:${ACCOUNT_ID}:${onFailureQueueNam
1031979
1031979
  var getTaskName = bindLocalResourceName("task");
1031980
1031980
  var getTopicName = bindGlobalResourceName("topic");
1031981
1031981
  var getTableName = bindLocalResourceName("table");
1031982
+ var mockBaselines = /* @__PURE__ */ new Map;
1031983
+ var mockState = { inTest: false };
1031982
1031984
  var testRegistry = {
1031983
1031985
  emails: {},
1031984
1031986
  functions: {},
@@ -1031998,7 +1032000,11 @@ var overridable = (registry, name) => {
1031998
1032000
  return new Proxy(spy, {
1031999
1032001
  apply(_target, _thisArg, args) {
1032000
1032002
  const impl = args[0];
1032001
- spy.mockImplementation(typeof impl === "function" ? impl : async () => impl);
1032003
+ const handler = typeof impl === "function" ? impl : async () => impl;
1032004
+ if (!mockState.inTest) {
1032005
+ mockBaselines.set(spy, handler);
1032006
+ }
1032007
+ spy.mockImplementation(handler);
1032002
1032008
  }
1032003
1032009
  });
1032004
1032010
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -44,13 +44,13 @@
44
44
  "peerDependencies": {
45
45
  "@awsless/big-float": "^0.1.7",
46
46
  "@awsless/duration": "^0.0.4",
47
- "@awsless/dynamodb": "^0.3.23",
48
47
  "@awsless/json": "^0.0.11",
49
- "awsless": "^0.0.15-local.13",
50
- "@awsless/lambda": "^0.0.48",
51
- "@awsless/s3": "^0.0.22",
48
+ "@awsless/dynamodb": "^0.3.23",
49
+ "@awsless/validate": "^0.2.0",
52
50
  "@awsless/weak-cache": "^0.0.1",
53
- "@awsless/validate": "^0.2.0"
51
+ "awsless": "^0.1.2",
52
+ "@awsless/s3": "^0.0.22",
53
+ "@awsless/lambda": "^0.0.48"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@aws-sdk/client-cloudformation": "^3.369.0",
@@ -108,25 +108,25 @@
108
108
  "zip-a-folder": "^3.1.6",
109
109
  "zod": "^3.24.2",
110
110
  "zod-to-json-schema": "^3.24.3",
111
+ "@awsless/cloudwatch": "^0.0.1",
111
112
  "@awsless/big-float": "^0.1.7",
112
113
  "@awsless/clui": "^0.0.9",
113
- "@awsless/lambda": "^0.0.48",
114
- "@awsless/cloudwatch": "^0.0.1",
115
- "@awsless/iot": "^0.0.5",
114
+ "@awsless/duration": "^0.0.4",
116
115
  "@awsless/dynamodb": "^0.3.23",
117
- "@awsless/redis": "^0.1.13",
118
- "@awsless/s3": "^0.0.22",
116
+ "@awsless/iot": "^0.0.5",
117
+ "@awsless/json": "^0.0.11",
118
+ "@awsless/lambda": "^0.0.48",
119
119
  "@awsless/open-search": "^0.0.27",
120
- "@awsless/size": "^0.0.2",
121
- "@awsless/duration": "^0.0.4",
120
+ "@awsless/s3": "^0.0.22",
121
+ "@awsless/redis": "^0.1.13",
122
122
  "@awsless/scheduler": "^0.0.5",
123
- "@awsless/weak-cache": "^0.0.1",
123
+ "@awsless/size": "^0.0.2",
124
+ "@awsless/sqs": "^0.0.24",
124
125
  "@awsless/ssm": "^0.0.8",
125
126
  "@awsless/sns": "^0.0.11",
126
127
  "@awsless/validate": "^0.2.0",
127
- "@awsless/sqs": "^0.0.24",
128
- "awsless": "^0.0.15-local.13",
129
- "@awsless/json": "^0.0.11"
128
+ "@awsless/weak-cache": "^0.0.1",
129
+ "awsless": "^0.1.2"
130
130
  },
131
131
  "scripts": {
132
132
  "test": "bun cli/build-handlers.ts && pnpm vitest",