File tree Expand file tree Collapse file tree 13 files changed +111
-34
lines changed
Expand file tree Collapse file tree 13 files changed +111
-34
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " lingo.dev " : minor
3+ " @lingo.dev/_action " : patch
4+ ---
5+
6+ add "ci" command
Original file line number Diff line number Diff line change 11{
2- "name" : " @lingo.dev/~action " ,
2+ "name" : " @lingo.dev/_action " ,
33 "private" : true ,
44 "type" : " module" ,
5+ "main" : " build/main.js" ,
6+ "types" : " build/main.d.ts" ,
57 "scripts" : {
68 "build" : " tsc"
79 },
Original file line number Diff line number Diff line change 1- import createOra from "ora " ;
1+ import main from "./main.js " ;
22
3- import { IIntegrationFlow } from "./flows/_base.js" ;
4- import { PullRequestFlow } from "./flows/pull-request.js" ;
5- import { InBranchFlow } from "./flows/in-branch.js" ;
6- import { getPlatformKit } from "./platforms/index.js" ;
7-
8- ( async function main ( ) {
9- const ora = createOra ( ) ;
10- const platformKit = getPlatformKit ( ) ;
11- const { isPullRequestMode } = platformKit . config ;
12-
13- ora . info ( `Pull request mode: ${ isPullRequestMode ? "on" : "off" } ` ) ;
14-
15- const flow : IIntegrationFlow = isPullRequestMode
16- ? new PullRequestFlow ( ora , platformKit )
17- : new InBranchFlow ( ora , platformKit ) ;
18-
19- const canRun = await flow . preRun ?.( ) ;
20- if ( canRun === false ) {
21- return ;
22- }
23-
24- const hasChanges = await flow . run ( ) ;
25- if ( ! hasChanges ) {
26- return ;
27- }
28-
29- await flow . postRun ?.( ) ;
30- } ) ( ) ;
3+ main ( ) ;
Original file line number Diff line number Diff line change 1+ declare module "@lingo.dev/_action" {
2+ export default function main ( ) : Promise < void > ;
3+ }
Original file line number Diff line number Diff line change 1+ import createOra from "ora" ;
2+
3+ import { IIntegrationFlow } from "./flows/_base.js" ;
4+ import { PullRequestFlow } from "./flows/pull-request.js" ;
5+ import { InBranchFlow } from "./flows/in-branch.js" ;
6+ import { getPlatformKit } from "./platforms/index.js" ;
7+
8+ export default async function main ( ) {
9+ const ora = createOra ( ) ;
10+ const platformKit = getPlatformKit ( ) ;
11+ const { isPullRequestMode } = platformKit . config ;
12+
13+ ora . info ( `Pull request mode: ${ isPullRequestMode ? "on" : "off" } ` ) ;
14+
15+ const flow : IIntegrationFlow = isPullRequestMode
16+ ? new PullRequestFlow ( ora , platformKit )
17+ : new InBranchFlow ( ora , platformKit ) ;
18+
19+ const canRun = await flow . preRun ?.( ) ;
20+ if ( canRun === false ) {
21+ return ;
22+ }
23+
24+ const hasChanges = await flow . run ( ) ;
25+ if ( ! hasChanges ) {
26+ return ;
27+ }
28+
29+ await flow . postRun ?.( ) ;
30+ }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ interface BitbucketConfig {
1515export class BitbucketPlatformKit extends PlatformKit < BitbucketConfig > {
1616 private _bb ?: ReturnType < typeof Bitbucket > ;
1717
18- get bb ( ) {
18+ private get bb ( ) {
1919 if ( ! this . _bb ) {
2020 this . _bb = new Bitbucket ( {
2121 auth : { token : this . platformConfig . bbToken || "" } ,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { execSync } from "child_process";
77export class GitHubPlatformKit extends PlatformKit {
88 private _octokit ?: Octokit ;
99
10- get octokit ( ) {
10+ private get octokit ( ) : Octokit {
1111 if ( ! this . _octokit ) {
1212 this . _octokit = new Octokit ( { auth : this . platformConfig . ghToken } ) ;
1313 }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class GitlabPlatformKit extends PlatformKit {
1515 process . chdir ( this . platformConfig . projectDir ) ;
1616 }
1717
18- get gitlab ( ) {
18+ private get gitlab ( ) : InstanceType < typeof Gitlab > {
1919 if ( ! this . _gitlab ) {
2020 this . _gitlab = new Gitlab ( {
2121 token : this . platformConfig . glToken || "" ,
Original file line number Diff line number Diff line change 1212 "target" : " ESNext" ,
1313 "rootDir" : " src" ,
1414 "outDir" : " build" ,
15- "allowUnreachableCode" : true
15+ "allowUnreachableCode" : true ,
16+ "declaration" : true ,
17+ "declarationMap" : true
1618 },
1719 "include" : [" src/**/*.ts" , " src/**/*.tsx" ],
1820 "exclude" : [" src/**/*.spec.ts" , " src/**/*.spec.tsx" ]
Original file line number Diff line number Diff line change 6161 "@inquirer/prompts" : " ^7.2.3" ,
6262 "@lingo.dev/_sdk" : " workspace:*" ,
6363 "@lingo.dev/_spec" : " workspace:*" ,
64+ "@lingo.dev/_action" : " workspace:*" ,
6465 "@modelcontextprotocol/sdk" : " ^1.5.0" ,
6566 "@paralleldrive/cuid2" : " ^2.2.2" ,
6667 "chalk" : " ^5.4.1" ,
You can’t perform that action at this time.
0 commit comments