@awsless/awsless 0.0.634 → 0.0.635

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
@@ -2599,8 +2599,8 @@ var validateConfig = async (schema, file, data) => {
2599
2599
  // src/config/load/read.ts
2600
2600
  var readConfig = async (file) => {
2601
2601
  try {
2602
- const json2 = await readFile2(file, "utf8");
2603
- const data = Bun.JSON5.parse(json2);
2602
+ const json = await readFile2(file, "utf8");
2603
+ const data = Bun.JSON5.parse(json);
2604
2604
  return data;
2605
2605
  } catch (error) {
2606
2606
  if (error instanceof Error) {
@@ -8965,11 +8965,7 @@ import { parse as parse4, stringify } from "@awsless/json";
8965
8965
  import { generateFolderHash, loadWorkspace as loadWorkspace2 } from "@awsless/ts-file-cache";
8966
8966
 
8967
8967
  // src/test/start.ts
8968
- import commonjs from "@rollup/plugin-commonjs";
8969
- import json from "@rollup/plugin-json";
8970
- import nodeResolve from "@rollup/plugin-node-resolve";
8971
8968
  import { dirname as dirname9, join as join17 } from "path";
8972
- import { swc } from "rollup-plugin-swc3";
8973
8969
  import { fileURLToPath as fileURLToPath4 } from "url";
8974
8970
  import { configDefaults } from "vitest/config";
8975
8971
  import { startVitest } from "vitest/node";
@@ -9031,19 +9027,19 @@ var startTest = async (props) => {
9031
9027
  {
9032
9028
  logLevel: "silent",
9033
9029
  plugins: [
9034
- // @ts-ignore
9035
- commonjs({ sourceMap: true }),
9036
- // @ts-ignore
9037
- nodeResolve({ preferBuiltins: true }),
9038
- swc({
9039
- jsc: {
9040
- // baseUrl: dirname(input),
9041
- minify: { sourceMap: true }
9042
- },
9043
- sourceMaps: true
9044
- }),
9045
- // @ts-ignore
9046
- json()
9030
+ // // @ts-ignore
9031
+ // commonjs({ sourceMap: true }),
9032
+ // // @ts-ignore
9033
+ // nodeResolve({ preferBuiltins: true }),
9034
+ // swc({
9035
+ // jsc: {
9036
+ // // baseUrl: dirname(input),
9037
+ // minify: { sourceMap: true },
9038
+ // },
9039
+ // sourceMaps: true,
9040
+ // }),
9041
+ // // @ts-ignore
9042
+ // json(),
9047
9043
  ]
9048
9044
  }
9049
9045
  );
@@ -10370,28 +10366,28 @@ var formatLog = (level, date, group, message) => {
10370
10366
  );
10371
10367
  };
10372
10368
  var parseJsonLog = (message) => {
10373
- let json2;
10369
+ let json;
10374
10370
  try {
10375
- json2 = JSON.parse(message);
10371
+ json = JSON.parse(message);
10376
10372
  } catch (error) {
10377
10373
  }
10378
- if ("level" in json2 && typeof json2.level === "string" && "timestamp" in json2 && typeof json2.timestamp === "string" && "message" in json2) {
10374
+ if ("level" in json && typeof json.level === "string" && "timestamp" in json && typeof json.timestamp === "string" && "message" in json) {
10379
10375
  return {
10380
- level: json2.level,
10381
- message: typeof json2.message === "string" ? json2.message : JSON.stringify(json2.message, void 0, 2),
10382
- date: new Date(json2.timestamp)
10376
+ level: json.level,
10377
+ message: typeof json.message === "string" ? json.message : JSON.stringify(json.message, void 0, 2),
10378
+ date: new Date(json.timestamp)
10383
10379
  };
10384
10380
  }
10385
- if ("type" in json2 && typeof json2.type === "string" && json2.type.startsWith("platform") && "time" in json2 && typeof json2.time === "string" && "record" in json2) {
10381
+ if ("type" in json && typeof json.type === "string" && json.type.startsWith("platform") && "time" in json && typeof json.time === "string" && "record" in json) {
10386
10382
  return {
10387
10383
  level: "SYSTEM",
10388
- message: JSON.stringify(json2.record, void 0, 2),
10389
- date: new Date(json2.time)
10384
+ message: JSON.stringify(json.record, void 0, 2),
10385
+ date: new Date(json.time)
10390
10386
  };
10391
10387
  }
10392
10388
  return {
10393
10389
  level: "INFO",
10394
- message: JSON.stringify(json2, void 0, 2)
10390
+ message: JSON.stringify(json, void 0, 2)
10395
10391
  };
10396
10392
  };
10397
10393
 
@@ -1 +1 @@
1
- 5918e78d6d23bc71d39941430b7c9712ef16d915
1
+ 73b3439fb155315b972518d0d736d72eae472234
Binary file
@@ -1 +1 @@
1
- 500c44dba916ad19027a4611d6d0fe6a9c2da247
1
+ a8a0c621098150215b693d66e3304f6d4ae1db1b
Binary file
@@ -1 +1 @@
1
- c6682f0fa5edc35237c7b132c581d73b41abf639
1
+ 0a9ac239bd887ff2a80174c8e335813a8349852a
Binary file
package/dist/prebuild.js CHANGED
@@ -11,16 +11,10 @@ import { pascalCase } from "change-case";
11
11
  import { writeFile } from "fs/promises";
12
12
  import { join } from "path";
13
13
 
14
- // src/feature/function/build/typescript/bundle.ts
15
- import commonjs from "@rollup/plugin-commonjs";
16
- import json from "@rollup/plugin-json";
17
- import nodeResolve from "@rollup/plugin-node-resolve";
14
+ // src/feature/function/build/typescript/rolldown.ts
18
15
  import { createHash } from "crypto";
19
- import { dirname } from "path";
20
- import { rollup } from "rollup";
21
- import natives from "rollup-plugin-natives";
16
+ import { rolldown } from "rolldown";
22
17
  import { importAsString } from "rollup-plugin-string-import";
23
- import { swc, minify as swcMinify } from "rollup-plugin-swc3";
24
18
 
25
19
  // src/cli/ui/style.ts
26
20
  import chalk from "chalk";
@@ -51,8 +45,8 @@ var debugError = (error) => {
51
45
  });
52
46
  };
53
47
 
54
- // src/feature/function/build/typescript/bundle.ts
55
- var bundleTypeScript = async ({
48
+ // src/feature/function/build/typescript/rolldown.ts
49
+ var bundleTypeScriptWithRolldown = async ({
56
50
  format = "esm",
57
51
  minify = true,
58
52
  file,
@@ -60,8 +54,9 @@ var bundleTypeScript = async ({
60
54
  external,
61
55
  importAsString: importAsStringList
62
56
  }) => {
63
- const bundle = await rollup({
57
+ const bundle = await rolldown({
64
58
  input: file,
59
+ platform: "node",
65
60
  external: (importee) => {
66
61
  return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
67
62
  },
@@ -69,33 +64,17 @@ var bundleTypeScript = async ({
69
64
  debugError(error.message);
70
65
  },
71
66
  treeshake: {
72
- preset: "smallest",
73
67
  moduleSideEffects: (id) => file === id
74
68
  },
75
69
  plugins: [
76
- commonjs({ sourceMap: true }),
77
- nodeResolve({ preferBuiltins: true }),
78
- // @ts-ignore
79
- nativeDir ? natives({
80
- copyTo: nativeDir,
81
- targetEsm: format === "esm",
82
- sourcemap: true
83
- }) : void 0,
84
- swc({
85
- // minify,
86
- // module: true,
87
- jsc: {
88
- baseUrl: dirname(file),
89
- minify: { sourceMap: true }
90
- },
91
- sourceMaps: true
92
- }),
93
- minify ? swcMinify({
94
- module: format === "esm",
95
- sourceMap: true,
96
- compress: true
97
- }) : void 0,
98
- json(),
70
+ // nodeResolve({ preferBuiltins: true }),
71
+ // nativeDir
72
+ // ? natives({
73
+ // copyTo: nativeDir,
74
+ // targetEsm: format === 'esm',
75
+ // sourcemap: true,
76
+ // })
77
+ // : undefined,
99
78
  importAsStringList ? importAsString({
100
79
  include: importAsStringList
101
80
  }) : void 0
@@ -106,9 +85,9 @@ var bundleTypeScript = async ({
106
85
  format,
107
86
  sourcemap: "hidden",
108
87
  exports: "auto",
109
- manualChunks: {},
110
88
  entryFileNames: `index.${ext}`,
111
- chunkFileNames: `[name].${ext}`
89
+ chunkFileNames: `[name].${ext}`,
90
+ minify
112
91
  });
113
92
  const hash = createHash("sha1");
114
93
  const files = [];
@@ -118,7 +97,6 @@ var bundleTypeScript = async ({
118
97
  }
119
98
  const code = Buffer.from(item.code, "utf8");
120
99
  const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
121
- item.map?.version;
122
100
  hash.update(code);
123
101
  files.push({
124
102
  name: item.fileName,
@@ -155,7 +133,7 @@ var zipFiles = (files) => {
155
133
 
156
134
  // src/feature/function/prebuild.ts
157
135
  var prebuild = async (file, output, external = []) => {
158
- const bundle = await bundleTypeScript({
136
+ const bundle = await bundleTypeScriptWithRolldown({
159
137
  file,
160
138
  minify: true,
161
139
  external
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.634",
3
+ "version": "0.0.635",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -33,27 +33,25 @@
33
33
  ]
34
34
  },
35
35
  "peerDependencies": {
36
- "@awsless/big-float": "^0.1.5",
37
36
  "@awsless/cloudwatch": "^0.0.1",
38
- "@awsless/iot": "^0.0.3",
39
- "@awsless/json": "^0.0.11",
40
37
  "@awsless/clui": "^0.0.8",
38
+ "@awsless/big-float": "^0.1.5",
39
+ "@awsless/json": "^0.0.11",
40
+ "@awsless/duration": "^0.0.4",
41
+ "@awsless/iot": "^0.0.3",
42
+ "@awsless/dynamodb": "^0.3.14",
41
43
  "@awsless/lambda": "^0.0.36",
42
44
  "@awsless/s3": "^0.0.21",
45
+ "@awsless/sqs": "^0.0.16",
43
46
  "@awsless/sns": "^0.0.10",
44
- "@awsless/dynamodb": "^0.3.14",
45
- "@awsless/validate": "^0.1.5",
46
- "@awsless/redis": "^0.0.14",
47
- "@awsless/duration": "^0.0.4",
48
- "@awsless/ssm": "^0.0.7",
49
47
  "@awsless/mqtt": "^0.0.2",
50
- "@awsless/sqs": "^0.0.16",
48
+ "@awsless/validate": "^0.1.5",
49
+ "@awsless/weak-cache": "^0.0.1",
51
50
  "@awsless/open-search": "^0.0.21",
52
- "@awsless/weak-cache": "^0.0.1"
51
+ "@awsless/redis": "^0.0.14",
52
+ "@awsless/ssm": "^0.0.7"
53
53
  },
54
54
  "dependencies": {
55
- "@arcanyx/cidr-slicer": "^0.3.0",
56
- "@aws-appsync/utils": "^1.5.0",
57
55
  "@aws-sdk/client-cloudformation": "^3.369.0",
58
56
  "@aws-sdk/client-cloudfront": "^3.991.0",
59
57
  "@aws-sdk/client-cloudfront-keyvaluestore": "^3.817.0",
@@ -69,25 +67,16 @@
69
67
  "@aws-sdk/lib-storage": "^3.423.0",
70
68
  "@aws-sdk/signature-v4-crt": "^3.816.0",
71
69
  "@clack/prompts": "^0.7.0",
72
- "@graphql-tools/merge": "^9.0.0",
73
- "@rollup/plugin-commonjs": "^25.0.5",
74
- "@rollup/plugin-json": "^6.0.1",
75
- "@rollup/plugin-node-resolve": "^15.2.3",
76
- "@swc/core": "^1.3.70",
77
70
  "@terraforge/aws": "^6.35.1",
78
71
  "@terraforge/core": "^0.0.22",
79
72
  "@terraforge/terraform": "^0.0.19",
80
73
  "@types/aws-lambda": "^8.10.110",
81
74
  "@types/bun": "1.3.10",
82
75
  "@types/chunk": "^0.0.0",
83
- "@types/decompress": "^4.2.4",
84
76
  "@types/folder-hash": "^4.0.4",
85
77
  "@types/mime-types": "^2.1.2",
86
- "@types/minimist": "^1.2.5",
87
78
  "@types/play-sound": "^1.1.2",
88
79
  "@types/pretty-hrtime": "^1.0.1",
89
- "@types/promise-dag": "^1.0.4",
90
- "@types/rollup-plugin-natives": "^0.7.5",
91
80
  "@types/uuid": "^9.0.0",
92
81
  "@types/wildstring": "^1.0.3",
93
82
  "@vitest/runner": "^3.1.4",
@@ -101,40 +90,24 @@
101
90
  "cli-table3": "^0.6.4",
102
91
  "commander": "^9.4.1",
103
92
  "date-fns": "^4.1.0",
104
- "decompress": "^4.2.1",
105
93
  "deepmerge": "^4.3.1",
106
- "event-iterator": "^2.0.0",
107
94
  "fast-json-patch": "^3.1.1",
108
- "fastq": "^1.16.0",
109
95
  "filesize": "^10.0.7",
110
96
  "folder-hash": "^4.0.4",
111
97
  "glob": "^10.3.9",
112
- "graphql": "^16.7.1",
113
98
  "json5": "^2.2.3",
114
99
  "jszip": "^3.10.1",
115
100
  "mime-types": "^2.1.35",
116
- "minimist": "^1.2.8",
117
- "node-docker-api": "^1.1.22",
118
101
  "p-limit": "7.2.0",
119
- "parse-imports": "^1.1.2",
120
- "parse-static-imports": "^1.1.0",
121
102
  "play-sound": "^1.1.6",
122
103
  "pretty-hrtime": "^1.0.3",
123
- "promise-dag": "^1.0.0",
124
- "promisify-child-process": "^4.1.2",
125
104
  "rolldown": "1.0.0-rc.3",
126
- "rollup": "^4.18.0",
127
- "rollup-plugin-natives": "^0.7.8",
128
- "rollup-plugin-replace": "^2.2.0",
129
105
  "rollup-plugin-string-import": "1.2.6",
130
- "rollup-plugin-swc3": "^0.11.2",
131
106
  "svgo": "^4.0.0",
132
107
  "svgstore": "^3.0.1",
133
- "tsx": "^4.15.5",
134
108
  "type-fest": "^4.20.1",
135
109
  "uuid": "^9.0.0",
136
- "vite": "^5.0.0",
137
- "vitest": "^4.0.18",
110
+ "vitest": "^4.1.0",
138
111
  "wildstring": "^1.0.9",
139
112
  "wrap-ansi": "^8.1.0",
140
113
  "zip-a-folder": "^3.1.6",
@@ -142,13 +115,12 @@
142
115
  "zod-to-json-schema": "^3.24.3",
143
116
  "@awsless/cloudwatch": "^0.0.1",
144
117
  "@awsless/big-float": "^0.1.5",
145
- "@awsless/duration": "^0.0.4",
118
+ "@awsless/clui": "^0.0.8",
146
119
  "@awsless/size": "^0.0.2",
147
- "@awsless/graphql": "^0.0.9",
120
+ "@awsless/duration": "^0.0.4",
121
+ "@awsless/ts-file-cache": "^0.0.12",
148
122
  "@awsless/validate": "^0.1.5",
149
- "@awsless/clui": "^0.0.8",
150
123
  "@awsless/json": "^0.0.11",
151
- "@awsless/ts-file-cache": "^0.0.12",
152
124
  "@awsless/scheduler": "^0.0.4"
153
125
  },
154
126
  "devDependencies": {