Skip to content

Commit

Permalink
refactor: refactor provider enum
Browse files Browse the repository at this point in the history
Signed-off-by: seven <[email protected]>
  • Loading branch information
Blankll committed Dec 14, 2024
1 parent ebf1857 commit 37fb3d1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/common/provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum PROVIDER {
HUAWEI = 'HUAWEI',
ALIBABA = 'ALIBABA',
export enum Provider {
HUAWEI = 'huawei',
ALIYUN = 'aliyun',
// TENCENT = 'TENCENT',
// AWS = 'AZURE',
// AZURE = 'AZURE',
Expand Down
3 changes: 2 additions & 1 deletion src/parser/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { existsSync, readFileSync } from 'node:fs';
import { ActionContext, Provider, ServerlessIac, ServerlessIacRaw } from '../types';
import { ActionContext, ServerlessIac, ServerlessIacRaw } from '../types';
import { parseFunction } from './functionParser';
import { parseEvent } from './eventParser';
import { parseDatabase } from './databaseParser';
import { parseTag } from './tagParser';
import { parse } from 'yaml';
import { validateYaml } from '../validator';
import { Provider } from '../common';

const validateExistence = (path: string) => {
if (!existsSync(path)) {
Expand Down
4 changes: 2 additions & 2 deletions src/stack/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ros from '@alicloud/ros-cdk-core';

import { ActionContext, Provider, ServerlessIac } from '../types';
import { logger, rosStackDeploy } from '../common';
import { ActionContext, ServerlessIac } from '../types';
import { logger, Provider, rosStackDeploy } from '../common';
import { RosStack } from './rosStack';
import { RfsStack } from './rfsStack';

Expand Down
6 changes: 1 addition & 5 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Tags } from './domains/tag';
import { EventDomain, EventRaw } from './domains/event';
import { DatabaseDomain, DatabaseRaw } from './domains/database';
import { FunctionDomain, FunctionRaw } from './domains/function';
import { Provider } from '../common';

export * from './domains/database';
export * from './domains/event';
Expand All @@ -11,11 +12,6 @@ export * from './domains/tag';
export * from './domains/vars';
export * from './domains/context';

export const enum Provider {
ALIYUN = 'aliyun',
HUAWEI = 'huawei',
}

export type ServerlessIacRaw = {
version: string;
provider: Provider;
Expand Down

0 comments on commit 37fb3d1

Please sign in to comment.