Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
syi0808 committed Oct 6, 2024
1 parent 3102759 commit c089633
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 22 deletions.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ publish manager for multiple registry (JSR, npm and private registries)

## Why

- Customize with plugin

It is designed to be easy to managing publish to multiple registry.

## Usage
Expand Down Expand Up @@ -65,20 +67,21 @@ You can have either package.json or jsr.json.

- Show New files and New dependencies
- Check commits exist since last release
- Check package name availabliity
- Check first time publish package
- if first time -> Check package name availabliity
- Input SemVer version
- Input tag (if version is prerelease)
- Check hasn't been published scoped package
- Prerequisite tasks
- Check package manager version
- Verify user is authenticated
- Check git version
- Check git remote
<!-- - Check hasn't been published scoped package -->
- Required conditions checks (concurrently)
- Check test and build scripts exists
- Check package manager version and set pacakge manager on context
- if not first time -> Verify user is authenticated
- Validate version
- Check for prerelease vesion
- if not private and is prerelease version and tag option not exist -> throw error should set tag
- Check git version
- Check git remote
- Check git tag existence
- Git tasks
- Check current branch is release branch
- Check local working tree is clean
- Check remote history is clean
Expand All @@ -87,7 +90,12 @@ You can have either package.json or jsr.json.
- Tests
- Build
- Bumping version
- Publish package
- two-factor authentication
- Push tags
- Publish (concurrently)
- npm
- run publish
- two-factor authentication
- jsr
- run publish
- two-factor authentication
- Push tags
- Release draft
2 changes: 1 addition & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { exec } from 'tinyexec';
import { validateEngineVersion } from './utils/engine-version.js';
import { filesIgnoreWithGit } from './utils/ignore';
import { filesIgnoreWithGit } from './utils/ignore.js';

export class Git {
async git(args: string[]) {
Expand Down
1 change: 0 additions & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { Options, ResolvedOptions } from './types/options.js';
const defaultOptions: Omit<Options, 'version'> = {
testScript: 'test',
branch: 'main',
skipCleanup: true,
tag: 'latest',
registries: ['npm', 'jsr'],
};
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/jsr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer';
import { type ListrTask, PRESET_TIMER } from 'listr2';
import type { Ctx } from './runner';
import type { Ctx } from './runner.js';

export const jsrPubmTasks: ListrTask<Ctx> = {
title: 'jsr',
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/npm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer';
import { type ListrTask, PRESET_TIMER } from 'listr2';
import type { Ctx } from './runner';
import type { Ctx } from './runner.js';

export const npmPubmTasks: ListrTask<Ctx> = {
title: 'npm',
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/prerequisites.ts → src/tasks/required-checks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { delay, Listr } from 'listr2';
import type { Ctx } from './runner.js';

export const prerequisiteTasks = new Listr<Ctx>([
export const requiredCheckTasks = new Listr<Ctx>([
{
title: 'Prerequisites',
title: 'Required checks',
task: (_ctx, parentTask) =>
parentTask.newListr([
{
Expand Down
8 changes: 4 additions & 4 deletions src/tasks/runner.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Listr } from 'listr2';
import type { ResolvedOptions } from '../types/options';
import { jsrPubmTasks } from './jsr';
import { npmPubmTasks } from './npm';
import { prerequisiteTasks } from './prerequisites';
import type { ResolvedOptions } from '../types/options.js';
import { jsrPubmTasks } from './jsr.js';
import { npmPubmTasks } from './npm.js';
import { prerequisiteTasks } from './required-checks.js';

export interface Ctx extends ResolvedOptions {
progressingPrompt?: Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface Options {
anyBranch?: boolean;
/**
* @description Skip cleaning the `node_modules` directory
* @default true
* @default false
*/
skipCleanup?: boolean;
/**
Expand Down

0 comments on commit c089633

Please sign in to comment.