@atomservice/core 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core.config.ts +2 -3
- package/src/core.consts.ts +1 -0
- package/src/core.types.ts +0 -1
- package/src/index.ts +1 -1
package/package.json
CHANGED
package/src/core.config.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs"
|
|
2
2
|
import { z } from "zod"
|
|
3
|
-
import {
|
|
3
|
+
import { ATOMSERVICE_DATA_DIR, CONFIG_PATH } from "./core.consts.ts"
|
|
4
4
|
import { UserError } from "./core.errors.ts"
|
|
5
5
|
import type { ResolvedAtomserviceConfig } from "./core.types.ts"
|
|
6
6
|
|
|
7
7
|
const UserConfigSchema = z.object({
|
|
8
|
-
root: z.string().optional(),
|
|
9
8
|
services: z.array(z.any()),
|
|
10
9
|
})
|
|
11
10
|
|
|
@@ -20,7 +19,7 @@ export async function loadConfig(): Promise<ResolvedAtomserviceConfig> {
|
|
|
20
19
|
const parsed = UserConfigSchema.parse(raw)
|
|
21
20
|
|
|
22
21
|
return {
|
|
23
|
-
root:
|
|
22
|
+
root: ATOMSERVICE_DATA_DIR,
|
|
24
23
|
services: parsed.services,
|
|
25
24
|
}
|
|
26
25
|
}
|
package/src/core.consts.ts
CHANGED
|
@@ -2,6 +2,7 @@ import os from "node:os"
|
|
|
2
2
|
import path from "node:path"
|
|
3
3
|
|
|
4
4
|
export const ATOMSERVICE_DIR = path.join(os.homedir(), ".atomservice")
|
|
5
|
+
export const ATOMSERVICE_DATA_DIR = path.join(ATOMSERVICE_DIR, "data")
|
|
5
6
|
export const CONFIG_PATH = path.join(ATOMSERVICE_DIR, "atom.config.ts")
|
|
6
7
|
|
|
7
8
|
export const YELLOW = Bun.color("#facc15", "ansi") ?? ""
|
package/src/core.types.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { loadConfig } from "./core.config.ts"
|
|
2
|
-
export { ATOMSERVICE_DIR } from "./core.consts.ts"
|
|
2
|
+
export { ATOMSERVICE_DATA_DIR, ATOMSERVICE_DIR } from "./core.consts.ts"
|
|
3
3
|
export { defineConfig, defineService } from "./core.define.ts"
|
|
4
4
|
export { UserError } from "./core.errors.ts"
|
|
5
5
|
export {
|