Skip to content

Commit a5e021a

Browse files
authored
Merge pull request #3 from webNeat/develop
Export internal functions
2 parents 5c1f59b + 48daa3f commit a5e021a

File tree

8 files changed

+16
-19
lines changed

8 files changed

+16
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hosty",
3-
"version": "0.0.1-alpha.3",
3+
"version": "0.0.1-alpha.4",
44
"description": "A code based opinionated way to self-host and manage web apps.",
55
"type": "module",
66
"main": "dist/index.js",

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { instance } from './instance.js'
2+
import * as blocks from './blocks/index.js'
3+
import * as ansible from './ansible/index.js'
24

35
export * from './types.js'
46
export * from './services/index.js'
57
export { server } from './server.js'
6-
export { assert } from './blocks/index.js'
7-
export { instance }
88

99
export const { deploy, destroy, playbook, write, run } = instance()
10+
11+
export const internals = {ansible, blocks, instance}

src/operations.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/services/assertions.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/services/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export * as app from './app/index.js'
2-
export * from './assertions.js'
2+
export * from './tasks.js'
33
export * from './command.js'
44
export * from './container.js'
55
export * as db from './database/index.js'

src/services/tasks.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Tasks } from '../ansible/types.js'
2+
import { TasksService } from '../types.js'
3+
4+
export function assertions(...tasks: Tasks): TasksService {
5+
return { type: 'tasks', get_deploy_tasks: () => tasks, get_destroy_tasks: () => [] }
6+
}

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export type CommandConfig = {
129129

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

132-
export type Assertions = Service<'assertions'>
132+
export type TasksService = Service<'tasks'>
133133

134134
export type RunOptions = {
135135
playbook_path: string

tests/utils/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as zx from 'zx'
22
import { ChildProcess } from 'child_process'
3-
import { HostyInstance, Server, Service, assert, assertions, instance, server } from '../../src/index.js'
3+
import { HostyInstance, Server, Service, assertions, server, internals } from '../../src/index.js'
4+
5+
const { instance, blocks: { assert } } = internals
46

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

0 commit comments

Comments
 (0)