Skip to content

Commit

Permalink
refactor: restructure the folders #5
Browse files Browse the repository at this point in the history
Signed-off-by: seven <[email protected]>
  • Loading branch information
Blankll committed Sep 22, 2024
1 parent 733aeb9 commit 9e093da
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { deployStack } from '../stack';
import { deployStack, parseYaml } from '../stack';
import { printer, constructActionContext } from '../common';
import { parseYaml } from '../iac';

export const deploy = async (
stackName: string,
Expand Down
5 changes: 2 additions & 3 deletions src/commands/validate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { parseYaml } from '../iac';
import { printer } from '../common';
import { constructActionContext } from '../common/actionContext';
import { printer, constructActionContext } from '../common';
import { parseYaml } from '../stack';

export const validate = (location?: string) => {
const context = constructActionContext({ location });
Expand Down
2 changes: 0 additions & 2 deletions src/iac/index.ts

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions src/stack/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { deployStack } from './deploy';
export * from './parse';
export * from './iacSchema';
File renamed without changes.
3 changes: 2 additions & 1 deletion tests/fixtures/serverless-insignt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ provider: aliyun
vars:
region: cn-hangzhou
testv: testVarValue
handler: index.handler

stages:
dev:
Expand All @@ -18,7 +19,7 @@ functions:
insight_poc_fn:
name: insight-poc-fn
runtime: nodejs18
handler: index.handler
handler: ${vars.handler}
code: artifacts/artifact.zip
memory: 512
timeout: 10
Expand Down
2 changes: 1 addition & 1 deletion tests/validate.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { validateYaml } from '../src/iac';
import { readFileSync } from 'node:fs';
import * as path from 'node:path';
import { parse } from 'yaml';
import { RawServerlessIac } from '../src/types';
import { validateYaml } from '../src/stack';

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

0 comments on commit 9e093da

Please sign in to comment.