@awsless/awsless 0.0.105 → 0.0.106

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
@@ -7608,7 +7608,7 @@ var assetBuilder = (app) => {
7608
7608
  const data = await asset.build({
7609
7609
  async write(fingerprint, cb) {
7610
7610
  const prev = await getFingerPrint();
7611
- if (prev === fingerprint) {
7611
+ if (prev === fingerprint && !process.env.NO_CACHE) {
7612
7612
  return;
7613
7613
  }
7614
7614
  const file = getFullPath("FINGER_PRINT");
@@ -8435,9 +8435,17 @@ var singleTester = (stack, dir) => {
8435
8435
  ];
8436
8436
  }).flat();
8437
8437
  };
8438
- const formatOutput = ({ passed, failed, width, logs: logs2, errors, duration }) => {
8438
+ const formatOutput = ({
8439
+ passed,
8440
+ failed,
8441
+ width,
8442
+ logs: logs2,
8443
+ errors,
8444
+ duration,
8445
+ cached
8446
+ }) => {
8439
8447
  const icon = failed > 0 ? style.error(symbol.error) : style.success(symbol.success);
8440
- const values = [icon, " ", style.label(stack)];
8448
+ const values = [icon, " ", style.label(stack), cached ? style.warning(" (from cache)") : ""];
8441
8449
  if (passed > 0) {
8442
8450
  values.push(" ", style.placeholder(symbol.pointerSmall), style.success(` ${passed} passed`));
8443
8451
  }
@@ -8456,22 +8464,22 @@ var singleTester = (stack, dir) => {
8456
8464
  ];
8457
8465
  };
8458
8466
  return async (term) => {
8467
+ const timer = createTimer();
8459
8468
  await mkdir6(directories.test, { recursive: true });
8460
8469
  const fingerprint = await fingerprintFromDirectory(dir);
8461
8470
  const file = join11(directories.test, `${stack}.json`);
8462
8471
  const exists = await fileExist(file);
8463
8472
  const line2 = new Signal([]);
8464
8473
  term.out.write(line2);
8465
- if (exists) {
8474
+ if (exists && !process.env.NO_CACHE) {
8466
8475
  const raw = await readFile6(file, { encoding: "utf8" });
8467
8476
  const data2 = JSON.parse(raw);
8468
8477
  if (data2.fingerprint === fingerprint) {
8469
- line2.set(formatOutput({ ...data2, width: term.out.width() }));
8478
+ line2.set(formatOutput({ ...data2, width: term.out.width(), duration: timer(), cached: true }));
8470
8479
  return data2.failed === 0;
8471
8480
  }
8472
8481
  }
8473
8482
  const [icon, stop] = createSpinner();
8474
- const timer = createTimer();
8475
8483
  const reporter = new CustomReporter();
8476
8484
  line2.set([icon, " ", style.label(stack)]);
8477
8485
  reporter.on("update", ({ tasks }) => {
@@ -8856,8 +8864,8 @@ program.option("--config-file <string>", "The config file location");
8856
8864
  program.option("--stage <string>", "The stage to use, defaults to prod stage", "prod");
8857
8865
  program.option("--profile <string>", "The AWS profile to use");
8858
8866
  program.option("--region <string>", "The AWS region to use");
8867
+ program.option("-c --no-cache", "Always build & test without the cache");
8859
8868
  program.option("-s --skip-prompt", "Skip prompts");
8860
- program.option("-m --mute", "Mute sound effects");
8861
8869
  program.option("-v --verbose", "Print verbose logs");
8862
8870
  program.exitOverride(() => {
8863
8871
  process.exit(0);
@@ -8866,7 +8874,10 @@ program.on("option:verbose", () => {
8866
8874
  process.env.VERBOSE = program.opts().verbose ? "1" : void 0;
8867
8875
  });
8868
8876
  program.on("option:skip-prompt", () => {
8869
- process.env.SKIP_PROMPT = program.opts().verbose ? "1" : void 0;
8877
+ process.env.SKIP_PROMPT = program.opts().skipPrompt ? "1" : void 0;
8878
+ });
8879
+ program.on("option:no-cache", () => {
8880
+ process.env.NO_CACHE = program.opts().noCache ? "1" : void 0;
8870
8881
  });
8871
8882
  var commands2 = [
8872
8883
  bootstrap,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.105",
3
+ "version": "0.0.106",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,