Skip to content

Commit

Permalink
Export internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
webNeat committed Sep 7, 2024
1 parent 5c1f59b commit 48daa3f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hosty",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.4",
"description": "A code based opinionated way to self-host and manage web apps.",
"type": "module",
"main": "dist/index.js",
Expand Down
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { instance } from './instance.js'
import * as blocks from './blocks/index.js'
import * as ansible from './ansible/index.js'

export * from './types.js'
export * from './services/index.js'
export { server } from './server.js'
export { assert } from './blocks/index.js'
export { instance }

export const { deploy, destroy, playbook, write, run } = instance()

export const internals = {ansible, blocks, instance}
7 changes: 0 additions & 7 deletions src/operations.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/services/assertions.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * as app from './app/index.js'
export * from './assertions.js'
export * from './tasks.js'
export * from './command.js'
export * from './container.js'
export * as db from './database/index.js'
6 changes: 6 additions & 0 deletions src/services/tasks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Tasks } from '../ansible/types.js'
import { TasksService } from '../types.js'

export function assertions(...tasks: Tasks): TasksService {
return { type: 'tasks', get_deploy_tasks: () => tasks, get_destroy_tasks: () => [] }
}
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export type CommandConfig = {

export type Command = Service<'command'> & CommandConfig

export type Assertions = Service<'assertions'>
export type TasksService = Service<'tasks'>

export type RunOptions = {
playbook_path: string
Expand Down
4 changes: 3 additions & 1 deletion tests/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as zx from 'zx'
import { ChildProcess } from 'child_process'
import { HostyInstance, Server, Service, assert, assertions, instance, server } from '../../src/index.js'
import { HostyInstance, Server, Service, assertions, server, internals } from '../../src/index.js'

const { instance, blocks: { assert } } = internals

type Assert = {
[K in keyof typeof assert]: (...args: Parameters<(typeof assert)[K]>) => void
Expand Down

0 comments on commit 48daa3f

Please sign in to comment.