@awsless/awsless 0.0.371 → 0.0.372
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 +82 -84
- package/dist/prebuild/rpc/HASH +1 -1
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +13 -34
- package/package.json +8 -7
package/dist/bin.js
CHANGED
|
@@ -1124,27 +1124,27 @@ var require_stringifyString = __commonJS({
|
|
|
1124
1124
|
return true;
|
|
1125
1125
|
}
|
|
1126
1126
|
function doubleQuotedString(value, ctx) {
|
|
1127
|
-
const
|
|
1127
|
+
const json3 = JSON.stringify(value);
|
|
1128
1128
|
if (ctx.options.doubleQuotedAsJSON)
|
|
1129
|
-
return
|
|
1129
|
+
return json3;
|
|
1130
1130
|
const { implicitKey } = ctx;
|
|
1131
1131
|
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
1132
1132
|
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
1133
1133
|
let str = "";
|
|
1134
1134
|
let start = 0;
|
|
1135
|
-
for (let i = 0, ch =
|
|
1136
|
-
if (ch === " " &&
|
|
1137
|
-
str +=
|
|
1135
|
+
for (let i = 0, ch = json3[i]; ch; ch = json3[++i]) {
|
|
1136
|
+
if (ch === " " && json3[i + 1] === "\\" && json3[i + 2] === "n") {
|
|
1137
|
+
str += json3.slice(start, i) + "\\ ";
|
|
1138
1138
|
i += 1;
|
|
1139
1139
|
start = i;
|
|
1140
1140
|
ch = "\\";
|
|
1141
1141
|
}
|
|
1142
1142
|
if (ch === "\\")
|
|
1143
|
-
switch (
|
|
1143
|
+
switch (json3[i + 1]) {
|
|
1144
1144
|
case "u":
|
|
1145
1145
|
{
|
|
1146
|
-
str +=
|
|
1147
|
-
const code =
|
|
1146
|
+
str += json3.slice(start, i);
|
|
1147
|
+
const code = json3.substr(i + 2, 4);
|
|
1148
1148
|
switch (code) {
|
|
1149
1149
|
case "0000":
|
|
1150
1150
|
str += "\\0";
|
|
@@ -1174,23 +1174,23 @@ var require_stringifyString = __commonJS({
|
|
|
1174
1174
|
if (code.substr(0, 2) === "00")
|
|
1175
1175
|
str += "\\x" + code.substr(2);
|
|
1176
1176
|
else
|
|
1177
|
-
str +=
|
|
1177
|
+
str += json3.substr(i, 6);
|
|
1178
1178
|
}
|
|
1179
1179
|
i += 5;
|
|
1180
1180
|
start = i + 1;
|
|
1181
1181
|
}
|
|
1182
1182
|
break;
|
|
1183
1183
|
case "n":
|
|
1184
|
-
if (implicitKey ||
|
|
1184
|
+
if (implicitKey || json3[i + 2] === '"' || json3.length < minMultiLineLength) {
|
|
1185
1185
|
i += 1;
|
|
1186
1186
|
} else {
|
|
1187
|
-
str +=
|
|
1188
|
-
while (
|
|
1187
|
+
str += json3.slice(start, i) + "\n\n";
|
|
1188
|
+
while (json3[i + 2] === "\\" && json3[i + 3] === "n" && json3[i + 4] !== '"') {
|
|
1189
1189
|
str += "\n";
|
|
1190
1190
|
i += 2;
|
|
1191
1191
|
}
|
|
1192
1192
|
str += indent;
|
|
1193
|
-
if (
|
|
1193
|
+
if (json3[i + 2] === " ")
|
|
1194
1194
|
str += "\\";
|
|
1195
1195
|
i += 1;
|
|
1196
1196
|
start = i + 1;
|
|
@@ -1200,7 +1200,7 @@ var require_stringifyString = __commonJS({
|
|
|
1200
1200
|
i += 1;
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
str = start ? str +
|
|
1203
|
+
str = start ? str + json3.slice(start) : json3;
|
|
1204
1204
|
return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
1205
1205
|
}
|
|
1206
1206
|
function singleQuotedString(value, ctx) {
|
|
@@ -3556,11 +3556,11 @@ var require_Document = __commonJS({
|
|
|
3556
3556
|
throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
|
|
3557
3557
|
}
|
|
3558
3558
|
// json & jsonArg are only used from toJSON()
|
|
3559
|
-
toJS({ json:
|
|
3559
|
+
toJS({ json: json3, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
3560
3560
|
const ctx = {
|
|
3561
3561
|
anchors: /* @__PURE__ */ new Map(),
|
|
3562
3562
|
doc: this,
|
|
3563
|
-
keep: !
|
|
3563
|
+
keep: !json3,
|
|
3564
3564
|
mapAsMap: mapAsMap === true,
|
|
3565
3565
|
mapKeyWarned: false,
|
|
3566
3566
|
maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
|
|
@@ -8731,8 +8731,8 @@ import JSON5 from "json5";
|
|
|
8731
8731
|
import { basename, dirname as dirname2, extname, join as join4 } from "path";
|
|
8732
8732
|
var readConfig = async (file) => {
|
|
8733
8733
|
try {
|
|
8734
|
-
const
|
|
8735
|
-
const data = JSON5.parse(
|
|
8734
|
+
const json3 = await readFile2(file, "utf8");
|
|
8735
|
+
const data = JSON5.parse(json3);
|
|
8736
8736
|
return data;
|
|
8737
8737
|
} catch (error) {
|
|
8738
8738
|
if (error instanceof Error) {
|
|
@@ -8961,7 +8961,7 @@ var generateGlobalAppId = (opt) => {
|
|
|
8961
8961
|
// src/feature/function/util.ts
|
|
8962
8962
|
import { Asset, aws as aws2 } from "@awsless/formation";
|
|
8963
8963
|
import deepmerge from "deepmerge";
|
|
8964
|
-
import { dirname as
|
|
8964
|
+
import { dirname as dirname6 } from "path";
|
|
8965
8965
|
|
|
8966
8966
|
// ../ts-file-cache/dist/index.js
|
|
8967
8967
|
import { createHash } from "crypto";
|
|
@@ -10432,15 +10432,10 @@ var hasOnFailure = (stacks) => {
|
|
|
10432
10432
|
};
|
|
10433
10433
|
|
|
10434
10434
|
// src/feature/function/build/typescript/bundle.ts
|
|
10435
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
10436
|
-
import json from "@rollup/plugin-json";
|
|
10437
|
-
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
10438
10435
|
import { createHash as createHash2 } from "crypto";
|
|
10439
|
-
import {
|
|
10440
|
-
import { rollup } from "rollup";
|
|
10441
|
-
import { swc, minify as swcMinify } from "rollup-plugin-swc3";
|
|
10436
|
+
import { rolldown } from "rolldown";
|
|
10442
10437
|
var bundleTypeScript = async ({ format: format2 = "esm", minify = true, file, external }) => {
|
|
10443
|
-
const bundle = await
|
|
10438
|
+
const bundle = await rolldown({
|
|
10444
10439
|
input: file,
|
|
10445
10440
|
external: (importee) => {
|
|
10446
10441
|
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
@@ -10448,31 +10443,15 @@ var bundleTypeScript = async ({ format: format2 = "esm", minify = true, file, ex
|
|
|
10448
10443
|
onwarn: (error) => {
|
|
10449
10444
|
debugError(error.message);
|
|
10450
10445
|
},
|
|
10451
|
-
treeshake: {
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
},
|
|
10446
|
+
// treeshake: {
|
|
10447
|
+
// // preset: 'smallest',
|
|
10448
|
+
// // moduleSideEffects: id => file === id,
|
|
10449
|
+
// },
|
|
10450
|
+
treeshake: true,
|
|
10455
10451
|
plugins: [
|
|
10456
|
-
//
|
|
10457
|
-
|
|
10458
|
-
//
|
|
10459
|
-
nodeResolve({ preferBuiltins: true }),
|
|
10460
|
-
swc({
|
|
10461
|
-
// minify,
|
|
10462
|
-
// module: true,
|
|
10463
|
-
jsc: {
|
|
10464
|
-
baseUrl: dirname6(file),
|
|
10465
|
-
minify: { sourceMap: true }
|
|
10466
|
-
},
|
|
10467
|
-
sourceMaps: true
|
|
10468
|
-
}),
|
|
10469
|
-
minify ? swcMinify({
|
|
10470
|
-
module: format2 === "esm",
|
|
10471
|
-
sourceMap: true,
|
|
10472
|
-
compress: true
|
|
10473
|
-
}) : void 0,
|
|
10474
|
-
// @ts-ignore
|
|
10475
|
-
json()
|
|
10452
|
+
// commonjs({ sourceMap: true }),
|
|
10453
|
+
// nodeResolve({ preferBuiltins: true }),
|
|
10454
|
+
// json(),
|
|
10476
10455
|
]
|
|
10477
10456
|
});
|
|
10478
10457
|
const ext = format2 === "esm" ? "mjs" : "js";
|
|
@@ -10480,7 +10459,7 @@ var bundleTypeScript = async ({ format: format2 = "esm", minify = true, file, ex
|
|
|
10480
10459
|
format: format2,
|
|
10481
10460
|
sourcemap: "hidden",
|
|
10482
10461
|
exports: "auto",
|
|
10483
|
-
manualChunks: {},
|
|
10462
|
+
// manualChunks: {},
|
|
10484
10463
|
entryFileNames: `index.${ext}`,
|
|
10485
10464
|
chunkFileNames: `[name].${ext}`
|
|
10486
10465
|
});
|
|
@@ -10568,7 +10547,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
|
|
|
10568
10547
|
let code;
|
|
10569
10548
|
if (props.runtime === "container") {
|
|
10570
10549
|
ctx.registerBuild("function", name, async (build3) => {
|
|
10571
|
-
const cwd =
|
|
10550
|
+
const cwd = dirname6(local2.file);
|
|
10572
10551
|
const version = await hashElement(cwd, {
|
|
10573
10552
|
files: {
|
|
10574
10553
|
exclude: ["stack.json"]
|
|
@@ -11411,14 +11390,14 @@ var formatFullDomainName = (config2, id, subDomain) => {
|
|
|
11411
11390
|
};
|
|
11412
11391
|
|
|
11413
11392
|
// src/feature/graphql/build/typescript/resolver.ts
|
|
11414
|
-
import
|
|
11415
|
-
import
|
|
11416
|
-
import
|
|
11417
|
-
import { dirname as
|
|
11418
|
-
import { rollup
|
|
11419
|
-
import { minify as
|
|
11393
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
11394
|
+
import json from "@rollup/plugin-json";
|
|
11395
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
11396
|
+
import { dirname as dirname7 } from "path";
|
|
11397
|
+
import { rollup } from "rollup";
|
|
11398
|
+
import { minify as swcMinify, swc } from "rollup-plugin-swc3";
|
|
11420
11399
|
var buildTypeScriptResolver = async (input, { minify = false } = {}) => {
|
|
11421
|
-
const bundle = await
|
|
11400
|
+
const bundle = await rollup({
|
|
11422
11401
|
input,
|
|
11423
11402
|
external: (importee) => {
|
|
11424
11403
|
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || importee.startsWith("@aws-appsync/utils");
|
|
@@ -11431,25 +11410,25 @@ var buildTypeScriptResolver = async (input, { minify = false } = {}) => {
|
|
|
11431
11410
|
},
|
|
11432
11411
|
plugins: [
|
|
11433
11412
|
// @ts-ignore
|
|
11434
|
-
|
|
11413
|
+
commonjs({ sourceMap: true }),
|
|
11435
11414
|
// @ts-ignore
|
|
11436
|
-
|
|
11437
|
-
|
|
11415
|
+
nodeResolve({ preferBuiltins: true }),
|
|
11416
|
+
swc({
|
|
11438
11417
|
// minify,
|
|
11439
11418
|
// module: true,
|
|
11440
11419
|
jsc: {
|
|
11441
|
-
baseUrl:
|
|
11420
|
+
baseUrl: dirname7(input),
|
|
11442
11421
|
minify: { sourceMap: true }
|
|
11443
11422
|
},
|
|
11444
11423
|
sourceMaps: true
|
|
11445
11424
|
}),
|
|
11446
|
-
minify ?
|
|
11425
|
+
minify ? swcMinify({
|
|
11447
11426
|
module: true,
|
|
11448
11427
|
sourceMap: true,
|
|
11449
11428
|
compress: true
|
|
11450
11429
|
}) : void 0,
|
|
11451
11430
|
// @ts-ignore
|
|
11452
|
-
|
|
11431
|
+
json()
|
|
11453
11432
|
]
|
|
11454
11433
|
});
|
|
11455
11434
|
const result = await bundle.generate({
|
|
@@ -11920,7 +11899,7 @@ import { days as days4 } from "@awsless/duration";
|
|
|
11920
11899
|
import { Asset as Asset3, aws as aws10, combine, Node as Node9, Output as Output2, unwrap } from "@awsless/formation";
|
|
11921
11900
|
import { hashElement as hashElement2 } from "folder-hash";
|
|
11922
11901
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
11923
|
-
import { dirname as
|
|
11902
|
+
import { dirname as dirname8 } from "path";
|
|
11924
11903
|
import { zip } from "zip-a-folder";
|
|
11925
11904
|
var instanceFeature = defineFeature({
|
|
11926
11905
|
name: "instance",
|
|
@@ -12003,7 +11982,7 @@ var instanceFeature = defineFeature({
|
|
|
12003
11982
|
}
|
|
12004
11983
|
});
|
|
12005
11984
|
await build3(version.hash, async () => {
|
|
12006
|
-
await mkdir3(
|
|
11985
|
+
await mkdir3(dirname8(bundleFile), { recursive: true });
|
|
12007
11986
|
await zip(props.code, bundleFile);
|
|
12008
11987
|
});
|
|
12009
11988
|
});
|
|
@@ -12459,7 +12438,7 @@ var restFeature = defineFeature({
|
|
|
12459
12438
|
import { camelCase as camelCase6, constantCase as constantCase9, paramCase as paramCase6 } from "change-case";
|
|
12460
12439
|
import { aws as aws17, Node as Node16, Output as Output3 } from "@awsless/formation";
|
|
12461
12440
|
import { mebibytes as mebibytes2 } from "@awsless/size";
|
|
12462
|
-
import { dirname as
|
|
12441
|
+
import { dirname as dirname9, join as join8, relative as relative5 } from "path";
|
|
12463
12442
|
import { fileURLToPath } from "node:url";
|
|
12464
12443
|
|
|
12465
12444
|
// src/feature/function/prebuild.ts
|
|
@@ -12603,7 +12582,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, local2) => {
|
|
|
12603
12582
|
|
|
12604
12583
|
// src/feature/rpc/index.ts
|
|
12605
12584
|
import { days as days5, seconds as seconds3 } from "@awsless/duration";
|
|
12606
|
-
var __dirname =
|
|
12585
|
+
var __dirname = dirname9(fileURLToPath(import.meta.url));
|
|
12607
12586
|
var rpcFeature = defineFeature({
|
|
12608
12587
|
name: "rpc",
|
|
12609
12588
|
async onTypeGen(ctx) {
|
|
@@ -12638,7 +12617,7 @@ var rpcFeature = defineFeature({
|
|
|
12638
12617
|
const list4 = names[id];
|
|
12639
12618
|
for (const name of Object.keys(queries ?? {})) {
|
|
12640
12619
|
if (list4.has(name)) {
|
|
12641
|
-
throw new FileError(stack.file, `
|
|
12620
|
+
throw new FileError(stack.file, `Duplicate RPC API function "${id}.${name}"`);
|
|
12642
12621
|
} else {
|
|
12643
12622
|
list4.add(name);
|
|
12644
12623
|
}
|
|
@@ -13384,6 +13363,25 @@ var topicFeature = defineFeature({
|
|
|
13384
13363
|
gen.addInterface("TopicMockResponse", mockResponses);
|
|
13385
13364
|
await ctx.write("topic.d.ts", gen, true);
|
|
13386
13365
|
},
|
|
13366
|
+
onValidate(ctx) {
|
|
13367
|
+
const unique = [];
|
|
13368
|
+
for (const stack of ctx.stackConfigs) {
|
|
13369
|
+
for (const topic of stack.topics ?? []) {
|
|
13370
|
+
if (unique.includes(topic)) {
|
|
13371
|
+
throw new FileError(stack.file, `Duplicate topic "${topic}"`);
|
|
13372
|
+
} else {
|
|
13373
|
+
unique.push(topic);
|
|
13374
|
+
}
|
|
13375
|
+
}
|
|
13376
|
+
}
|
|
13377
|
+
for (const stack of ctx.stackConfigs) {
|
|
13378
|
+
for (const topic of Object.keys(stack.subscribers ?? {})) {
|
|
13379
|
+
if (!unique.includes(topic)) {
|
|
13380
|
+
throw new FileError(stack.file, `Subscription to a undefined topic "${topic}"`);
|
|
13381
|
+
}
|
|
13382
|
+
}
|
|
13383
|
+
}
|
|
13384
|
+
},
|
|
13387
13385
|
onApp(ctx) {
|
|
13388
13386
|
for (const stack of ctx.stackConfigs) {
|
|
13389
13387
|
for (const id of stack.topics ?? []) {
|
|
@@ -14295,7 +14293,7 @@ import { join as join12 } from "path";
|
|
|
14295
14293
|
// src/build/__fingerprint.ts
|
|
14296
14294
|
import { createHash as createHash5 } from "crypto";
|
|
14297
14295
|
import { readdir, readFile as readFile6, stat as stat4 } from "fs/promises";
|
|
14298
|
-
import { basename as basename4, dirname as
|
|
14296
|
+
import { basename as basename4, dirname as dirname10, extname as extname3, join as join10 } from "path";
|
|
14299
14297
|
import parseStaticImports from "parse-static-imports";
|
|
14300
14298
|
var extensions = ["js", "mjs", "jsx", "ts", "mts", "tsx"];
|
|
14301
14299
|
var generateFileHashes = async (file, hashes) => {
|
|
@@ -14351,7 +14349,7 @@ var readFiles = async (files) => {
|
|
|
14351
14349
|
};
|
|
14352
14350
|
var findDependencies = async (file, code) => {
|
|
14353
14351
|
const imports = await parseStaticImports(code);
|
|
14354
|
-
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join10(
|
|
14352
|
+
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join10(dirname10(file), value) : value);
|
|
14355
14353
|
};
|
|
14356
14354
|
|
|
14357
14355
|
// src/test/reporter.ts
|
|
@@ -14428,16 +14426,16 @@ var CustomReporter = class {
|
|
|
14428
14426
|
};
|
|
14429
14427
|
|
|
14430
14428
|
// src/test/start.ts
|
|
14431
|
-
import { swc as
|
|
14429
|
+
import { swc as swc2 } from "rollup-plugin-swc3";
|
|
14432
14430
|
import { configDefaults } from "vitest/config";
|
|
14433
14431
|
import { startVitest } from "vitest/node";
|
|
14434
|
-
import
|
|
14435
|
-
import
|
|
14436
|
-
import
|
|
14437
|
-
import { dirname as
|
|
14432
|
+
import commonjs2 from "@rollup/plugin-commonjs";
|
|
14433
|
+
import nodeResolve2 from "@rollup/plugin-node-resolve";
|
|
14434
|
+
import json2 from "@rollup/plugin-json";
|
|
14435
|
+
import { dirname as dirname11, join as join11 } from "path";
|
|
14438
14436
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
14439
14437
|
var startTest = async (props) => {
|
|
14440
|
-
const __dirname2 =
|
|
14438
|
+
const __dirname2 = dirname11(fileURLToPath2(import.meta.url));
|
|
14441
14439
|
const result = await startVitest(
|
|
14442
14440
|
"test",
|
|
14443
14441
|
props.filters,
|
|
@@ -14470,10 +14468,10 @@ var startTest = async (props) => {
|
|
|
14470
14468
|
{
|
|
14471
14469
|
plugins: [
|
|
14472
14470
|
// @ts-ignore
|
|
14473
|
-
|
|
14471
|
+
commonjs2({ sourceMap: true }),
|
|
14474
14472
|
// @ts-ignore
|
|
14475
|
-
|
|
14476
|
-
|
|
14473
|
+
nodeResolve2({ preferBuiltins: true }),
|
|
14474
|
+
swc2({
|
|
14477
14475
|
jsc: {
|
|
14478
14476
|
// baseUrl: dirname(input),
|
|
14479
14477
|
minify: { sourceMap: true }
|
|
@@ -14481,7 +14479,7 @@ var startTest = async (props) => {
|
|
|
14481
14479
|
sourceMaps: true
|
|
14482
14480
|
}),
|
|
14483
14481
|
// @ts-ignore
|
|
14484
|
-
|
|
14482
|
+
json2()
|
|
14485
14483
|
]
|
|
14486
14484
|
}
|
|
14487
14485
|
);
|
|
@@ -14853,7 +14851,7 @@ import { log as log10 } from "@clack/prompts";
|
|
|
14853
14851
|
|
|
14854
14852
|
// src/type-gen/generate.ts
|
|
14855
14853
|
import { mkdir as mkdir5, writeFile as writeFile4 } from "fs/promises";
|
|
14856
|
-
import { dirname as
|
|
14854
|
+
import { dirname as dirname12, join as join13, relative as relative7 } from "path";
|
|
14857
14855
|
var generateTypes = async (props) => {
|
|
14858
14856
|
const files = [];
|
|
14859
14857
|
await Promise.all(
|
|
@@ -14867,7 +14865,7 @@ var generateTypes = async (props) => {
|
|
|
14867
14865
|
if (include) {
|
|
14868
14866
|
files.push(relative7(directories.root, path));
|
|
14869
14867
|
}
|
|
14870
|
-
await mkdir5(
|
|
14868
|
+
await mkdir5(dirname12(path), { recursive: true });
|
|
14871
14869
|
await writeFile4(path, code);
|
|
14872
14870
|
}
|
|
14873
14871
|
}
|
package/dist/prebuild/rpc/HASH
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1f3a2dc27bf572d149cd26c859b5c24dc19008e3
|
|
Binary file
|
package/dist/prebuild.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/prebuild.ts
|
|
2
2
|
import { mkdir } from "fs/promises";
|
|
3
|
-
import { dirname
|
|
3
|
+
import { dirname, join as join2 } from "path";
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
5
|
|
|
6
6
|
// src/feature/function/prebuild.ts
|
|
@@ -9,13 +9,8 @@ import { writeFile } from "fs/promises";
|
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
|
|
11
11
|
// src/feature/function/build/typescript/bundle.ts
|
|
12
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
13
|
-
import json from "@rollup/plugin-json";
|
|
14
|
-
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
15
12
|
import { createHash } from "crypto";
|
|
16
|
-
import {
|
|
17
|
-
import { rollup } from "rollup";
|
|
18
|
-
import { swc, minify as swcMinify } from "rollup-plugin-swc3";
|
|
13
|
+
import { rolldown } from "rolldown";
|
|
19
14
|
|
|
20
15
|
// src/cli/ui/style.ts
|
|
21
16
|
import chalk from "chalk";
|
|
@@ -48,7 +43,7 @@ var debugError = (error) => {
|
|
|
48
43
|
|
|
49
44
|
// src/feature/function/build/typescript/bundle.ts
|
|
50
45
|
var bundleTypeScript = async ({ format = "esm", minify = true, file, external }) => {
|
|
51
|
-
const bundle = await
|
|
46
|
+
const bundle = await rolldown({
|
|
52
47
|
input: file,
|
|
53
48
|
external: (importee) => {
|
|
54
49
|
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || external?.includes(importee);
|
|
@@ -56,31 +51,15 @@ var bundleTypeScript = async ({ format = "esm", minify = true, file, external })
|
|
|
56
51
|
onwarn: (error) => {
|
|
57
52
|
debugError(error.message);
|
|
58
53
|
},
|
|
59
|
-
treeshake: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
54
|
+
// treeshake: {
|
|
55
|
+
// // preset: 'smallest',
|
|
56
|
+
// // moduleSideEffects: id => file === id,
|
|
57
|
+
// },
|
|
58
|
+
treeshake: true,
|
|
63
59
|
plugins: [
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
nodeResolve({ preferBuiltins: true }),
|
|
68
|
-
swc({
|
|
69
|
-
// minify,
|
|
70
|
-
// module: true,
|
|
71
|
-
jsc: {
|
|
72
|
-
baseUrl: dirname(file),
|
|
73
|
-
minify: { sourceMap: true }
|
|
74
|
-
},
|
|
75
|
-
sourceMaps: true
|
|
76
|
-
}),
|
|
77
|
-
minify ? swcMinify({
|
|
78
|
-
module: format === "esm",
|
|
79
|
-
sourceMap: true,
|
|
80
|
-
compress: true
|
|
81
|
-
}) : void 0,
|
|
82
|
-
// @ts-ignore
|
|
83
|
-
json()
|
|
60
|
+
// commonjs({ sourceMap: true }),
|
|
61
|
+
// nodeResolve({ preferBuiltins: true }),
|
|
62
|
+
// json(),
|
|
84
63
|
]
|
|
85
64
|
});
|
|
86
65
|
const ext = format === "esm" ? "mjs" : "js";
|
|
@@ -88,7 +67,7 @@ var bundleTypeScript = async ({ format = "esm", minify = true, file, external })
|
|
|
88
67
|
format,
|
|
89
68
|
sourcemap: "hidden",
|
|
90
69
|
exports: "auto",
|
|
91
|
-
manualChunks: {},
|
|
70
|
+
// manualChunks: {},
|
|
92
71
|
entryFileNames: `index.${ext}`,
|
|
93
72
|
chunkFileNames: `[name].${ext}`
|
|
94
73
|
});
|
|
@@ -142,7 +121,7 @@ var prebuild = async (file, output) => {
|
|
|
142
121
|
};
|
|
143
122
|
|
|
144
123
|
// src/prebuild.ts
|
|
145
|
-
var __dirname =
|
|
124
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
146
125
|
var builds = {
|
|
147
126
|
rpc: "../src/feature/rpc/server/handle.ts"
|
|
148
127
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.372",
|
|
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/iot": "^0.0.2",
|
|
32
31
|
"@awsless/lambda": "^0.0.26",
|
|
33
|
-
"@awsless/
|
|
32
|
+
"@awsless/iot": "^0.0.2",
|
|
34
33
|
"@awsless/redis": "^0.0.13",
|
|
35
|
-
"@awsless/
|
|
34
|
+
"@awsless/open-search": "^0.0.15",
|
|
36
35
|
"@awsless/validate": "^0.0.15",
|
|
36
|
+
"@awsless/s3": "^0.0.18",
|
|
37
37
|
"@awsless/sns": "^0.0.7",
|
|
38
|
-
"@awsless/mqtt": "^0.0.2",
|
|
39
38
|
"@awsless/sqs": "^0.0.7",
|
|
40
39
|
"@awsless/ssm": "^0.0.7",
|
|
40
|
+
"@awsless/mqtt": "^0.0.2",
|
|
41
41
|
"@awsless/weak-cache": "^0.0.1"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"pretty-hrtime": "^1.0.3",
|
|
98
98
|
"promise-dag": "^1.0.0",
|
|
99
99
|
"promisify-child-process": "^4.1.2",
|
|
100
|
+
"rolldown": "^0.13.2",
|
|
100
101
|
"rollup": "^4.18.0",
|
|
101
102
|
"rollup-plugin-replace": "^2.2.0",
|
|
102
103
|
"rollup-plugin-swc3": "^0.11.2",
|
|
@@ -109,11 +110,11 @@
|
|
|
109
110
|
"zip-a-folder": "^3.1.6",
|
|
110
111
|
"zod": "^3.21.4",
|
|
111
112
|
"zod-to-json-schema": "^3.22.3",
|
|
112
|
-
"@awsless/code": "^0.0.10",
|
|
113
|
-
"@awsless/formation": "^0.0.56",
|
|
114
113
|
"@awsless/duration": "^0.0.1",
|
|
114
|
+
"@awsless/code": "^0.0.10",
|
|
115
115
|
"@awsless/size": "^0.0.1",
|
|
116
116
|
"@awsless/ts-file-cache": "^0.0.10",
|
|
117
|
+
"@awsless/formation": "^0.0.56",
|
|
117
118
|
"@awsless/validate": "^0.0.15",
|
|
118
119
|
"@awsless/graphql": "^0.0.9"
|
|
119
120
|
},
|