@awsless/cli 0.1.38 → 0.1.39
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 +170 -78
- package/package.json +15 -15
package/dist/bin.js
CHANGED
|
@@ -166974,6 +166974,10 @@ var LuaRuntime = class LuaRuntime2 {
|
|
|
166974
166974
|
return this.raiseError("ERR First argument must be a number (log level).");
|
|
166975
166975
|
return 0;
|
|
166976
166976
|
});
|
|
166977
|
+
register("replicate_commands", (L3) => {
|
|
166978
|
+
import_fengari.lua.lua_pushboolean(L3, 1);
|
|
166979
|
+
return 1;
|
|
166980
|
+
});
|
|
166977
166981
|
register("setresp", (L3) => {
|
|
166978
166982
|
if (import_fengari.lua.lua_tonumber(L3, 1) === 2)
|
|
166979
166983
|
return 0;
|
|
@@ -168045,8 +168049,32 @@ var persist = async () => {
|
|
|
168045
168049
|
await mkdir5(dirname6(file3), { recursive: true });
|
|
168046
168050
|
await writeFile7(file3, JSON.stringify([...tracked.values()]));
|
|
168047
168051
|
};
|
|
168052
|
+
var proxyEnvNames = [
|
|
168053
|
+
"NODE_EXTRA_CA_CERTS",
|
|
168054
|
+
"SSL_CERT_FILE",
|
|
168055
|
+
"SSL_CERT_DIR",
|
|
168056
|
+
"HTTP_PROXY",
|
|
168057
|
+
"HTTPS_PROXY",
|
|
168058
|
+
"NO_PROXY",
|
|
168059
|
+
"http_proxy",
|
|
168060
|
+
"https_proxy",
|
|
168061
|
+
"no_proxy"
|
|
168062
|
+
];
|
|
168063
|
+
var proxyEnv = () => {
|
|
168064
|
+
const env2 = {};
|
|
168065
|
+
for (const name of proxyEnvNames) {
|
|
168066
|
+
const value = process.env[name];
|
|
168067
|
+
if (value) {
|
|
168068
|
+
env2[name] = value;
|
|
168069
|
+
}
|
|
168070
|
+
}
|
|
168071
|
+
return env2;
|
|
168072
|
+
};
|
|
168048
168073
|
var spawnDevChild = (command, args, options2 = {}) => {
|
|
168049
|
-
const child = spawn3(command, args,
|
|
168074
|
+
const child = spawn3(command, args, {
|
|
168075
|
+
...options2,
|
|
168076
|
+
env: options2.env ? { ...proxyEnv(), ...options2.env } : options2.env
|
|
168077
|
+
});
|
|
168050
168078
|
if (child.pid) {
|
|
168051
168079
|
tracked.set(child.pid, { pid: child.pid, command: [command, ...args].join(" ") });
|
|
168052
168080
|
persist().catch(() => {});
|
|
@@ -199957,8 +199985,78 @@ var deployments = (program3) => {
|
|
|
199957
199985
|
};
|
|
199958
199986
|
|
|
199959
199987
|
// src/config/load/watch.ts
|
|
199988
|
+
import { basename as basename4, sep as sep4 } from "path";
|
|
199989
|
+
|
|
199990
|
+
// src/dev/watch-tree.ts
|
|
199960
199991
|
import { watch } from "fs";
|
|
199961
|
-
import {
|
|
199992
|
+
import { readdir as readdir5, stat as stat6 } from "fs/promises";
|
|
199993
|
+
import { join as join45, relative as relative11, sep as sep3 } from "path";
|
|
199994
|
+
var watchTree = async (root4, ignored, listener, options2 = {}) => {
|
|
199995
|
+
const native = options2.native ?? (process.platform === "darwin" || process.platform === "win32");
|
|
199996
|
+
if (native) {
|
|
199997
|
+
const watcher = watch(root4, { recursive: true }, (_event, filename) => {
|
|
199998
|
+
if (filename) {
|
|
199999
|
+
listener(filename);
|
|
200000
|
+
}
|
|
200001
|
+
});
|
|
200002
|
+
return { close: () => watcher.close() };
|
|
200003
|
+
}
|
|
200004
|
+
const watchers = new Map;
|
|
200005
|
+
let closed = false;
|
|
200006
|
+
const add = async (dir) => {
|
|
200007
|
+
if (closed || watchers.has(dir)) {
|
|
200008
|
+
return;
|
|
200009
|
+
}
|
|
200010
|
+
let watcher;
|
|
200011
|
+
try {
|
|
200012
|
+
watcher = watch(dir, (event, filename) => {
|
|
200013
|
+
if (!filename) {
|
|
200014
|
+
return;
|
|
200015
|
+
}
|
|
200016
|
+
const path6 = join45(dir, filename);
|
|
200017
|
+
const name = relative11(root4, path6);
|
|
200018
|
+
if (name.split(sep3).some((segment) => ignored.has(segment))) {
|
|
200019
|
+
return;
|
|
200020
|
+
}
|
|
200021
|
+
listener(name);
|
|
200022
|
+
if (event === "rename" && !ignored.has(filename)) {
|
|
200023
|
+
stat6(path6).then((info3) => info3.isDirectory() ? walk2(path6) : undefined).catch(() => {});
|
|
200024
|
+
}
|
|
200025
|
+
});
|
|
200026
|
+
} catch (error53) {
|
|
200027
|
+
debug(`Can't watch ${dir}`, error53);
|
|
200028
|
+
return;
|
|
200029
|
+
}
|
|
200030
|
+
watcher.on("error", (error53) => debug(`Watcher error in ${dir}`, error53));
|
|
200031
|
+
watchers.set(dir, watcher);
|
|
200032
|
+
};
|
|
200033
|
+
const walk2 = async (dir) => {
|
|
200034
|
+
await add(dir);
|
|
200035
|
+
let entries2;
|
|
200036
|
+
try {
|
|
200037
|
+
entries2 = await readdir5(dir, { withFileTypes: true });
|
|
200038
|
+
} catch {
|
|
200039
|
+
return;
|
|
200040
|
+
}
|
|
200041
|
+
for (const entry of entries2) {
|
|
200042
|
+
if (entry.isDirectory() && !entry.isSymbolicLink() && !ignored.has(entry.name)) {
|
|
200043
|
+
await walk2(join45(dir, entry.name));
|
|
200044
|
+
}
|
|
200045
|
+
}
|
|
200046
|
+
};
|
|
200047
|
+
await walk2(root4);
|
|
200048
|
+
return {
|
|
200049
|
+
close: () => {
|
|
200050
|
+
closed = true;
|
|
200051
|
+
for (const watcher of watchers.values()) {
|
|
200052
|
+
watcher.close();
|
|
200053
|
+
}
|
|
200054
|
+
watchers.clear();
|
|
200055
|
+
}
|
|
200056
|
+
};
|
|
200057
|
+
};
|
|
200058
|
+
|
|
200059
|
+
// src/config/load/watch.ts
|
|
199962
200060
|
var ignoredDirectories = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
199963
200061
|
var isConfigFile = (path6) => {
|
|
199964
200062
|
const base = basename4(path6);
|
|
@@ -199968,11 +200066,8 @@ var watchConfig = async (options2, resolve5, reject) => {
|
|
|
199968
200066
|
await loadAppConfig(options2);
|
|
199969
200067
|
debug("Start watching...");
|
|
199970
200068
|
let reloadTimer;
|
|
199971
|
-
const watcher =
|
|
199972
|
-
if (
|
|
199973
|
-
return;
|
|
199974
|
-
}
|
|
199975
|
-
if (filename.split(sep3).some((segment) => ignoredDirectories.has(segment))) {
|
|
200069
|
+
const watcher = await watchTree(directories.root, ignoredDirectories, (filename) => {
|
|
200070
|
+
if (filename.split(sep4).some((segment) => ignoredDirectories.has(segment))) {
|
|
199976
200071
|
return;
|
|
199977
200072
|
}
|
|
199978
200073
|
if (!isConfigFile(filename)) {
|
|
@@ -199996,18 +200091,18 @@ var watchConfig = async (options2, resolve5, reject) => {
|
|
|
199996
200091
|
// src/dev/index.ts
|
|
199997
200092
|
import { watch as watch2 } from "fs";
|
|
199998
200093
|
import { mkdir as mkdir12, rm as rm13, writeFile as writeFile16 } from "fs/promises";
|
|
199999
|
-
import { basename as basename5, dirname as dirname26, join as
|
|
200094
|
+
import { basename as basename5, dirname as dirname26, join as join52, sep as sep7 } from "path";
|
|
200000
200095
|
import { loadWorkspace as loadWorkspace3 } from "@awsless/ts-file-cache";
|
|
200001
200096
|
|
|
200002
200097
|
// src/dev/context.ts
|
|
200003
|
-
import { join as
|
|
200098
|
+
import { join as join47 } from "path";
|
|
200004
200099
|
import { DynamoDBServer } from "@awsless/dynamodb-server";
|
|
200005
200100
|
|
|
200006
200101
|
// src/dev/servers/s3.ts
|
|
200007
200102
|
import { createHash as createHash21 } from "crypto";
|
|
200008
|
-
import { mkdir as mkdir10, readdir as
|
|
200103
|
+
import { mkdir as mkdir10, readdir as readdir6, readFile as readFile19, rm as rm11, stat as stat7, writeFile as writeFile13 } from "fs/promises";
|
|
200009
200104
|
import { createServer as createServer9 } from "http";
|
|
200010
|
-
import { dirname as dirname24, isAbsolute as isAbsolute6, join as
|
|
200105
|
+
import { dirname as dirname24, isAbsolute as isAbsolute6, join as join46, relative as relative12, sep as sep5 } from "path";
|
|
200011
200106
|
var escapeXml = (value) => {
|
|
200012
200107
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
200013
200108
|
};
|
|
@@ -200072,10 +200167,10 @@ var createS3Server = (props) => {
|
|
|
200072
200167
|
res.end(xmlError("InvalidRequest", "Missing bucket name"));
|
|
200073
200168
|
return;
|
|
200074
200169
|
}
|
|
200075
|
-
const bucketDir =
|
|
200076
|
-
const file3 =
|
|
200170
|
+
const bucketDir = join46(props.root, bucket);
|
|
200171
|
+
const file3 = join46(bucketDir, ...keyParts);
|
|
200077
200172
|
const escapes = (base, path6) => {
|
|
200078
|
-
const rel =
|
|
200173
|
+
const rel = relative12(base, path6);
|
|
200079
200174
|
return rel.startsWith("..") || isAbsolute6(rel);
|
|
200080
200175
|
};
|
|
200081
200176
|
if (escapes(props.root, bucketDir) || escapes(bucketDir, file3)) {
|
|
@@ -200089,20 +200184,20 @@ var createS3Server = (props) => {
|
|
|
200089
200184
|
const walk2 = async (dir) => {
|
|
200090
200185
|
let entries2;
|
|
200091
200186
|
try {
|
|
200092
|
-
entries2 = await
|
|
200187
|
+
entries2 = await readdir6(dir, { withFileTypes: true });
|
|
200093
200188
|
} catch {
|
|
200094
200189
|
return;
|
|
200095
200190
|
}
|
|
200096
200191
|
for (const entry of entries2) {
|
|
200097
|
-
const path6 =
|
|
200192
|
+
const path6 = join46(dir, entry.name);
|
|
200098
200193
|
if (entry.isDirectory()) {
|
|
200099
200194
|
await walk2(path6);
|
|
200100
200195
|
} else {
|
|
200101
|
-
const objectKey =
|
|
200196
|
+
const objectKey = relative12(bucketDir, path6).split(sep5).join("/");
|
|
200102
200197
|
if (!objectKey.startsWith(prefix)) {
|
|
200103
200198
|
continue;
|
|
200104
200199
|
}
|
|
200105
|
-
const info3 = await
|
|
200200
|
+
const info3 = await stat7(path6);
|
|
200106
200201
|
contents.push(`<Contents><Key>${escapeXml(objectKey)}</Key><Size>${info3.size}</Size><LastModified>${info3.mtime.toISOString()}</LastModified><ETag>"local"</ETag></Contents>`);
|
|
200107
200202
|
}
|
|
200108
200203
|
}
|
|
@@ -200568,7 +200663,7 @@ var createDevContext = (props) => {
|
|
|
200568
200663
|
const value = await props.pool.keep("store", null, async () => {
|
|
200569
200664
|
const rules = [];
|
|
200570
200665
|
const server = createS3Server({
|
|
200571
|
-
root:
|
|
200666
|
+
root: join47(directories.output, "local", "store"),
|
|
200572
200667
|
region: props.appConfig.region,
|
|
200573
200668
|
rules
|
|
200574
200669
|
});
|
|
@@ -200696,16 +200791,16 @@ var createDevContext = (props) => {
|
|
|
200696
200791
|
// src/dev/dashboard/index.ts
|
|
200697
200792
|
var import_ioredis4 = __toESM(require_built3(), 1);
|
|
200698
200793
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
200699
|
-
import { readdir as
|
|
200794
|
+
import { readdir as readdir7, readFile as readFile20, stat as stat8, writeFile as writeFile15 } from "fs/promises";
|
|
200700
200795
|
import { createServer as createServer11 } from "http";
|
|
200701
|
-
import { join as
|
|
200796
|
+
import { join as join49, relative as relative13, sep as sep6 } from "path";
|
|
200702
200797
|
import { DynamoDBClient as DynamoDBClient6 } from "@aws-sdk/client-dynamodb";
|
|
200703
200798
|
import { DynamoDBDocumentClient, ScanCommand as ScanCommand2 } from "@aws-sdk/lib-dynamodb";
|
|
200704
200799
|
|
|
200705
200800
|
// src/dev/worker.ts
|
|
200706
200801
|
import { writeFile as writeFile14 } from "fs/promises";
|
|
200707
200802
|
import { availableParallelism as availableParallelism2 } from "os";
|
|
200708
|
-
import { join as
|
|
200803
|
+
import { join as join48 } from "path";
|
|
200709
200804
|
class WorkerError extends Error {
|
|
200710
200805
|
name;
|
|
200711
200806
|
constructor(name, message3, stack) {
|
|
@@ -200925,7 +201020,7 @@ var createBundleWorker = (props) => {
|
|
|
200925
201020
|
throw new Error("The bundle worker never became ready.");
|
|
200926
201021
|
};
|
|
200927
201022
|
const startWorker = async () => {
|
|
200928
|
-
const entry =
|
|
201023
|
+
const entry = join48(props.buildDir, "worker.mjs");
|
|
200929
201024
|
const port = await findFreePort();
|
|
200930
201025
|
const child = spawnDevChild("node", ["--enable-source-maps", entry], {
|
|
200931
201026
|
cwd: props.buildDir,
|
|
@@ -200986,7 +201081,7 @@ var createBundleWorker = (props) => {
|
|
|
200986
201081
|
return worker;
|
|
200987
201082
|
};
|
|
200988
201083
|
const doStart = async () => {
|
|
200989
|
-
await writeFile14(
|
|
201084
|
+
await writeFile14(join48(props.buildDir, "worker.mjs"), WORKER_ENTRY);
|
|
200990
201085
|
const results = await Promise.allSettled(Array.from({ length: concurrency }, () => startWorker()));
|
|
200991
201086
|
const started = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
200992
201087
|
const failed = results.find((result) => result.status === "rejected");
|
|
@@ -203434,18 +203529,18 @@ var createDashboardServer = (props) => {
|
|
|
203434
203529
|
const walk2 = async (dir) => {
|
|
203435
203530
|
let entries2;
|
|
203436
203531
|
try {
|
|
203437
|
-
entries2 = await
|
|
203532
|
+
entries2 = await readdir7(dir, { withFileTypes: true });
|
|
203438
203533
|
} catch {
|
|
203439
203534
|
return;
|
|
203440
203535
|
}
|
|
203441
203536
|
for (const entry of entries2) {
|
|
203442
|
-
const path6 =
|
|
203537
|
+
const path6 = join49(dir, entry.name);
|
|
203443
203538
|
if (entry.isDirectory()) {
|
|
203444
203539
|
await walk2(path6);
|
|
203445
203540
|
} else {
|
|
203446
|
-
const key =
|
|
203541
|
+
const key = relative13(props.storeRoot, path6).split(sep6).slice(1).join("/");
|
|
203447
203542
|
if (key.startsWith(prefix)) {
|
|
203448
|
-
const info3 = await
|
|
203543
|
+
const info3 = await stat8(path6);
|
|
203449
203544
|
files.push({ key, size: info3.size, modified: info3.mtime.toISOString() });
|
|
203450
203545
|
}
|
|
203451
203546
|
}
|
|
@@ -203654,17 +203749,17 @@ var createFailureReporter = (props) => {
|
|
|
203654
203749
|
};
|
|
203655
203750
|
|
|
203656
203751
|
// src/dev/sdk.ts
|
|
203657
|
-
import { readdir as
|
|
203752
|
+
import { readdir as readdir8, readFile as readFile21, mkdir as mkdir11, rm as rm12, stat as stat9, symlink } from "fs/promises";
|
|
203658
203753
|
import { createRequire } from "module";
|
|
203659
|
-
import { dirname as dirname25, join as
|
|
203754
|
+
import { dirname as dirname25, join as join50 } from "path";
|
|
203660
203755
|
var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
203661
|
-
const filesDir =
|
|
203756
|
+
const filesDir = join50(buildDir, "files");
|
|
203662
203757
|
const packages = new Set;
|
|
203663
|
-
for (const file3 of await
|
|
203758
|
+
for (const file3 of await readdir8(filesDir)) {
|
|
203664
203759
|
if (!file3.endsWith(".mjs")) {
|
|
203665
203760
|
continue;
|
|
203666
203761
|
}
|
|
203667
|
-
const code = await readFile21(
|
|
203762
|
+
const code = await readFile21(join50(filesDir, file3), "utf8");
|
|
203668
203763
|
for (const match3 of code.matchAll(/(?:from\s*|import\()\s*["'](@aws-sdk\/[a-z0-9-]+|sharp)["']/g)) {
|
|
203669
203764
|
packages.add(match3[1]);
|
|
203670
203765
|
}
|
|
@@ -203672,7 +203767,7 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203672
203767
|
const ownRequire = createRequire(import.meta.url);
|
|
203673
203768
|
const isProjectDep = async (name) => {
|
|
203674
203769
|
try {
|
|
203675
|
-
await
|
|
203770
|
+
await stat9(join50(directories.root, "node_modules", name, "package.json"));
|
|
203676
203771
|
return true;
|
|
203677
203772
|
} catch {
|
|
203678
203773
|
return false;
|
|
@@ -203681,19 +203776,19 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203681
203776
|
const resolveFromDependents = async (name) => {
|
|
203682
203777
|
const roots = Object.values(workspace.packages).flatMap((pkg) => [
|
|
203683
203778
|
pkg.path,
|
|
203684
|
-
...Object.entries(pkg.dependencies).map(([dependency, info3]) => info3.type === "workspace" ? workspace.packages[info3.link]?.path :
|
|
203779
|
+
...Object.entries(pkg.dependencies).map(([dependency, info3]) => info3.type === "workspace" ? workspace.packages[info3.link]?.path : join50(pkg.path, "node_modules", dependency))
|
|
203685
203780
|
]);
|
|
203686
203781
|
for (const root4 of roots.filter((root5) => typeof root5 === "string").toSorted()) {
|
|
203687
|
-
const path6 =
|
|
203782
|
+
const path6 = join50(root4, "node_modules", name);
|
|
203688
203783
|
try {
|
|
203689
|
-
await
|
|
203784
|
+
await stat9(join50(path6, "package.json"));
|
|
203690
203785
|
return path6;
|
|
203691
203786
|
} catch {}
|
|
203692
203787
|
}
|
|
203693
203788
|
return;
|
|
203694
203789
|
};
|
|
203695
203790
|
for (const name of packages) {
|
|
203696
|
-
const target2 =
|
|
203791
|
+
const target2 = join50(buildDir, "node_modules", name);
|
|
203697
203792
|
try {
|
|
203698
203793
|
if (await isProjectDep(name)) {
|
|
203699
203794
|
await rm12(target2, { recursive: true, force: true });
|
|
@@ -203712,7 +203807,7 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203712
203807
|
await mkdir11(dirname25(target2), { recursive: true });
|
|
203713
203808
|
await rm12(target2, { recursive: true, force: true });
|
|
203714
203809
|
await symlink(source, target2, "dir");
|
|
203715
|
-
await
|
|
203810
|
+
await stat9(join50(target2, "package.json"));
|
|
203716
203811
|
debug(`Sdk link ${name}: ${source}`);
|
|
203717
203812
|
} catch (error53) {
|
|
203718
203813
|
onWarn?.(`Linking the "${name}" sdk package failed: ${error53 instanceof Error ? error53.message : String(error53)}`);
|
|
@@ -203722,9 +203817,9 @@ var linkSdkPackages = async (workspace, buildDir, onWarn) => {
|
|
|
203722
203817
|
|
|
203723
203818
|
// src/dev/seed.ts
|
|
203724
203819
|
import { spawn as spawn5 } from "child_process";
|
|
203725
|
-
import { isAbsolute as isAbsolute7, join as
|
|
203820
|
+
import { isAbsolute as isAbsolute7, join as join51 } from "path";
|
|
203726
203821
|
var createSeedRunner = (props) => {
|
|
203727
|
-
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed :
|
|
203822
|
+
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed : join51(directories.root, props.seed));
|
|
203728
203823
|
let running;
|
|
203729
203824
|
const run = () => {
|
|
203730
203825
|
running ??= (async () => {
|
|
@@ -203900,7 +203995,7 @@ var startDev = async (props) => {
|
|
|
203900
203995
|
dev: true
|
|
203901
203996
|
});
|
|
203902
203997
|
ready2();
|
|
203903
|
-
await mkdir12(
|
|
203998
|
+
await mkdir12(join52(directories.output, "local"), { recursive: true });
|
|
203904
203999
|
await writeFile16(watchdogPath(), WATCHDOG_SOURCE);
|
|
203905
204000
|
const routerPorts = {};
|
|
203906
204001
|
Object.keys(appConfig.router ?? {}).forEach((id, index) => {
|
|
@@ -203978,7 +204073,7 @@ var startDev = async (props) => {
|
|
|
203978
204073
|
for (const [id, port] of Object.entries(routerPorts)) {
|
|
203979
204074
|
env4[`ROUTER_${constantCase(id)}_ENDPOINT`] = `localhost:${port}`;
|
|
203980
204075
|
}
|
|
203981
|
-
await writeFile16(
|
|
204076
|
+
await writeFile16(join52(directories.output, "local", "env.json"), JSON.stringify(env4, null, "\t") + `
|
|
203982
204077
|
`);
|
|
203983
204078
|
return { env: env4, lambda: lambda2 };
|
|
203984
204079
|
});
|
|
@@ -204232,8 +204327,8 @@ var startDev = async (props) => {
|
|
|
204232
204327
|
resources: dev.resources,
|
|
204233
204328
|
routes: dev.routes,
|
|
204234
204329
|
env: env3,
|
|
204235
|
-
storeRoot:
|
|
204236
|
-
configFile:
|
|
204330
|
+
storeRoot: join52(directories.output, "local", "store"),
|
|
204331
|
+
configFile: join52(directories.output, "local", "config.json"),
|
|
204237
204332
|
getEmails: () => props.pool.peek("shim:ses-email")?.server.list() ?? [],
|
|
204238
204333
|
getAlerts: () => props.pool.peek("shim:sns")?.alerts ?? [],
|
|
204239
204334
|
getSession: () => ({ startedAt, workers: worker.size() }),
|
|
@@ -204249,11 +204344,8 @@ var startDev = async (props) => {
|
|
|
204249
204344
|
await dashboard.listen(dashboardPort);
|
|
204250
204345
|
const ignoredDirectories2 = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
204251
204346
|
let rebuildTimer;
|
|
204252
|
-
const watcher =
|
|
204253
|
-
if (
|
|
204254
|
-
return;
|
|
204255
|
-
}
|
|
204256
|
-
if (filename.split(sep6).some((segment) => ignoredDirectories2.has(segment))) {
|
|
204347
|
+
const watcher = await watchTree(directories.root, ignoredDirectories2, (filename) => {
|
|
204348
|
+
if (filename.split(sep7).some((segment) => ignoredDirectories2.has(segment))) {
|
|
204257
204349
|
return;
|
|
204258
204350
|
}
|
|
204259
204351
|
const base = basename5(filename);
|
|
@@ -204296,7 +204388,7 @@ var startDev = async (props) => {
|
|
|
204296
204388
|
routerPorts,
|
|
204297
204389
|
async stop() {
|
|
204298
204390
|
stopping = true;
|
|
204299
|
-
await rm13(
|
|
204391
|
+
await rm13(join52(directories.output, "local", "env.json"), { force: true });
|
|
204300
204392
|
clearTimeout(rebuildTimer);
|
|
204301
204393
|
watcher.close();
|
|
204302
204394
|
for (const restartWatcher of restartWatchers) {
|
|
@@ -204364,7 +204456,7 @@ var createServerPool = () => {
|
|
|
204364
204456
|
|
|
204365
204457
|
// src/type-gen/generate.ts
|
|
204366
204458
|
import { mkdir as mkdir13, writeFile as writeFile17 } from "fs/promises";
|
|
204367
|
-
import { dirname as dirname27, join as
|
|
204459
|
+
import { dirname as dirname27, join as join53, relative as relative14 } from "path";
|
|
204368
204460
|
var generateTypes = async (props) => {
|
|
204369
204461
|
const files = [];
|
|
204370
204462
|
await Promise.all(features.map(async (feature) => {
|
|
@@ -204372,10 +204464,10 @@ var generateTypes = async (props) => {
|
|
|
204372
204464
|
...props,
|
|
204373
204465
|
async write(file3, data, include = false) {
|
|
204374
204466
|
const code = data?.toString("utf8");
|
|
204375
|
-
const path6 =
|
|
204467
|
+
const path6 = join53(directories.types, file3);
|
|
204376
204468
|
if (code) {
|
|
204377
204469
|
if (include) {
|
|
204378
|
-
files.push(
|
|
204470
|
+
files.push(relative14(directories.root, path6));
|
|
204379
204471
|
}
|
|
204380
204472
|
await mkdir13(dirname27(path6), { recursive: true });
|
|
204381
204473
|
await writeFile17(path6, code);
|
|
@@ -204386,7 +204478,7 @@ var generateTypes = async (props) => {
|
|
|
204386
204478
|
if (files.length) {
|
|
204387
204479
|
const code = files.map((file3) => `/// <reference path='${file3}' />`).join(`
|
|
204388
204480
|
`);
|
|
204389
|
-
await writeFile17(
|
|
204481
|
+
await writeFile17(join53(directories.root, `awsless.d.ts`), code);
|
|
204390
204482
|
}
|
|
204391
204483
|
};
|
|
204392
204484
|
|
|
@@ -206782,7 +206874,7 @@ var sinon;
|
|
|
206782
206874
|
const arraySlice = arrayProto.slice;
|
|
206783
206875
|
const concat = arrayProto.concat;
|
|
206784
206876
|
const forEach = arrayProto.forEach;
|
|
206785
|
-
const
|
|
206877
|
+
const join54 = arrayProto.join;
|
|
206786
206878
|
const splice = arrayProto.splice;
|
|
206787
206879
|
function applyDefaults(obj, defaults2) {
|
|
206788
206880
|
for (const key of Object.keys(defaults2)) {
|
|
@@ -206818,7 +206910,7 @@ var sinon;
|
|
|
206818
206910
|
let actual = "";
|
|
206819
206911
|
if (!calledInOrder(arguments)) {
|
|
206820
206912
|
try {
|
|
206821
|
-
expected =
|
|
206913
|
+
expected = join54(arguments, ", ");
|
|
206822
206914
|
const calls = arraySlice(arguments);
|
|
206823
206915
|
let i5 = calls.length;
|
|
206824
206916
|
while (i5) {
|
|
@@ -206826,7 +206918,7 @@ var sinon;
|
|
|
206826
206918
|
splice(calls, i5, 1);
|
|
206827
206919
|
}
|
|
206828
206920
|
}
|
|
206829
|
-
actual =
|
|
206921
|
+
actual = join54(orderByFirstCall(calls), ", ");
|
|
206830
206922
|
} catch (e5) {}
|
|
206831
206923
|
failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
|
|
206832
206924
|
} else {
|
|
@@ -206871,7 +206963,7 @@ var sinon;
|
|
|
206871
206963
|
` expected = ${inspect2(expectation)}`,
|
|
206872
206964
|
` actual = ${inspect2(actual)}`
|
|
206873
206965
|
];
|
|
206874
|
-
failAssertion(this,
|
|
206966
|
+
failAssertion(this, join54(formatted, `
|
|
206875
206967
|
`));
|
|
206876
206968
|
}
|
|
206877
206969
|
}
|
|
@@ -206976,7 +207068,7 @@ var sinon;
|
|
|
206976
207068
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
206977
207069
|
const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
|
|
206978
207070
|
const concat = arrayProto.concat;
|
|
206979
|
-
const
|
|
207071
|
+
const join54 = arrayProto.join;
|
|
206980
207072
|
const reverse = arrayProto.reverse;
|
|
206981
207073
|
const slice = arrayProto.slice;
|
|
206982
207074
|
const useLeftMostCallback = -1;
|
|
@@ -207013,7 +207105,7 @@ var sinon;
|
|
|
207013
207105
|
msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
|
|
207014
207106
|
}
|
|
207015
207107
|
if (args.length > 0) {
|
|
207016
|
-
msg += ` Received [${
|
|
207108
|
+
msg += ` Received [${join54(args, ", ")}]`;
|
|
207017
207109
|
}
|
|
207018
207110
|
return msg;
|
|
207019
207111
|
}
|
|
@@ -207823,7 +207915,7 @@ var sinon;
|
|
|
207823
207915
|
const filter2 = arrayProto.filter;
|
|
207824
207916
|
const forEach = arrayProto.forEach;
|
|
207825
207917
|
const every = arrayProto.every;
|
|
207826
|
-
const
|
|
207918
|
+
const join54 = arrayProto.join;
|
|
207827
207919
|
const push2 = arrayProto.push;
|
|
207828
207920
|
const slice = arrayProto.slice;
|
|
207829
207921
|
const unshift = arrayProto.unshift;
|
|
@@ -207900,10 +207992,10 @@ var sinon;
|
|
|
207900
207992
|
});
|
|
207901
207993
|
this.restore();
|
|
207902
207994
|
if (messages.length > 0) {
|
|
207903
|
-
mockExpectation.fail(
|
|
207995
|
+
mockExpectation.fail(join54(concat(messages, met), `
|
|
207904
207996
|
`));
|
|
207905
207997
|
} else if (met.length > 0) {
|
|
207906
|
-
mockExpectation.pass(
|
|
207998
|
+
mockExpectation.pass(join54(concat(messages, met), `
|
|
207907
207999
|
`));
|
|
207908
208000
|
}
|
|
207909
208001
|
return true;
|
|
@@ -207956,7 +208048,7 @@ var sinon;
|
|
|
207956
208048
|
args,
|
|
207957
208049
|
stack: err.stack
|
|
207958
208050
|
})}`);
|
|
207959
|
-
mockExpectation.fail(
|
|
208051
|
+
mockExpectation.fail(join54(messages, `
|
|
207960
208052
|
`));
|
|
207961
208053
|
}
|
|
207962
208054
|
});
|
|
@@ -208063,14 +208155,14 @@ var sinon;
|
|
|
208063
208155
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
208064
208156
|
const concat = arrayProto.concat;
|
|
208065
208157
|
const filter2 = arrayProto.filter;
|
|
208066
|
-
const
|
|
208158
|
+
const join54 = arrayProto.join;
|
|
208067
208159
|
const map3 = arrayProto.map;
|
|
208068
208160
|
const reduce2 = arrayProto.reduce;
|
|
208069
208161
|
const slice = arrayProto.slice;
|
|
208070
208162
|
function throwYieldError(proxy, text2, args) {
|
|
208071
208163
|
let msg = functionName(proxy) + text2;
|
|
208072
208164
|
if (args.length) {
|
|
208073
|
-
msg += ` Received [${
|
|
208165
|
+
msg += ` Received [${join54(slice(args), ", ")}]`;
|
|
208074
208166
|
}
|
|
208075
208167
|
throw new Error(msg);
|
|
208076
208168
|
}
|
|
@@ -208192,7 +208284,7 @@ var sinon;
|
|
|
208192
208284
|
const formattedArgs = map3(this.args, function(arg) {
|
|
208193
208285
|
return inspect2(arg);
|
|
208194
208286
|
});
|
|
208195
|
-
callStr = `${callStr +
|
|
208287
|
+
callStr = `${callStr + join54(formattedArgs, ", ")})`;
|
|
208196
208288
|
if (typeof this.returnValue !== "undefined") {
|
|
208197
208289
|
callStr += ` => ${inspect2(this.returnValue)}`;
|
|
208198
208290
|
}
|
|
@@ -208923,7 +209015,7 @@ var sinon;
|
|
|
208923
209015
|
const timesInWords = require2("./util/core/times-in-words");
|
|
208924
209016
|
const inspect2 = require2("util").inspect;
|
|
208925
209017
|
const jsDiff = require2("diff");
|
|
208926
|
-
const
|
|
209018
|
+
const join54 = arrayProto.join;
|
|
208927
209019
|
const map3 = arrayProto.map;
|
|
208928
209020
|
const push2 = arrayProto.push;
|
|
208929
209021
|
const slice = arrayProto.slice;
|
|
@@ -208951,7 +209043,7 @@ var sinon;
|
|
|
208951
209043
|
}
|
|
208952
209044
|
return text2;
|
|
208953
209045
|
});
|
|
208954
|
-
return
|
|
209046
|
+
return join54(objects, "");
|
|
208955
209047
|
}
|
|
208956
209048
|
function quoteStringValue(value) {
|
|
208957
209049
|
if (typeof value === "string") {
|
|
@@ -209009,7 +209101,7 @@ ${stringifiedCall}`;
|
|
|
209009
209101
|
push2(calls, stringifiedCall);
|
|
209010
209102
|
}
|
|
209011
209103
|
return calls.length > 0 ? `
|
|
209012
|
-
${
|
|
209104
|
+
${join54(calls, `
|
|
209013
209105
|
`)}` : "";
|
|
209014
209106
|
},
|
|
209015
209107
|
t: function(spyInstance) {
|
|
@@ -209017,10 +209109,10 @@ ${join53(calls, `
|
|
|
209017
209109
|
for (let i5 = 0, l4 = spyInstance.callCount;i5 < l4; ++i5) {
|
|
209018
209110
|
push2(objects, inspect2(spyInstance.thisValues[i5]));
|
|
209019
209111
|
}
|
|
209020
|
-
return
|
|
209112
|
+
return join54(objects, ", ");
|
|
209021
209113
|
},
|
|
209022
209114
|
"*": function(spyInstance, args) {
|
|
209023
|
-
return
|
|
209115
|
+
return join54(map3(args, function(arg) {
|
|
209024
209116
|
return inspect2(arg);
|
|
209025
209117
|
}), ", ");
|
|
209026
209118
|
}
|
|
@@ -209352,7 +209444,7 @@ ${join53(calls, `
|
|
|
209352
209444
|
}, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
|
|
209353
209445
|
const arrayProto = require2("@sinonjs/commons").prototypes.array;
|
|
209354
209446
|
const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
|
|
209355
|
-
const
|
|
209447
|
+
const join54 = arrayProto.join;
|
|
209356
209448
|
const push2 = arrayProto.push;
|
|
209357
209449
|
const hasDontEnumBug = function() {
|
|
209358
209450
|
const obj = {
|
|
@@ -209393,7 +209485,7 @@ ${join53(calls, `
|
|
|
209393
209485
|
push2(result, obj[prop]());
|
|
209394
209486
|
}
|
|
209395
209487
|
}
|
|
209396
|
-
return
|
|
209488
|
+
return join54(result, "") !== "0123456789";
|
|
209397
209489
|
}();
|
|
209398
209490
|
function extendCommon(target2, sources, doCopy) {
|
|
209399
209491
|
let source, i5, prop;
|
|
@@ -211458,7 +211550,7 @@ ${job.error.stack.split(`
|
|
|
211458
211550
|
module.exports = matcherPrototype;
|
|
211459
211551
|
}, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
|
|
211460
211552
|
var functionName = require2("@sinonjs/commons").functionName;
|
|
211461
|
-
var
|
|
211553
|
+
var join54 = require2("@sinonjs/commons").prototypes.array.join;
|
|
211462
211554
|
var map3 = require2("@sinonjs/commons").prototypes.array.map;
|
|
211463
211555
|
var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
|
|
211464
211556
|
var valueToString = require2("@sinonjs/commons").valueToString;
|
|
@@ -211489,7 +211581,7 @@ ${job.error.stack.split(`
|
|
|
211489
211581
|
m4.test = function(actual) {
|
|
211490
211582
|
return matchObject(actual, expectation, match3);
|
|
211491
211583
|
};
|
|
211492
|
-
m4.message = `match(${
|
|
211584
|
+
m4.message = `match(${join54(array3, ", ")})`;
|
|
211493
211585
|
return m4;
|
|
211494
211586
|
},
|
|
211495
211587
|
regexp: function(m4, expectation) {
|
|
@@ -214813,7 +214905,7 @@ ${job.error.stack.split(`
|
|
|
214813
214905
|
tokenize: function tokenize(value) {
|
|
214814
214906
|
return value.split("");
|
|
214815
214907
|
},
|
|
214816
|
-
join: function
|
|
214908
|
+
join: function join54(chars) {
|
|
214817
214909
|
return chars.join("");
|
|
214818
214910
|
}
|
|
214819
214911
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/awsless/awsless/issues"
|
|
6
6
|
},
|
|
@@ -82,27 +82,27 @@
|
|
|
82
82
|
"wildstring": "1.0.9",
|
|
83
83
|
"wrap-ansi": "10.0.1",
|
|
84
84
|
"zod": "4.4.3",
|
|
85
|
-
"@awsless/cloudwatch": "^0.0.2",
|
|
86
85
|
"@awsless/big-float": "^0.1.8",
|
|
87
|
-
"@awsless/duration": "^0.0.4",
|
|
88
86
|
"@awsless/clui": "^0.0.10",
|
|
87
|
+
"@awsless/duration": "^0.0.4",
|
|
89
88
|
"@awsless/dynamodb": "^0.3.28",
|
|
89
|
+
"@awsless/cloudwatch": "^0.0.2",
|
|
90
90
|
"@awsless/dynamodb-server": "^0.1.11",
|
|
91
|
-
"@awsless/iot": "^0.0.6",
|
|
92
|
-
"@awsless/json": "^0.0.12",
|
|
93
91
|
"@awsless/lambda": "^0.0.50",
|
|
94
92
|
"@awsless/open-search": "^0.0.32",
|
|
93
|
+
"@awsless/iot": "^0.0.6",
|
|
94
|
+
"@awsless/json": "^0.0.12",
|
|
95
95
|
"@awsless/open-search-server": "^0.0.1",
|
|
96
|
-
"@awsless/redis": "^0.1.
|
|
96
|
+
"@awsless/redis-server": "^0.1.1",
|
|
97
|
+
"@awsless/redis": "^0.1.16",
|
|
97
98
|
"@awsless/s3": "^0.0.23",
|
|
98
|
-
"@awsless/redis-server": "^0.1.0",
|
|
99
|
-
"@awsless/size": "^0.0.3",
|
|
100
|
-
"@awsless/sns": "^0.0.12",
|
|
101
|
-
"@awsless/ts-file-cache": "^0.0.22",
|
|
102
99
|
"@awsless/sqs": "^0.0.25",
|
|
100
|
+
"@awsless/sns": "^0.0.12",
|
|
103
101
|
"@awsless/validate": "^0.2.1",
|
|
102
|
+
"@awsless/size": "^0.0.3",
|
|
103
|
+
"awsless": "^0.1.11",
|
|
104
104
|
"@awsless/weak-cache": "^0.0.2",
|
|
105
|
-
"awsless": "^0.
|
|
105
|
+
"@awsless/ts-file-cache": "^0.0.22"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@aws-sdk/client-cloudfront-keyvaluestore": "3.1113.0",
|
|
@@ -120,17 +120,17 @@
|
|
|
120
120
|
"@aws-sdk/credential-providers": "3.1113.0",
|
|
121
121
|
"@aws-sdk/lib-dynamodb": "3.1113.0",
|
|
122
122
|
"@opensearch-project/opensearch": "3.6.0",
|
|
123
|
-
"@awsless/big-float": "^0.1.8",
|
|
124
123
|
"@awsless/duration": "^0.0.4",
|
|
124
|
+
"@awsless/dynamodb-server": "^0.1.11",
|
|
125
125
|
"@awsless/dynamodb": "^0.3.28",
|
|
126
126
|
"@awsless/json": "^0.0.12",
|
|
127
127
|
"@awsless/lambda": "^0.0.50",
|
|
128
|
-
"@awsless/
|
|
129
|
-
"@awsless/ts-file-cache": "^0.0.22",
|
|
128
|
+
"@awsless/validate": "^0.2.1",
|
|
130
129
|
"@awsless/weak-cache": "^0.0.2",
|
|
130
|
+
"@awsless/ts-file-cache": "^0.0.22",
|
|
131
131
|
"awsless": "^0.1.11",
|
|
132
132
|
"@awsless/s3": "^0.0.23",
|
|
133
|
-
"@awsless/
|
|
133
|
+
"@awsless/big-float": "^0.1.8"
|
|
134
134
|
},
|
|
135
135
|
"scripts": {
|
|
136
136
|
"test": "bun cli/build-handlers.ts && pnpm vitest run",
|