Skip to content

Commit

Permalink
🎉 Increment version 0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
whalemare committed Jan 29, 2023
1 parent e0ea856 commit 241d4cd
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 32 deletions.
2 changes: 2 additions & 0 deletions apps/deploy/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ async function deploy() {
}

void deploy()
.then(() => process.exit(0))
.catch(() => process.exit(1))
2 changes: 1 addition & 1 deletion libs/core/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/core",
"version": "0.0.12"
"version": "0.0.13"
}
1 change: 1 addition & 0 deletions libs/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export * from './shared/step/createStep'
export * from './shared/step/makeStepExecutable'
export * from './shared/step/Step'
export * from './shared/task/DataMessage'
export * from './shared/task/entity/ActionState'
export * from './shared/task/entity/History'
export * from './shared/task/entity/Registry'
Expand Down
19 changes: 12 additions & 7 deletions libs/core/src/shared/task/TaskStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RequestStore } from 'mobx-request'

import { Step } from '../step/Step'

import { DataMessage } from './DataMessage'
import { QueueOutputable } from './QueueOutputable'
import { ActionState } from './entity/ActionState'
import { History as History } from './entity/History'
Expand All @@ -16,7 +17,7 @@ export class TaskStore<A = any, R = any> implements Step<A, R> {
name

@observable
history: History
history: History<DataMessage>

@observable
args: Optional<unknown> = undefined
Expand All @@ -42,17 +43,21 @@ export class TaskStore<A = any, R = any> implements Step<A, R> {
return this.props.action(ui, input)
}

onData = (msg: string | number) => {
const string = `${msg}`
const array = string.split('\n')
for (const item of array) {
this.history.push(item)
onData = (msg: DataMessage | DataMessage['value']) => {
if (msg && typeof msg === 'object') {
this.history.push(msg)
} else {
const dataMessage: DataMessage = {
type: 'message',
value: msg,
}
this.history.push(dataMessage)
}
}

constructor(private props: TaskStoreProps<A, R>) {
this.name = props?.name ?? 'task:unknown'
this.history = new QueueOutputable(props?.historySize ?? 5)
this.history = new QueueOutputable<DataMessage>(props?.historySize ?? 5)
if (props.formatArgs) {
this.args = props.formatArgs(undefined)
}
Expand Down
6 changes: 3 additions & 3 deletions libs/core/src/shared/task/entity/History.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface History {
push(data: string): void
export interface History<T> {
push(data: T): void

items: string[]
items: T[]

size: number
}
2 changes: 1 addition & 1 deletion libs/renderer-core/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/renderer-core",
"version": "0.0.12"
"version": "0.0.13"
}
2 changes: 1 addition & 1 deletion libs/renderer-react-ink/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/renderer-react-ink",
"version": "0.0.12"
"version": "0.0.13"
}
12 changes: 5 additions & 7 deletions libs/renderer-react-ink/src/internal/view/TaskHistoryView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TaskStore } from '@ts-pipeline/core'
import chalk from 'chalk'
import { Box, Text } from 'ink'
import { observer } from 'mobx-react-lite'
import React from 'react'
Expand All @@ -9,13 +10,10 @@ interface TaskHistoryViewProps {

export const TaskHistoryView = observer<TaskHistoryViewProps>(({ task }) => {
return (
<Box flexDirection="column">
{task.history.items.map(item => {
return (
<Text key={item} dimColor>
{` -> ${item}`}
</Text>
)
<Box marginLeft={2} flexDirection="column">
{task.history.items.map((item, index) => {
const color = item.type === 'message' ? chalk.dim : chalk.white
return <Text key={index}>{`${color(item.value?.toString().trim())}`}</Text>
})}
</Box>
)
Expand Down
2 changes: 1 addition & 1 deletion libs/renderer-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-pipeline/renderer-react",
"version": "0.0.12",
"version": "0.0.13",
"main": "./index.js",
"types": "./index.d.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion libs/runner-parallel/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/runner-parallel",
"version": "0.0.12"
"version": "0.0.13"
}
2 changes: 1 addition & 1 deletion libs/runner-sequence/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@ts-pipeline/runner-sequence",
"version": "0.0.12",
"version": "0.0.13",
"type": "module"
}
2 changes: 1 addition & 1 deletion libs/runner-workflow/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/runner-workflow",
"version": "0.0.12"
"version": "0.0.13"
}
2 changes: 1 addition & 1 deletion libs/step-increment/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-pipeline/step-increment",
"version": "0.0.12",
"version": "0.0.13",
"dependencies": {
"gradle-to-js": "2.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion libs/step-logs/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/step-logs",
"version": "0.0.12"
"version": "0.0.13"
}
2 changes: 1 addition & 1 deletion libs/step-shell/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/step-shell",
"version": "0.0.12"
"version": "0.0.13"
}
7 changes: 4 additions & 3 deletions libs/step-shell/src/shared/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ export interface ShellProps {
}
export const shell = createStep({
name: 'shell',
historySize: 5,
action: async (ui, props: ShellProps) => {
return execAsync(props.command, {
await execAsync(props.command, {
...props.options,
signal: ui.signal,
onMessage: (msg, source) => {
ui.onData(`${source}: ${msg}`)
onMessage: msg => {
ui.onData(msg)
},
})
},
Expand Down
2 changes: 1 addition & 1 deletion libs/ts-core/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@ts-pipeline/ts-core",
"version": "0.0.12"
"version": "0.0.13"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "core",
"description": "Setup your pipelines as code",
"version": "0.0.12",
"version": "0.0.13",
"license": "MIT",
"scripts": {
"start": "nx run node-example:build && node dist/apps/node-example/main.cjs",
Expand Down

0 comments on commit 241d4cd

Please sign in to comment.