-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
367 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export abstract class Registry { | ||
abstract ping(): Promise<boolean>; | ||
abstract distTags(): Promise<string[]>; | ||
abstract getVersion(): Promise<string>; | ||
abstract publish(): Promise<boolean>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,57 @@ | ||
import { type ListrTask, delay } from 'listr2'; | ||
import { Listr, type ListrTask, delay } from 'listr2'; | ||
import type { Ctx } from './runner.js'; | ||
|
||
export const prerequisitesCheckTask: ListrTask<Ctx> = { | ||
title: 'Prerequisites check (for deployment reliability)', | ||
task: (_, parentTask) => | ||
parentTask.newListr([ | ||
{ | ||
title: 'prerequisite 1', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
export const prerequisitesCheckTask: ( | ||
options?: Omit<ListrTask<Ctx>, 'title' | 'task'>, | ||
) => Listr<Ctx> = (options) => | ||
new Listr({ | ||
...options, | ||
exitOnError: true, | ||
title: 'Prerequisites check (for deployment reliability)', | ||
task: (_, parentTask) => | ||
parentTask.newListr([ | ||
{ | ||
title: 'Checking if remote history is clean', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
exitOnError: true, | ||
}, | ||
]), | ||
}; | ||
{ | ||
title: 'Checking if the local working tree is clean', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking if commits exist since the last release', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Confirming new files and new dependencies', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking if the package has never been deployed', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
skip: () => true, | ||
title: 'Checking package name availability', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
]), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,82 @@ | ||
import { type ListrTask, delay } from 'listr2'; | ||
import { Listr, type ListrTask, delay } from 'listr2'; | ||
import type { Ctx } from './runner.js'; | ||
|
||
export const requiredConditionsCheckTask: ListrTask<Ctx> = { | ||
title: 'Required conditions check (for pubm tasks)', | ||
task: (_, parentTask) => | ||
parentTask.newListr([ | ||
{ | ||
title: 'prerequisite 1 ', | ||
task: async () => { | ||
// console.log('All good'); | ||
await delay(1000); | ||
export const requiredConditionsCheckTask: ( | ||
options?: Omit<ListrTask<Ctx>, 'title' | 'task'>, | ||
) => Listr<Ctx> = (options) => | ||
new Listr({ | ||
...options, | ||
title: 'Required conditions check (for pubm tasks)', | ||
task: (_, parentTask) => | ||
parentTask.newListr( | ||
[ | ||
{ | ||
title: 'Ping registries', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking if test and build scripts exist', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking package manager version', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
skip: () => true, | ||
title: 'Verifying user authentication', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking git version', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking git remote', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking git tag existence', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Verifying current branch is a release branch', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
{ | ||
title: 'Checking if registry cli are installed', | ||
task: async (_, task) => { | ||
task.output = 'All good'; | ||
await delay(1000); | ||
}, | ||
}, | ||
], | ||
{ | ||
concurrent: true, | ||
}, | ||
exitOnError: true, | ||
}, | ||
]), | ||
}; | ||
), | ||
}); |
Oops, something went wrong.