@awsless/awsless 0.0.28 → 0.0.30

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.cjs CHANGED
@@ -854,9 +854,7 @@ var rollupBundle = async (input) => {
854
854
  },
855
855
  plugins: [
856
856
  (0, import_plugin_commonjs.default)({ sourceMap: true }),
857
- (0, import_plugin_node_resolve.default)({
858
- preferBuiltins: true
859
- }),
857
+ (0, import_plugin_node_resolve.default)({ preferBuiltins: true }),
860
858
  (0, import_rollup_plugin_swc3.swc)({
861
859
  minify: true,
862
860
  jsc: {
@@ -4210,6 +4208,9 @@ var fileExist = async (file) => {
4210
4208
  var importFile = async (path) => {
4211
4209
  const bundle = await (0, import_rollup3.rollup)({
4212
4210
  input: path,
4211
+ onwarn: (error) => {
4212
+ debugError(error.message);
4213
+ },
4213
4214
  plugins: [
4214
4215
  (0, import_rollup_plugin_replace.default)({
4215
4216
  __dirname: (id) => `'${(0, import_path3.dirname)(id)}'`
@@ -4783,10 +4784,13 @@ var assetBuilder = (app) => {
4783
4784
  if (assets.length === 0) {
4784
4785
  return;
4785
4786
  }
4787
+ const showDetailedView = assets.length <= term.out.height() - 2;
4786
4788
  const done = term.out.write(loadingDialog("Building stack assets..."));
4787
4789
  const groups = new Signal([""]);
4788
- term.out.gap();
4789
- term.out.write(groups);
4790
+ if (showDetailedView) {
4791
+ term.out.gap();
4792
+ term.out.write(groups);
4793
+ }
4790
4794
  const stackNameSize = Math.max(...stacks.map((stack) => stack.name.length));
4791
4795
  const assetTypeSize = Math.max(...assets.map((asset) => asset.type.length));
4792
4796
  await Promise.all(app.stacks.map(async (stack) => {
@@ -4847,7 +4851,9 @@ var assetBuilder = (app) => {
4847
4851
  }));
4848
4852
  }));
4849
4853
  done("Done building stack assets");
4850
- term.out.gap();
4854
+ if (showDetailedView) {
4855
+ term.out.gap();
4856
+ }
4851
4857
  };
4852
4858
  };
4853
4859
 
package/dist/bin.js CHANGED
@@ -831,9 +831,7 @@ var rollupBundle = async (input) => {
831
831
  },
832
832
  plugins: [
833
833
  commonjs({ sourceMap: true }),
834
- nodeResolve({
835
- preferBuiltins: true
836
- }),
834
+ nodeResolve({ preferBuiltins: true }),
837
835
  swc({
838
836
  minify: true,
839
837
  jsc: {
@@ -4187,6 +4185,9 @@ var fileExist = async (file) => {
4187
4185
  var importFile = async (path) => {
4188
4186
  const bundle = await rollup2({
4189
4187
  input: path,
4188
+ onwarn: (error) => {
4189
+ debugError(error.message);
4190
+ },
4190
4191
  plugins: [
4191
4192
  replace({
4192
4193
  __dirname: (id) => `'${dirname2(id)}'`
@@ -4760,10 +4761,13 @@ var assetBuilder = (app) => {
4760
4761
  if (assets.length === 0) {
4761
4762
  return;
4762
4763
  }
4764
+ const showDetailedView = assets.length <= term.out.height() - 2;
4763
4765
  const done = term.out.write(loadingDialog("Building stack assets..."));
4764
4766
  const groups = new Signal([""]);
4765
- term.out.gap();
4766
- term.out.write(groups);
4767
+ if (showDetailedView) {
4768
+ term.out.gap();
4769
+ term.out.write(groups);
4770
+ }
4767
4771
  const stackNameSize = Math.max(...stacks.map((stack) => stack.name.length));
4768
4772
  const assetTypeSize = Math.max(...assets.map((asset) => asset.type.length));
4769
4773
  await Promise.all(app.stacks.map(async (stack) => {
@@ -4824,7 +4828,9 @@ var assetBuilder = (app) => {
4824
4828
  }));
4825
4829
  }));
4826
4830
  done("Done building stack assets");
4827
- term.out.gap();
4831
+ if (showDetailedView) {
4832
+ term.out.gap();
4833
+ }
4828
4834
  };
4829
4835
  };
4830
4836
 
package/dist/index.cjs CHANGED
@@ -42,13 +42,15 @@ var definePlugin = (plugin) => plugin;
42
42
  // src/node/resource.ts
43
43
  var APP = process.env.APP || "app";
44
44
  var STACK = process.env.STACK || "stack";
45
- var getLocalResourceName = (id, stack = STACK) => {
46
- return `${APP}-${stack}-${id}`;
45
+ var getLocalResourceName = (name, stack = STACK) => {
46
+ return `${APP}-${stack}-${name}`;
47
47
  };
48
- var getGlobalResourceName = (id) => {
49
- return `${APP}-${id}`;
48
+ var getGlobalResourceName = (name) => {
49
+ return `${APP}-${name}`;
50
+ };
51
+ var getFunctionName = (stack, name) => {
52
+ return getLocalResourceName(name, stack);
50
53
  };
51
- var getFunctionName = getLocalResourceName;
52
54
  var getSearchName = getLocalResourceName;
53
55
  var getTableName = getLocalResourceName;
54
56
  var getStoreName = getLocalResourceName;
package/dist/index.d.ts CHANGED
@@ -2466,16 +2466,16 @@ type Plugin<S extends AnyZodObject | undefined = undefined> = {
2466
2466
  };
2467
2467
  declare const definePlugin: <S extends AnyZodObject | undefined = undefined>(plugin: Plugin<S>) => Plugin<S>;
2468
2468
 
2469
- declare const getLocalResourceName: (id: string, stack?: string) => string;
2470
- declare const getGlobalResourceName: (id: string) => string;
2471
- declare const getFunctionName: (id: string, stack?: string) => string;
2472
- declare const getSearchName: (id: string, stack?: string) => string;
2473
- declare const getTableName: (id: string, stack?: string) => string;
2474
- declare const getStoreName: (id: string, stack?: string) => string;
2475
- declare const getQueueName: (id: string, stack?: string) => string;
2476
- declare const getTopicName: (id: string) => string;
2469
+ declare const getLocalResourceName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
2470
+ declare const getGlobalResourceName: <N extends string>(name: N) => `app-${N}`;
2471
+ declare const getFunctionName: (stack: string, name: string) => `app-${string}-${string}`;
2472
+ declare const getSearchName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
2473
+ declare const getTableName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
2474
+ declare const getStoreName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
2475
+ declare const getQueueName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
2476
+ declare const getTopicName: <N extends string>(name: N) => `app-${N}`;
2477
2477
  declare const getSecretName: (name: string) => string;
2478
- declare const getCacheProps: (name: string, stack?: string) => {
2478
+ declare const getCacheProps: (name: string, stack?: "stack") => {
2479
2479
  readonly host: string;
2480
2480
  readonly port: number;
2481
2481
  };
package/dist/index.js CHANGED
@@ -5,13 +5,15 @@ import {
5
5
  // src/node/resource.ts
6
6
  var APP = process.env.APP || "app";
7
7
  var STACK = process.env.STACK || "stack";
8
- var getLocalResourceName = (id, stack = STACK) => {
9
- return `${APP}-${stack}-${id}`;
8
+ var getLocalResourceName = (name, stack = STACK) => {
9
+ return `${APP}-${stack}-${name}`;
10
10
  };
11
- var getGlobalResourceName = (id) => {
12
- return `${APP}-${id}`;
11
+ var getGlobalResourceName = (name) => {
12
+ return `${APP}-${name}`;
13
+ };
14
+ var getFunctionName = (stack, name) => {
15
+ return getLocalResourceName(name, stack);
13
16
  };
14
- var getFunctionName = getLocalResourceName;
15
17
  var getSearchName = getLocalResourceName;
16
18
  var getTableName = getLocalResourceName;
17
19
  var getStoreName = getLocalResourceName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {