@geek-fun/serverlessinsight 0.3.2 → 0.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geek-fun/serverlessinsight",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Full life cycle cross providers serverless application management for your fast-growing business.",
5
5
  "homepage": "https://serverlessinsight.geekfun.club",
6
6
  "main": "dist/src/index.js",
@@ -5,18 +5,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getContext = exports.setContext = exports.getIacLocation = void 0;
7
7
  const node_path_1 = __importDefault(require("node:path"));
8
+ const node_fs_1 = __importDefault(require("node:fs"));
8
9
  const providerEnum_1 = require("./providerEnum");
9
10
  const node_async_hooks_1 = require("node:async_hooks");
10
11
  const imsClient_1 = require("./imsClient");
11
12
  const asyncLocalStorage = new node_async_hooks_1.AsyncLocalStorage();
12
13
  const getIacLocation = (location) => {
13
14
  const projectRoot = node_path_1.default.resolve(process.cwd());
14
- return location
15
- ? node_path_1.default.resolve(projectRoot, location)
16
- : node_path_1.default.resolve(projectRoot, 'serverlessinsight.yml') ||
17
- node_path_1.default.resolve(projectRoot, 'serverlessInsight.yml') ||
18
- node_path_1.default.resolve(projectRoot, 'ServerlessInsight.yml') ||
19
- node_path_1.default.resolve(projectRoot, 'serverless-insight.yml');
15
+ if (location) {
16
+ const candidate = node_path_1.default.isAbsolute(location) ? location : node_path_1.default.resolve(projectRoot, location);
17
+ if (node_fs_1.default.existsSync(candidate)) {
18
+ return candidate;
19
+ }
20
+ throw new Error(`IaC file not found at '${candidate}'`);
21
+ }
22
+ const candidates = [
23
+ 'serverlessinsight.yml',
24
+ 'serverlessInsight.yml',
25
+ 'ServerlessInsight.yml',
26
+ 'serverless-insight.yml',
27
+ ];
28
+ for (const name of candidates) {
29
+ const candidate = node_path_1.default.resolve(projectRoot, name);
30
+ if (node_fs_1.default.existsSync(candidate)) {
31
+ return candidate;
32
+ }
33
+ }
34
+ throw new Error(`No IaC file found. Tried: ${candidates.map((n) => `'${node_path_1.default.resolve(projectRoot, n)}'`).join(', ')}`);
20
35
  };
21
36
  exports.getIacLocation = getIacLocation;
22
37
  const setContext = async (config, reaValToken = false) => {
@@ -33,9 +33,7 @@ const getBootstrapTemplate = async (context) => {
33
33
  Description: 'ServerlessInsight Bootstrap API',
34
34
  Handler: 'index.handler',
35
35
  Runtime: 'nodejs20',
36
- Layers: [
37
- `acs:fc:${context.region}:${context.accountId}:layers/si-bootstrap-sdk/versions/18`,
38
- ],
36
+ Layers: [`acs:fc:${context.region}:1990893136649406:layers/si-bootstrap-sdk/versions/18`],
39
37
  Code: {
40
38
  SourceCode: `
41
39
  const { bootstrapHandler } = require('@geek-fun/si-bootstrap-sdk');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geek-fun/serverlessinsight",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Full life cycle cross providers serverless application management for your fast-growing business.",
5
5
  "homepage": "https://serverlessinsight.geekfun.club",
6
6
  "main": "dist/src/index.js",