@awsless/awsless 0.0.127 → 0.0.128

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
@@ -7006,14 +7006,49 @@ var assetBuilder = (app) => {
7006
7006
  }
7007
7007
  const showDetailedView = true;
7008
7008
  const done = term.out.write(loadingDialog("Building stack assets..."));
7009
- const groups = new Signal([""]);
7009
+ const group = new Signal([]);
7010
7010
  if (showDetailedView) {
7011
7011
  term.out.gap();
7012
- term.out.write(groups);
7012
+ term.out.write(group);
7013
7013
  }
7014
7014
  const stackNameSize = Math.max(...stacks.map((stack) => stack.name.length));
7015
7015
  const assetTypeSize = Math.max(...assets.map((asset) => asset.type.length));
7016
7016
  const q = queue2.promise(async ({ stack, asset }) => {
7017
+ if (!asset.build) {
7018
+ return;
7019
+ }
7020
+ const [icon, stop] = createSpinner();
7021
+ const details = new Signal({});
7022
+ const line2 = flexLine(
7023
+ term,
7024
+ [
7025
+ icon,
7026
+ " ",
7027
+ style.label(stack.name),
7028
+ " ".repeat(stackNameSize - stack.name.length),
7029
+ " ",
7030
+ style.placeholder(symbol.pointerSmall),
7031
+ " ",
7032
+ style.warning(asset.type),
7033
+ " ".repeat(assetTypeSize - asset.type.length),
7034
+ " ",
7035
+ style.placeholder(symbol.pointerSmall),
7036
+ " ",
7037
+ style.info(asset.id),
7038
+ " "
7039
+ ],
7040
+ [
7041
+ " ",
7042
+ derive([details], (details2) => {
7043
+ return Object.entries(details2).map(([key, value]) => {
7044
+ return `${style.label(key)} ${value}`;
7045
+ }).join(style.placeholder(" \u2500 "));
7046
+ }),
7047
+ br()
7048
+ ]
7049
+ );
7050
+ group.update((group2) => [...group2, line2]);
7051
+ const timer = createTimer();
7017
7052
  const getFullPath = (file) => {
7018
7053
  return join8(directories.asset, asset.type, app.name, stack.name, asset.id, file);
7019
7054
  };
@@ -7025,94 +7060,57 @@ var assetBuilder = (app) => {
7025
7060
  return void 0;
7026
7061
  }
7027
7062
  };
7028
- return asset.build({
7029
- async write(fingerprint, cb) {
7030
- const prev = await getFingerPrint();
7031
- if (prev === fingerprint && !process.env.NO_CACHE) {
7032
- return;
7033
- }
7034
- try {
7035
- await cb(async (file2, data) => {
7036
- const fullpath = getFullPath(file2);
7037
- const basepath2 = dirname6(fullpath);
7038
- await mkdir2(basepath2, { recursive: true });
7039
- await writeFile2(fullpath, data);
7040
- });
7041
- } catch (error) {
7042
- throw error;
7043
- }
7044
- const file = getFullPath("FINGER_PRINT");
7045
- const basepath = dirname6(file);
7046
- await mkdir2(basepath, { recursive: true });
7047
- await writeFile2(file, fingerprint);
7048
- },
7049
- async read(fingerprint, files) {
7050
- const prev = await getFingerPrint();
7051
- if (prev !== fingerprint) {
7052
- throw new TypeError(`Outdated fingerprint: ${fingerprint}`);
7053
- }
7054
- return Promise.all(
7055
- files.map((file) => {
7056
- return readFile6(getFullPath(file));
7057
- })
7058
- );
7059
- }
7060
- });
7061
- }, 3);
7062
- await Promise.all(
7063
- app.stacks.map(async (stack) => {
7064
- const group = new Signal([]);
7065
- groups.update((groups2) => [...groups2, group]);
7066
- await Promise.all(
7067
- [...stack.assets].map(async (asset) => {
7068
- if (!asset.build) {
7063
+ try {
7064
+ const data = await asset.build({
7065
+ async write(fingerprint, cb) {
7066
+ const prev = await getFingerPrint();
7067
+ if (prev === fingerprint && !process.env.NO_CACHE) {
7069
7068
  return;
7070
7069
  }
7071
- const [icon, stop] = createSpinner();
7072
- const details = new Signal({});
7073
- const line2 = flexLine(
7074
- term,
7075
- [
7076
- icon,
7077
- " ",
7078
- style.label(stack.name),
7079
- " ".repeat(stackNameSize - stack.name.length),
7080
- " ",
7081
- style.placeholder(symbol.pointerSmall),
7082
- " ",
7083
- style.warning(asset.type),
7084
- " ".repeat(assetTypeSize - asset.type.length),
7085
- " ",
7086
- style.placeholder(symbol.pointerSmall),
7087
- " ",
7088
- style.info(asset.id),
7089
- " "
7090
- ],
7091
- [
7092
- " ",
7093
- derive([details], (details2) => {
7094
- return Object.entries(details2).map(([key, value]) => {
7095
- return `${style.label(key)} ${value}`;
7096
- }).join(style.placeholder(" \u2500 "));
7097
- }),
7098
- br()
7099
- ]
7100
- );
7101
- group.update((group2) => [...group2, line2]);
7102
- const timer = createTimer();
7103
7070
  try {
7104
- const data = await q.push({ asset, stack });
7105
- details.set({
7106
- ...data,
7107
- time: timer()
7071
+ await cb(async (file2, data2) => {
7072
+ const fullpath = getFullPath(file2);
7073
+ const basepath2 = dirname6(fullpath);
7074
+ await mkdir2(basepath2, { recursive: true });
7075
+ await writeFile2(fullpath, data2);
7108
7076
  });
7109
- icon.set(style.success(symbol.success));
7110
7077
  } catch (error) {
7111
- icon.set(style.error(symbol.error));
7112
7078
  throw error;
7113
- } finally {
7114
- stop();
7115
7079
  }
7080
+ const file = getFullPath("FINGER_PRINT");
7081
+ const basepath = dirname6(file);
7082
+ await mkdir2(basepath, { recursive: true });
7083
+ await writeFile2(file, fingerprint);
7084
+ },
7085
+ async read(fingerprint, files) {
7086
+ const prev = await getFingerPrint();
7087
+ if (prev !== fingerprint) {
7088
+ throw new TypeError(`Outdated fingerprint: ${fingerprint}`);
7089
+ }
7090
+ return Promise.all(
7091
+ files.map((file) => {
7092
+ return readFile6(getFullPath(file));
7093
+ })
7094
+ );
7095
+ }
7096
+ });
7097
+ details.set({
7098
+ ...data,
7099
+ time: timer()
7100
+ });
7101
+ icon.set(style.success(symbol.success));
7102
+ } catch (error) {
7103
+ icon.set(style.error(symbol.error));
7104
+ throw error;
7105
+ } finally {
7106
+ stop();
7107
+ }
7108
+ }, 3);
7109
+ await Promise.all(
7110
+ app.stacks.map(async (stack) => {
7111
+ await Promise.all(
7112
+ [...stack.assets].map(async (asset) => {
7113
+ await q.push({ stack, asset });
7116
7114
  })
7117
7115
  );
7118
7116
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.127",
3
+ "version": "0.0.128",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@awsless/lambda": "^0.0.15",
32
+ "@awsless/sqs": "^0.0.7",
32
33
  "@awsless/redis": "^0.0.10",
33
34
  "@awsless/sns": "^0.0.7",
34
- "@awsless/sqs": "^0.0.7",
35
35
  "@awsless/ssm": "^0.0.7",
36
36
  "@awsless/validate": "^0.0.10",
37
37
  "@awsless/weak-cache": "^0.0.1"