@awsless/awsless 0.0.415 → 0.0.417

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
@@ -13709,7 +13709,7 @@ import type { PublishOptions } from '@awsless/sns'
13709
13709
 
13710
13710
  type Alert<Name extends string> = {
13711
13711
  readonly name: Name
13712
- (subject: string, payload?: string, options?: Omit<PublishOptions, 'subject' | 'topic' | 'payload'>): Promise<void>
13712
+ (subject: string, payload?: unknown, options?: Omit<PublishOptions, 'subject' | 'topic' | 'payload'>): Promise<void>
13713
13713
  }
13714
13714
 
13715
13715
  type MockHandle = (payload: unknown) => void
@@ -14332,6 +14332,7 @@ var createApp = (props) => {
14332
14332
  // src/cli/ui/complex/build-assets.ts
14333
14333
  import { loadWorkspace } from "@awsless/ts-file-cache";
14334
14334
  import chalk3 from "chalk";
14335
+ import wildstring from "wildstring";
14335
14336
  var buildAssets = async (builders, stackFilters, showResult = false) => {
14336
14337
  if (builders.length === 0) {
14337
14338
  return;
@@ -14341,7 +14342,8 @@ var buildAssets = async (builders, stackFilters, showResult = false) => {
14341
14342
  const workspace = await loadWorkspace(directories.root);
14342
14343
  for (const builder of builders) {
14343
14344
  if (stackFilters && stackFilters.length > 0) {
14344
- if (!stackFilters.includes(builder.stackName)) {
14345
+ const found = stackFilters.find((f) => wildstring.match(f, builder.stackName));
14346
+ if (!found) {
14345
14347
  continue;
14346
14348
  }
14347
14349
  }
@@ -14523,6 +14525,7 @@ var config = (program2) => {
14523
14525
 
14524
14526
  // src/cli/command/delete.ts
14525
14527
  import { confirm as confirm3, isCancel as isCancel4 } from "@clack/prompts";
14528
+ import wildstring2 from "wildstring";
14526
14529
  var del2 = (program2) => {
14527
14530
  program2.command("delete").argument("[stacks...]", "Optionally filter stacks to delete").description("Delete your app from AWS").action(async (filters) => {
14528
14531
  await layout("delete", async ({ appConfig, stackConfigs }) => {
@@ -14530,7 +14533,9 @@ var del2 = (program2) => {
14530
14533
  const credentials = getCredentials(appConfig.profile);
14531
14534
  const accountId = await getAccountId(credentials, region);
14532
14535
  const { app } = createApp({ appConfig, stackConfigs, accountId });
14533
- const stackNames = app.stacks.filter((stack) => filters.includes(stack.name)).map((s) => s.name);
14536
+ const stackNames = app.stacks.filter((stack) => {
14537
+ return !!filters.find((f) => wildstring2.match(f, stack.name));
14538
+ }).map((s) => s.name);
14534
14539
  const formattedFilter = stackNames.map((i) => color.info(i)).join(color.dim(", "));
14535
14540
  debug("Stacks to delete", formattedFilter);
14536
14541
  if (!process.env.SKIP_PROMPT) {
@@ -14564,12 +14569,14 @@ var del2 = (program2) => {
14564
14569
 
14565
14570
  // src/cli/command/deploy.ts
14566
14571
  import { confirm as confirm4, isCancel as isCancel5 } from "@clack/prompts";
14572
+ import wildstring4 from "wildstring";
14567
14573
 
14568
14574
  // src/cli/ui/complex/run-tests.ts
14569
14575
  import { log as log8 } from "@clack/prompts";
14570
14576
  import chalk6 from "chalk";
14571
14577
  import { mkdir as mkdir5, readFile as readFile7, writeFile as writeFile3 } from "fs/promises";
14572
14578
  import { join as join13 } from "path";
14579
+ import wildstring3 from "wildstring";
14573
14580
 
14574
14581
  // src/build/__fingerprint.ts
14575
14582
  import { createHash as createHash5 } from "crypto";
@@ -14881,7 +14888,8 @@ var runTest = async (stack, dir, filters) => {
14881
14888
  var runTests = async (tests, stackFilters = [], testFilters = []) => {
14882
14889
  for (const test2 of tests) {
14883
14890
  if (stackFilters && stackFilters.length > 0) {
14884
- if (!stackFilters.includes(test2.stackName)) {
14891
+ const found = stackFilters.find((f) => wildstring3.match(f, test2.stackName));
14892
+ if (!found) {
14885
14893
  continue;
14886
14894
  }
14887
14895
  }
@@ -14904,7 +14912,9 @@ var deploy = (program2) => {
14904
14912
  const accountId = await getAccountId(credentials, region);
14905
14913
  await bootstrapAwsless({ credentials, region, accountId });
14906
14914
  const { app, tests, builders } = createApp({ appConfig, stackConfigs, accountId });
14907
- const stackNames = app.stacks.filter((stack) => filters.includes(stack.name)).map((s) => s.name);
14915
+ const stackNames = app.stacks.filter((stack) => {
14916
+ return !!filters.find((f) => wildstring4.match(f, stack.name));
14917
+ }).map((s) => s.name);
14908
14918
  const formattedFilter = stackNames.map((i) => color.info(i)).join(color.dim(", "));
14909
14919
  debug("Stacks to deploy", formattedFilter);
14910
14920
  if (!process.env.SKIP_PROMPT) {
Binary file
package/dist/server.js CHANGED
@@ -10,6 +10,7 @@ import "./chunk-JSBRDJBE.js";
10
10
  import { mockSNS } from "@awsless/sns";
11
11
 
12
12
  // src/lib/server/alert.ts
13
+ import { stringify } from "@awsless/json";
13
14
  import { publish } from "@awsless/sns";
14
15
 
15
16
  // src/lib/server/util.ts
@@ -65,7 +66,7 @@ var Alert = /* @__PURE__ */ createProxy((name) => {
65
66
  ...options,
66
67
  topic,
67
68
  subject,
68
- payload
69
+ payload: typeof payload === "string" || typeof payload === "undefined" ? payload : stringify(payload)
69
70
  });
70
71
  }
71
72
  };
@@ -255,7 +256,7 @@ var mockTask = (cb) => {
255
256
  import { mockSNS as mockSNS2 } from "@awsless/sns";
256
257
 
257
258
  // src/lib/server/topic.ts
258
- import { stringify } from "@awsless/json";
259
+ import { stringify as stringify2 } from "@awsless/json";
259
260
  import { publish as publish2 } from "@awsless/sns";
260
261
  var getTopicName = bindGlobalResourceName("topic");
261
262
  var Topic = /* @__PURE__ */ createProxy((name) => {
@@ -265,7 +266,7 @@ var Topic = /* @__PURE__ */ createProxy((name) => {
265
266
  await publish2({
266
267
  ...options,
267
268
  topic,
268
- payload: stringify(payload)
269
+ payload: stringify2(payload)
269
270
  });
270
271
  }
271
272
  };
@@ -404,7 +405,7 @@ var Config = /* @__PURE__ */ new Proxy(
404
405
  // src/lib/server/pubsub.ts
405
406
  import { hours, toSeconds } from "@awsless/duration";
406
407
  import { publish as publish3, QoS } from "@awsless/iot";
407
- import { stringify as stringify2 } from "@awsless/json";
408
+ import { stringify as stringify3 } from "@awsless/json";
408
409
  var getPubSubTopic = (name) => {
409
410
  return `${APP}/pubsub/${name}`;
410
411
  };
@@ -412,7 +413,7 @@ var PubSub = {
412
413
  async publish(topic, event, payload, opts = {}) {
413
414
  await publish3({
414
415
  topic: getPubSubTopic(topic),
415
- payload: Buffer.from(stringify2([event, payload])),
416
+ payload: Buffer.from(stringify3([event, payload])),
416
417
  ...opts
417
418
  });
418
419
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.415",
3
+ "version": "0.0.417",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,16 +28,16 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/lambda": "^0.0.30",
31
+ "@awsless/json": "^0.0.6",
32
32
  "@awsless/iot": "^0.0.2",
33
+ "@awsless/lambda": "^0.0.30",
34
+ "@awsless/s3": "^0.0.18",
33
35
  "@awsless/open-search": "^0.0.15",
34
36
  "@awsless/redis": "^0.0.13",
37
+ "@awsless/ssm": "^0.0.7",
35
38
  "@awsless/sns": "^0.0.9",
36
- "@awsless/s3": "^0.0.18",
37
39
  "@awsless/sqs": "^0.0.7",
38
- "@awsless/json": "^0.0.6",
39
40
  "@awsless/validate": "^0.0.16",
40
- "@awsless/ssm": "^0.0.7",
41
41
  "@awsless/weak-cache": "^0.0.1",
42
42
  "@awsless/mqtt": "^0.0.2"
43
43
  },
@@ -71,6 +71,7 @@
71
71
  "@types/promise-dag": "^1.0.4",
72
72
  "@types/rollup-plugin-natives": "^0.7.5",
73
73
  "@types/uuid": "^9.0.0",
74
+ "@types/wildstring": "^1.0.3",
74
75
  "@vitest/runner": "^1.6.0",
75
76
  "aws-cron-expression-validator": "^1.0.5",
76
77
  "aws-lambda": "^1.0.7",
@@ -109,18 +110,19 @@
109
110
  "uuid": "^9.0.0",
110
111
  "vite": "^5.0.0",
111
112
  "vitest": "^1.6.0",
113
+ "wildstring": "^1.0.9",
112
114
  "wrap-ansi": "^8.1.0",
113
115
  "zip-a-folder": "^3.1.6",
114
116
  "zod": "^3.21.4",
115
117
  "zod-to-json-schema": "^3.22.3",
116
- "@awsless/graphql": "^0.0.9",
118
+ "@awsless/code": "^0.0.10",
117
119
  "@awsless/duration": "^0.0.1",
118
120
  "@awsless/formation": "^0.0.57",
121
+ "@awsless/json": "^0.0.6",
119
122
  "@awsless/validate": "^0.0.16",
120
- "@awsless/size": "^0.0.1",
121
123
  "@awsless/ts-file-cache": "^0.0.10",
122
- "@awsless/code": "^0.0.10",
123
- "@awsless/json": "^0.0.6"
124
+ "@awsless/size": "^0.0.1",
125
+ "@awsless/graphql": "^0.0.9"
124
126
  },
125
127
  "devDependencies": {
126
128
  "@node-rs/bcrypt": "^1.10.5"