@awsless/awsless 0.0.78 → 0.0.80

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/bin.js +26 -10
  2. package/package.json +3 -3
package/dist/bin.js CHANGED
@@ -1616,8 +1616,12 @@ var toLambdaFunction = (ctx, id, fileOrProps) => {
1616
1616
  resources: ["*"]
1617
1617
  });
1618
1618
  }
1619
- ctx.bind((other) => {
1620
- other.addPermissions(lambda.permissions);
1619
+ lambda.addPermissions({
1620
+ actions: [
1621
+ "lambda:InvokeFunction",
1622
+ "lambda:InvokeAsync"
1623
+ ],
1624
+ resources: ["*"]
1621
1625
  });
1622
1626
  return lambda;
1623
1627
  };
@@ -2429,7 +2433,7 @@ import { PublishOptions } from '@awsless/sns'
2429
2433
 
2430
2434
  type Publish<Name extends string> = {
2431
2435
  readonly name: Name
2432
- readonly (payload: unknown, options?: Omit<PublishOptions, 'topic' | 'payload'>): Promise<void>
2436
+ (payload: unknown, options?: Omit<PublishOptions, 'topic' | 'payload'>): Promise<void>
2433
2437
  }`;
2434
2438
  var topicPlugin = definePlugin({
2435
2439
  name: "topic",
@@ -6271,7 +6275,7 @@ var importConfig = async (options) => {
6271
6275
  credentials
6272
6276
  };
6273
6277
  };
6274
- var watchConfig = async function* (options) {
6278
+ var watchConfig = async (options, resolve, reject) => {
6275
6279
  debug("Find the root directory");
6276
6280
  const configFile = options.configFile || "awsless.config.ts";
6277
6281
  const root2 = await findRootDir(process.cwd(), configFile);
@@ -6297,20 +6301,22 @@ var watchConfig = async function* (options) {
6297
6301
  config = await schema2.parseAsync(appConfig);
6298
6302
  } catch (error) {
6299
6303
  if (error instanceof z30.ZodError) {
6300
- throw new ConfigError(error, appConfig);
6304
+ reject(new ConfigError(error, appConfig));
6305
+ continue;
6301
6306
  }
6302
- throw error;
6307
+ reject(error);
6308
+ continue;
6303
6309
  }
6304
6310
  debug("Load credentials", style.info(config.profile));
6305
6311
  const credentials = getCredentials(config.profile);
6306
6312
  debug("Load AWS account ID");
6307
6313
  const account = await getAccountId(credentials, config.region);
6308
6314
  debug("Account ID:", style.info(account));
6309
- yield {
6315
+ resolve({
6310
6316
  ...config,
6311
6317
  account,
6312
6318
  credentials
6313
- };
6319
+ });
6314
6320
  }
6315
6321
  };
6316
6322
 
@@ -7813,10 +7819,20 @@ var dev = (program2) => {
7813
7819
  program2.command("dev").description("Start the development service").action(async () => {
7814
7820
  await layout(async (_, write) => {
7815
7821
  const options = program2.optsWithGlobals();
7816
- for await (const config of watchConfig(options)) {
7822
+ await watchConfig(options, async (config) => {
7817
7823
  await cleanUp();
7818
7824
  await write(typesGenerator(config));
7819
- }
7825
+ }, (error) => {
7826
+ if (error instanceof ConfigError) {
7827
+ write(zodError(error.error, error.data));
7828
+ } else if (error instanceof Error) {
7829
+ write(dialog("error", [error.message]));
7830
+ } else if (typeof error === "string") {
7831
+ write(dialog("error", [error]));
7832
+ } else {
7833
+ write(dialog("error", [JSON.stringify(error)]));
7834
+ }
7835
+ });
7820
7836
  });
7821
7837
  });
7822
7838
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,9 +24,9 @@
24
24
  }
25
25
  },
26
26
  "peerDependencies": {
27
- "@awsless/ssm": "^0.0.7",
28
- "@awsless/sns": "^0.0.6",
29
27
  "@awsless/lambda": "^0.0.6",
28
+ "@awsless/sns": "^0.0.6",
29
+ "@awsless/ssm": "^0.0.7",
30
30
  "@awsless/sqs": "^0.0.6"
31
31
  },
32
32
  "dependencies": {