@awsless/awsless 0.0.371 → 0.0.373
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 +84 -85
- package/dist/prebuild/rpc/HASH +1 -1
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +15 -35
- package/package.json +10 -9
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,9 +10459,10 @@ 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
|
-
chunkFileNames: `[name].${ext}
|
|
10464
|
+
chunkFileNames: `[name].${ext}`,
|
|
10465
|
+
minify: true
|
|
10486
10466
|
});
|
|
10487
10467
|
const hash = createHash2("sha1");
|
|
10488
10468
|
const files = [];
|
|
@@ -10568,7 +10548,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
|
|
|
10568
10548
|
let code;
|
|
10569
10549
|
if (props.runtime === "container") {
|
|
10570
10550
|
ctx.registerBuild("function", name, async (build3) => {
|
|
10571
|
-
const cwd =
|
|
10551
|
+
const cwd = dirname6(local2.file);
|
|
10572
10552
|
const version = await hashElement(cwd, {
|
|
10573
10553
|
files: {
|
|
10574
10554
|
exclude: ["stack.json"]
|
|
@@ -11411,14 +11391,14 @@ var formatFullDomainName = (config2, id, subDomain) => {
|
|
|
11411
11391
|
};
|
|
11412
11392
|
|
|
11413
11393
|
// src/feature/graphql/build/typescript/resolver.ts
|
|
11414
|
-
import
|
|
11415
|
-
import
|
|
11416
|
-
import
|
|
11417
|
-
import { dirname as
|
|
11418
|
-
import { rollup
|
|
11419
|
-
import { minify as
|
|
11394
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
11395
|
+
import json from "@rollup/plugin-json";
|
|
11396
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
11397
|
+
import { dirname as dirname7 } from "path";
|
|
11398
|
+
import { rollup } from "rollup";
|
|
11399
|
+
import { minify as swcMinify, swc } from "rollup-plugin-swc3";
|
|
11420
11400
|
var buildTypeScriptResolver = async (input, { minify = false } = {}) => {
|
|
11421
|
-
const bundle = await
|
|
11401
|
+
const bundle = await rollup({
|
|
11422
11402
|
input,
|
|
11423
11403
|
external: (importee) => {
|
|
11424
11404
|
return importee.startsWith("@aws-sdk") || importee.startsWith("aws-sdk") || importee.startsWith("@aws-appsync/utils");
|
|
@@ -11431,25 +11411,25 @@ var buildTypeScriptResolver = async (input, { minify = false } = {}) => {
|
|
|
11431
11411
|
},
|
|
11432
11412
|
plugins: [
|
|
11433
11413
|
// @ts-ignore
|
|
11434
|
-
|
|
11414
|
+
commonjs({ sourceMap: true }),
|
|
11435
11415
|
// @ts-ignore
|
|
11436
|
-
|
|
11437
|
-
|
|
11416
|
+
nodeResolve({ preferBuiltins: true }),
|
|
11417
|
+
swc({
|
|
11438
11418
|
// minify,
|
|
11439
11419
|
// module: true,
|
|
11440
11420
|
jsc: {
|
|
11441
|
-
baseUrl:
|
|
11421
|
+
baseUrl: dirname7(input),
|
|
11442
11422
|
minify: { sourceMap: true }
|
|
11443
11423
|
},
|
|
11444
11424
|
sourceMaps: true
|
|
11445
11425
|
}),
|
|
11446
|
-
minify ?
|
|
11426
|
+
minify ? swcMinify({
|
|
11447
11427
|
module: true,
|
|
11448
11428
|
sourceMap: true,
|
|
11449
11429
|
compress: true
|
|
11450
11430
|
}) : void 0,
|
|
11451
11431
|
// @ts-ignore
|
|
11452
|
-
|
|
11432
|
+
json()
|
|
11453
11433
|
]
|
|
11454
11434
|
});
|
|
11455
11435
|
const result = await bundle.generate({
|
|
@@ -11920,7 +11900,7 @@ import { days as days4 } from "@awsless/duration";
|
|
|
11920
11900
|
import { Asset as Asset3, aws as aws10, combine, Node as Node9, Output as Output2, unwrap } from "@awsless/formation";
|
|
11921
11901
|
import { hashElement as hashElement2 } from "folder-hash";
|
|
11922
11902
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
11923
|
-
import { dirname as
|
|
11903
|
+
import { dirname as dirname8 } from "path";
|
|
11924
11904
|
import { zip } from "zip-a-folder";
|
|
11925
11905
|
var instanceFeature = defineFeature({
|
|
11926
11906
|
name: "instance",
|
|
@@ -12003,7 +11983,7 @@ var instanceFeature = defineFeature({
|
|
|
12003
11983
|
}
|
|
12004
11984
|
});
|
|
12005
11985
|
await build3(version.hash, async () => {
|
|
12006
|
-
await mkdir3(
|
|
11986
|
+
await mkdir3(dirname8(bundleFile), { recursive: true });
|
|
12007
11987
|
await zip(props.code, bundleFile);
|
|
12008
11988
|
});
|
|
12009
11989
|
});
|
|
@@ -12459,7 +12439,7 @@ var restFeature = defineFeature({
|
|
|
12459
12439
|
import { camelCase as camelCase6, constantCase as constantCase9, paramCase as paramCase6 } from "change-case";
|
|
12460
12440
|
import { aws as aws17, Node as Node16, Output as Output3 } from "@awsless/formation";
|
|
12461
12441
|
import { mebibytes as mebibytes2 } from "@awsless/size";
|
|
12462
|
-
import { dirname as
|
|
12442
|
+
import { dirname as dirname9, join as join8, relative as relative5 } from "path";
|
|
12463
12443
|
import { fileURLToPath } from "node:url";
|
|
12464
12444
|
|
|
12465
12445
|
// src/feature/function/prebuild.ts
|
|
@@ -12603,7 +12583,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, local2) => {
|
|
|
12603
12583
|
|
|
12604
12584
|
// src/feature/rpc/index.ts
|
|
12605
12585
|
import { days as days5, seconds as seconds3 } from "@awsless/duration";
|
|
12606
|
-
var __dirname =
|
|
12586
|
+
var __dirname = dirname9(fileURLToPath(import.meta.url));
|
|
12607
12587
|
var rpcFeature = defineFeature({
|
|
12608
12588
|
name: "rpc",
|
|
12609
12589
|
async onTypeGen(ctx) {
|
|
@@ -12638,7 +12618,7 @@ var rpcFeature = defineFeature({
|
|
|
12638
12618
|
const list4 = names[id];
|
|
12639
12619
|
for (const name of Object.keys(queries ?? {})) {
|
|
12640
12620
|
if (list4.has(name)) {
|
|
12641
|
-
throw new FileError(stack.file, `
|
|
12621
|
+
throw new FileError(stack.file, `Duplicate RPC API function "${id}.${name}"`);
|
|
12642
12622
|
} else {
|
|
12643
12623
|
list4.add(name);
|
|
12644
12624
|
}
|
|
@@ -13384,6 +13364,25 @@ var topicFeature = defineFeature({
|
|
|
13384
13364
|
gen.addInterface("TopicMockResponse", mockResponses);
|
|
13385
13365
|
await ctx.write("topic.d.ts", gen, true);
|
|
13386
13366
|
},
|
|
13367
|
+
onValidate(ctx) {
|
|
13368
|
+
const unique = [];
|
|
13369
|
+
for (const stack of ctx.stackConfigs) {
|
|
13370
|
+
for (const topic of stack.topics ?? []) {
|
|
13371
|
+
if (unique.includes(topic)) {
|
|
13372
|
+
throw new FileError(stack.file, `Duplicate topic "${topic}"`);
|
|
13373
|
+
} else {
|
|
13374
|
+
unique.push(topic);
|
|
13375
|
+
}
|
|
13376
|
+
}
|
|
13377
|
+
}
|
|
13378
|
+
for (const stack of ctx.stackConfigs) {
|
|
13379
|
+
for (const topic of Object.keys(stack.subscribers ?? {})) {
|
|
13380
|
+
if (!unique.includes(topic)) {
|
|
13381
|
+
throw new FileError(stack.file, `Subscription to a undefined topic "${topic}"`);
|
|
13382
|
+
}
|
|
13383
|
+
}
|
|
13384
|
+
}
|
|
13385
|
+
},
|
|
13387
13386
|
onApp(ctx) {
|
|
13388
13387
|
for (const stack of ctx.stackConfigs) {
|
|
13389
13388
|
for (const id of stack.topics ?? []) {
|
|
@@ -14295,7 +14294,7 @@ import { join as join12 } from "path";
|
|
|
14295
14294
|
// src/build/__fingerprint.ts
|
|
14296
14295
|
import { createHash as createHash5 } from "crypto";
|
|
14297
14296
|
import { readdir, readFile as readFile6, stat as stat4 } from "fs/promises";
|
|
14298
|
-
import { basename as basename4, dirname as
|
|
14297
|
+
import { basename as basename4, dirname as dirname10, extname as extname3, join as join10 } from "path";
|
|
14299
14298
|
import parseStaticImports from "parse-static-imports";
|
|
14300
14299
|
var extensions = ["js", "mjs", "jsx", "ts", "mts", "tsx"];
|
|
14301
14300
|
var generateFileHashes = async (file, hashes) => {
|
|
@@ -14351,7 +14350,7 @@ var readFiles = async (files) => {
|
|
|
14351
14350
|
};
|
|
14352
14351
|
var findDependencies = async (file, code) => {
|
|
14353
14352
|
const imports = await parseStaticImports(code);
|
|
14354
|
-
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join10(
|
|
14353
|
+
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join10(dirname10(file), value) : value);
|
|
14355
14354
|
};
|
|
14356
14355
|
|
|
14357
14356
|
// src/test/reporter.ts
|
|
@@ -14428,16 +14427,16 @@ var CustomReporter = class {
|
|
|
14428
14427
|
};
|
|
14429
14428
|
|
|
14430
14429
|
// src/test/start.ts
|
|
14431
|
-
import { swc as
|
|
14430
|
+
import { swc as swc2 } from "rollup-plugin-swc3";
|
|
14432
14431
|
import { configDefaults } from "vitest/config";
|
|
14433
14432
|
import { startVitest } from "vitest/node";
|
|
14434
|
-
import
|
|
14435
|
-
import
|
|
14436
|
-
import
|
|
14437
|
-
import { dirname as
|
|
14433
|
+
import commonjs2 from "@rollup/plugin-commonjs";
|
|
14434
|
+
import nodeResolve2 from "@rollup/plugin-node-resolve";
|
|
14435
|
+
import json2 from "@rollup/plugin-json";
|
|
14436
|
+
import { dirname as dirname11, join as join11 } from "path";
|
|
14438
14437
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
14439
14438
|
var startTest = async (props) => {
|
|
14440
|
-
const __dirname2 =
|
|
14439
|
+
const __dirname2 = dirname11(fileURLToPath2(import.meta.url));
|
|
14441
14440
|
const result = await startVitest(
|
|
14442
14441
|
"test",
|
|
14443
14442
|
props.filters,
|
|
@@ -14470,10 +14469,10 @@ var startTest = async (props) => {
|
|
|
14470
14469
|
{
|
|
14471
14470
|
plugins: [
|
|
14472
14471
|
// @ts-ignore
|
|
14473
|
-
|
|
14472
|
+
commonjs2({ sourceMap: true }),
|
|
14474
14473
|
// @ts-ignore
|
|
14475
|
-
|
|
14476
|
-
|
|
14474
|
+
nodeResolve2({ preferBuiltins: true }),
|
|
14475
|
+
swc2({
|
|
14477
14476
|
jsc: {
|
|
14478
14477
|
// baseUrl: dirname(input),
|
|
14479
14478
|
minify: { sourceMap: true }
|
|
@@ -14481,7 +14480,7 @@ var startTest = async (props) => {
|
|
|
14481
14480
|
sourceMaps: true
|
|
14482
14481
|
}),
|
|
14483
14482
|
// @ts-ignore
|
|
14484
|
-
|
|
14483
|
+
json2()
|
|
14485
14484
|
]
|
|
14486
14485
|
}
|
|
14487
14486
|
);
|
|
@@ -14853,7 +14852,7 @@ import { log as log10 } from "@clack/prompts";
|
|
|
14853
14852
|
|
|
14854
14853
|
// src/type-gen/generate.ts
|
|
14855
14854
|
import { mkdir as mkdir5, writeFile as writeFile4 } from "fs/promises";
|
|
14856
|
-
import { dirname as
|
|
14855
|
+
import { dirname as dirname12, join as join13, relative as relative7 } from "path";
|
|
14857
14856
|
var generateTypes = async (props) => {
|
|
14858
14857
|
const files = [];
|
|
14859
14858
|
await Promise.all(
|
|
@@ -14867,7 +14866,7 @@ var generateTypes = async (props) => {
|
|
|
14867
14866
|
if (include) {
|
|
14868
14867
|
files.push(relative7(directories.root, path));
|
|
14869
14868
|
}
|
|
14870
|
-
await mkdir5(
|
|
14869
|
+
await mkdir5(dirname12(path), { recursive: true });
|
|
14871
14870
|
await writeFile4(path, code);
|
|
14872
14871
|
}
|
|
14873
14872
|
}
|
package/dist/prebuild/rpc/HASH
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
64ad068478a664836f3ede8a0eb6b316fe70df7f
|
|
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,9 +67,10 @@ 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
|
-
chunkFileNames: `[name].${ext}
|
|
72
|
+
chunkFileNames: `[name].${ext}`,
|
|
73
|
+
minify: true
|
|
94
74
|
});
|
|
95
75
|
const hash = createHash("sha1");
|
|
96
76
|
const files = [];
|
|
@@ -142,7 +122,7 @@ var prebuild = async (file, output) => {
|
|
|
142
122
|
};
|
|
143
123
|
|
|
144
124
|
// src/prebuild.ts
|
|
145
|
-
var __dirname =
|
|
125
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
146
126
|
var builds = {
|
|
147
127
|
rpc: "../src/feature/rpc/server/handle.ts"
|
|
148
128
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.373",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@awsless/lambda": "^0.0.26",
|
|
33
33
|
"@awsless/open-search": "^0.0.15",
|
|
34
34
|
"@awsless/redis": "^0.0.13",
|
|
35
|
-
"@awsless/s3": "^0.0.18",
|
|
36
|
-
"@awsless/validate": "^0.0.15",
|
|
37
|
-
"@awsless/sns": "^0.0.7",
|
|
38
35
|
"@awsless/mqtt": "^0.0.2",
|
|
36
|
+
"@awsless/sns": "^0.0.7",
|
|
39
37
|
"@awsless/sqs": "^0.0.7",
|
|
38
|
+
"@awsless/s3": "^0.0.18",
|
|
40
39
|
"@awsless/ssm": "^0.0.7",
|
|
41
|
-
"@awsless/weak-cache": "^0.0.1"
|
|
40
|
+
"@awsless/weak-cache": "^0.0.1",
|
|
41
|
+
"@awsless/validate": "^0.0.15"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -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",
|
|
@@ -110,12 +111,12 @@
|
|
|
110
111
|
"zod": "^3.21.4",
|
|
111
112
|
"zod-to-json-schema": "^3.22.3",
|
|
112
113
|
"@awsless/code": "^0.0.10",
|
|
113
|
-
"@awsless/formation": "^0.0.56",
|
|
114
114
|
"@awsless/duration": "^0.0.1",
|
|
115
|
-
"@awsless/
|
|
116
|
-
"@awsless/
|
|
115
|
+
"@awsless/graphql": "^0.0.9",
|
|
116
|
+
"@awsless/formation": "^0.0.56",
|
|
117
117
|
"@awsless/validate": "^0.0.15",
|
|
118
|
-
"@awsless/
|
|
118
|
+
"@awsless/size": "^0.0.1",
|
|
119
|
+
"@awsless/ts-file-cache": "^0.0.10"
|
|
119
120
|
},
|
|
120
121
|
"scripts": {
|
|
121
122
|
"test": "pnpm code test",
|