build: update build process
move build to github action;add .signore;add -e option to ncc to make @serverless-devs/core out of ncc compile
This commit is contained in:
parent
c3127e9425
commit
f3a244a6e1
|
@ -21,9 +21,9 @@ jobs:
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install setuptools wheel twine
|
pip install setuptools wheel twine
|
||||||
pip install requests
|
pip install requests
|
||||||
# - name: NPM install
|
- name: Build
|
||||||
# run: |
|
run: |
|
||||||
# npm install --production
|
npm run build
|
||||||
- name: Add publish file
|
- name: Add publish file
|
||||||
run: |
|
run: |
|
||||||
wget https://serverless-registry.oss-cn-hangzhou.aliyuncs.com/publish-file/python3/hub-publish.py
|
wget https://serverless-registry.oss-cn-hangzhou.aliyuncs.com/publish-file/python3/hub-publish.py
|
||||||
|
|
|
@ -5,3 +5,5 @@ node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
lib
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
.PHONY: push
|
||||||
|
|
||||||
|
CURRENT_BRANCH_NAME := $(shell git symbolic-ref --short HEAD)
|
||||||
|
|
||||||
|
add:
|
||||||
|
git add .
|
||||||
|
|
||||||
|
commit: add
|
||||||
|
git-cz
|
||||||
|
|
||||||
|
rebase-main: commit
|
||||||
|
git pull --rebase origin master
|
||||||
|
|
||||||
|
push:
|
||||||
|
git push --force-with-lease origin $(CURRENT_BRANCH_NAME)
|
||||||
|
|
||||||
|
release-dev: push
|
||||||
|
-gh release delete dev -y
|
||||||
|
-git tag -d dev
|
||||||
|
-git push origin :refs/tags/dev
|
||||||
|
gh release create dev --notes "dev release" --target dev --title "Release dev"
|
||||||
|
|
||||||
|
roll-back-dev:
|
||||||
|
git reset --soft HEAD~1
|
||||||
|
git restore --staged publish.yaml
|
||||||
|
git restore publish.yaml
|
|
@ -1,44 +0,0 @@
|
||||||
declare const _default: ({
|
|
||||||
header: string;
|
|
||||||
content: string;
|
|
||||||
optionList?: undefined;
|
|
||||||
} | {
|
|
||||||
header: string;
|
|
||||||
optionList: ({
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
type: StringConstructor;
|
|
||||||
alias?: undefined;
|
|
||||||
} | {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
alias: string;
|
|
||||||
type: StringConstructor;
|
|
||||||
} | {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
type: BooleanConstructor;
|
|
||||||
alias?: undefined;
|
|
||||||
})[];
|
|
||||||
content?: undefined;
|
|
||||||
} | {
|
|
||||||
header: string;
|
|
||||||
optionList: {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
alias: string;
|
|
||||||
type: BooleanConstructor;
|
|
||||||
}[];
|
|
||||||
content?: undefined;
|
|
||||||
} | {
|
|
||||||
header: string;
|
|
||||||
content: string[];
|
|
||||||
optionList?: undefined;
|
|
||||||
} | {
|
|
||||||
header: string;
|
|
||||||
content: {
|
|
||||||
example: string;
|
|
||||||
}[];
|
|
||||||
optionList?: undefined;
|
|
||||||
})[];
|
|
||||||
export default _default;
|
|
|
@ -1,10 +0,0 @@
|
||||||
export default class ComponentLogger {
|
|
||||||
static CONTENT: string;
|
|
||||||
static setContent(content: any): void;
|
|
||||||
static log(m: any, color?: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'whiteBright' | 'gray'): void;
|
|
||||||
static info(m: any): void;
|
|
||||||
static debug(m: any): void;
|
|
||||||
static error(m: any): void;
|
|
||||||
static warning(m: any): void;
|
|
||||||
static success(m: any): void;
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
export default class StdoutFormatter {
|
|
||||||
static stdoutFormatter: any;
|
|
||||||
static initStdout(): Promise<void>;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
import { InputProps } from './interface/entity';
|
|
||||||
export default class FcRemoteInvoke {
|
|
||||||
/**
|
|
||||||
* event 函数本地调试
|
|
||||||
* @param inputs
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
invoke(inputs: InputProps): Promise<any>;
|
|
||||||
private report;
|
|
||||||
private handlerInputs;
|
|
||||||
}
|
|
File diff suppressed because one or more lines are too long
|
@ -1,34 +0,0 @@
|
||||||
export interface ICredentials {
|
|
||||||
AccountID?: string;
|
|
||||||
AccessKeyID?: string;
|
|
||||||
AccessKeySecret?: string;
|
|
||||||
SecurityToken?: string;
|
|
||||||
}
|
|
||||||
export interface InputProps {
|
|
||||||
props?: IProperties;
|
|
||||||
credentials: ICredentials;
|
|
||||||
appName: string;
|
|
||||||
project: {
|
|
||||||
component: string;
|
|
||||||
access: string;
|
|
||||||
projectName: string;
|
|
||||||
};
|
|
||||||
command: string;
|
|
||||||
args: string;
|
|
||||||
path: {
|
|
||||||
configPath: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export interface IProperties {
|
|
||||||
region: string;
|
|
||||||
serviceName: string;
|
|
||||||
functionName: string;
|
|
||||||
qualifier?: string;
|
|
||||||
domainName?: string;
|
|
||||||
}
|
|
||||||
export declare function isProperties(args: any): args is IProperties;
|
|
||||||
export interface IEventPayload {
|
|
||||||
event?: string;
|
|
||||||
eventFile?: string;
|
|
||||||
eventStdin?: boolean;
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
import { ICredentials } from '../interface/entity';
|
|
||||||
export default class Client {
|
|
||||||
static buildFcClient(region: string, credentials: ICredentials): Promise<any>;
|
|
||||||
private static getFcEndpoint;
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
export default class File {
|
|
||||||
static getEvent(eventFile: any): Promise<unknown>;
|
|
||||||
static eventPriority(eventPriority: any): Promise<any>;
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
import { IProperties, IEventPayload } from '../interface/entity';
|
|
||||||
export default class RemoteInvoke {
|
|
||||||
fcClient: any;
|
|
||||||
accountId: string;
|
|
||||||
constructor(fcClient: any, accountId: string);
|
|
||||||
invoke(props: IProperties, eventPayload: IEventPayload, { invocationType }: {
|
|
||||||
invocationType: any;
|
|
||||||
}): Promise<void>;
|
|
||||||
requestDomain(url: string, event: string): Promise<void>;
|
|
||||||
getHttpTrigger(serviceName: any, functionName: any): Promise<any>;
|
|
||||||
eventInvoke({ serviceName, functionName, event, qualifier, invocationType }: {
|
|
||||||
serviceName: any;
|
|
||||||
functionName: any;
|
|
||||||
event: any;
|
|
||||||
qualifier?: string;
|
|
||||||
invocationType: any;
|
|
||||||
}): Promise<void>;
|
|
||||||
httpInvoke({ region, serviceName, functionName, event, qualifier }: {
|
|
||||||
region: any;
|
|
||||||
serviceName: any;
|
|
||||||
functionName: any;
|
|
||||||
event: any;
|
|
||||||
qualifier: any;
|
|
||||||
}): Promise<void>;
|
|
||||||
/**
|
|
||||||
* @param event: { body, headers, method, queries, path }
|
|
||||||
* path 组装后的路径 /proxy/serviceName/functionName/path ,
|
|
||||||
*/
|
|
||||||
request(event: any): Promise<void>;
|
|
||||||
handlerHttpParmase(event: any): {
|
|
||||||
headers: any;
|
|
||||||
queries: any;
|
|
||||||
method: any;
|
|
||||||
path: any;
|
|
||||||
body: any;
|
|
||||||
};
|
|
||||||
private showLog;
|
|
||||||
private getJsonEvent;
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
/// <reference types="node" />
|
|
||||||
export declare function getStdin(): Promise<string>;
|
|
||||||
export declare namespace getStdin {
|
|
||||||
var buffer: () => Promise<Buffer>;
|
|
||||||
}
|
|
|
@ -25,7 +25,8 @@
|
||||||
"start": "npm run watch",
|
"start": "npm run watch",
|
||||||
"watch": "tsc -w",
|
"watch": "tsc -w",
|
||||||
"prebuild": "rm -rf node_modules && rm -rf package-lock.json && npm i && rimraf lib",
|
"prebuild": "rm -rf node_modules && rm -rf package-lock.json && npm i && rimraf lib",
|
||||||
"build": "ncc build src/index.ts -m -o lib"
|
"build": "ncc build src/index.ts -m -e @serverless-devs/core -o lib",
|
||||||
|
"postbuild": "rm -rf package-lock.json && rm -rf node_modules"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alicloud/fc2": "^2.2.2",
|
"@alicloud/fc2": "^2.2.2",
|
||||||
|
|
Loading…
Reference in New Issue