Skip to content

Commit 9e093da

Browse files
committed
refactor: restructure the folders #5
Signed-off-by: seven <[email protected]>
1 parent 733aeb9 commit 9e093da

File tree

8 files changed

+8
-9
lines changed

8 files changed

+8
-9
lines changed

src/commands/deploy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { deployStack } from '../stack';
1+
import { deployStack, parseYaml } from '../stack';
22
import { printer, constructActionContext } from '../common';
3-
import { parseYaml } from '../iac';
43

54
export const deploy = async (
65
stackName: string,

src/commands/validate.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { parseYaml } from '../iac';
2-
import { printer } from '../common';
3-
import { constructActionContext } from '../common/actionContext';
1+
import { printer, constructActionContext } from '../common';
2+
import { parseYaml } from '../stack';
43

54
export const validate = (location?: string) => {
65
const context = constructActionContext({ location });

src/iac/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.

src/stack/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export { deployStack } from './deploy';
2+
export * from './parse';
3+
export * from './iacSchema';
File renamed without changes.

tests/fixtures/serverless-insignt.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ provider: aliyun
44
vars:
55
region: cn-hangzhou
66
testv: testVarValue
7+
handler: index.handler
78

89
stages:
910
dev:
@@ -18,7 +19,7 @@ functions:
1819
insight_poc_fn:
1920
name: insight-poc-fn
2021
runtime: nodejs18
21-
handler: index.handler
22+
handler: ${vars.handler}
2223
code: artifacts/artifact.zip
2324
memory: 512
2425
timeout: 10

tests/validate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { validateYaml } from '../src/iac';
21
import { readFileSync } from 'node:fs';
32
import * as path from 'node:path';
43
import { parse } from 'yaml';
54
import { RawServerlessIac } from '../src/types';
5+
import { validateYaml } from '../src/stack';
66

77
const jsonIac = parse(
88
readFileSync(path.resolve(__dirname, './fixtures/serverless-insignt.yml'), 'utf8'),

0 commit comments

Comments
 (0)