@hyperfixation/cli 0.1.0 → 0.1.2
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/dist/app.d.ts +15 -2
- package/dist/app.js +4 -2
- package/dist/backup-source.d.ts +47 -0
- package/dist/backup-source.js +107 -0
- package/dist/bootstrap.d.ts +2 -0
- package/dist/bootstrap.js +1 -1
- package/dist/checklist.d.ts +25 -0
- package/dist/checklist.js +32 -0
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +95 -2
- package/dist/cloud-steps/backup.d.ts +17 -0
- package/dist/cloud-steps/backup.js +40 -0
- package/dist/cloud-steps/context.d.ts +120 -0
- package/dist/cloud-steps/context.js +88 -0
- package/dist/cloud-steps/coolify.d.ts +84 -0
- package/dist/cloud-steps/coolify.js +316 -0
- package/dist/cloud-steps/database.d.ts +12 -0
- package/dist/cloud-steps/database.js +25 -0
- package/dist/cloud-steps/deploy.d.ts +18 -0
- package/dist/cloud-steps/deploy.js +110 -0
- package/dist/cloud-steps/dns.d.ts +11 -0
- package/dist/cloud-steps/dns.js +53 -0
- package/dist/cloud-steps/index.d.ts +21 -0
- package/dist/cloud-steps/index.js +30 -0
- package/dist/cloud-steps/install.d.ts +12 -0
- package/dist/cloud-steps/install.js +53 -0
- package/dist/cloud-steps/langfuse.d.ts +17 -0
- package/dist/cloud-steps/langfuse.js +71 -0
- package/dist/cloud-steps/repo.d.ts +20 -0
- package/dist/cloud-steps/repo.js +198 -0
- package/dist/cloud-steps/sentry.d.ts +13 -0
- package/dist/cloud-steps/sentry.js +55 -0
- package/dist/cloud-steps/template.d.ts +22 -0
- package/dist/cloud-steps/template.js +68 -0
- package/dist/config.d.ts +65 -0
- package/dist/config.js +192 -0
- package/dist/database.d.ts +95 -0
- package/dist/database.js +226 -0
- package/dist/doctor.d.ts +72 -0
- package/dist/doctor.js +368 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -0
- package/dist/migrate.d.ts +11 -0
- package/dist/migrate.js +26 -2
- package/dist/new-cloud.d.ts +135 -0
- package/dist/new-cloud.js +219 -0
- package/dist/new.d.ts +2 -0
- package/dist/new.js +2 -1
- package/dist/providers/cloudflare.d.ts +49 -0
- package/dist/providers/cloudflare.js +27 -0
- package/dist/providers/coolify.d.ts +148 -0
- package/dist/providers/coolify.js +87 -0
- package/dist/providers/github.d.ts +117 -0
- package/dist/providers/github.js +98 -0
- package/dist/providers/http.d.ts +41 -0
- package/dist/providers/http.js +56 -0
- package/dist/providers/langfuse.d.ts +41 -0
- package/dist/providers/langfuse.js +29 -0
- package/dist/providers/sentry.d.ts +31 -0
- package/dist/providers/sentry.js +27 -0
- package/dist/provision-database.d.ts +42 -0
- package/dist/provision-database.js +107 -0
- package/dist/restore-check.d.ts +91 -0
- package/dist/restore-check.js +262 -0
- package/dist/runner.d.ts +72 -0
- package/dist/runner.js +221 -0
- package/dist/secret-file.d.ts +30 -0
- package/dist/secret-file.js +69 -0
- package/dist/state.d.ts +124 -0
- package/dist/state.js +217 -0
- package/dist/status-token.d.ts +2 -0
- package/dist/status-token.js +1 -1
- package/dist/template-source.d.ts +23 -0
- package/dist/template-source.js +23 -0
- package/package.json +10 -7
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Points `hf new` at a template checkout; what a CI job or a second checkout sets. */
|
|
2
2
|
export declare const TEMPLATE_DIR_ENV = "HF_TEMPLATE_DIR";
|
|
3
|
+
/** What a cloud `hf new` fetches when `--from` is absent; giget's `gh:` provider resolves it. */
|
|
4
|
+
export declare const TEMPLATE_REPOSITORY = "gh:grahamlutz/hyperfixation-template";
|
|
3
5
|
/**
|
|
4
6
|
* Where `hf new --local` looks when `--from` is not given: the environment, then the sibling
|
|
5
7
|
* checkout beside the working directory, then the sibling beside this package's own repo.
|
|
@@ -14,3 +16,24 @@ export declare const TEMPLATE_DIR_ENV = "HF_TEMPLATE_DIR";
|
|
|
14
16
|
export declare function findTemplateSource(cwd?: string): Promise<string | undefined>;
|
|
15
17
|
/** The same search, but a miss is the error the user has to act on rather than `undefined`. */
|
|
16
18
|
export declare function requireTemplateSource(cwd?: string): Promise<string>;
|
|
19
|
+
/** giget's `downloadTemplate`, narrowed to what `fetchTemplate` asks of it so a test can be one. */
|
|
20
|
+
export type TemplateDownload = (source: string, options: {
|
|
21
|
+
dir: string;
|
|
22
|
+
force: boolean;
|
|
23
|
+
}) => Promise<{
|
|
24
|
+
dir: string;
|
|
25
|
+
}>;
|
|
26
|
+
export interface FetchTemplateOptions {
|
|
27
|
+
/** Replaces the real download; the tests never reach the network. */
|
|
28
|
+
download?: TemplateDownload;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Fetches the template into `dir` — the cloud path's counterpart to `requireTemplateSource`.
|
|
32
|
+
*
|
|
33
|
+
* `source` is a giget specifier (`gh:owner/repo`, optionally `#ref`), defaulting to
|
|
34
|
+
* `TEMPLATE_REPOSITORY`; `--from` passes whatever the operator typed straight through, so a
|
|
35
|
+
* branch or a fork needs no flag of its own. What arrives is checked for `TEMPLATE_MARKER`
|
|
36
|
+
* before `newApp` is let near it: a specifier that resolves to some other repository would
|
|
37
|
+
* otherwise be copied, substituted and committed as an app.
|
|
38
|
+
*/
|
|
39
|
+
export declare function fetchTemplate(source: string | undefined, dir: string, options?: FetchTemplateOptions): Promise<string>;
|
package/dist/template-source.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { stat } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { downloadTemplate } from "giget";
|
|
4
5
|
import { TEMPLATE_MARKER, TemplateError } from "./new.js";
|
|
5
6
|
/** Points `hf new` at a template checkout; what a CI job or a second checkout sets. */
|
|
6
7
|
export const TEMPLATE_DIR_ENV = "HF_TEMPLATE_DIR";
|
|
8
|
+
/** What a cloud `hf new` fetches when `--from` is absent; giget's `gh:` provider resolves it. */
|
|
9
|
+
export const TEMPLATE_REPOSITORY = "gh:grahamlutz/hyperfixation-template";
|
|
7
10
|
/**
|
|
8
11
|
* Where `hf new --local` looks when `--from` is not given: the environment, then the sibling
|
|
9
12
|
* checkout beside the working directory, then the sibling beside this package's own repo.
|
|
@@ -36,6 +39,26 @@ export async function requireTemplateSource(cwd) {
|
|
|
36
39
|
}
|
|
37
40
|
return found;
|
|
38
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Fetches the template into `dir` — the cloud path's counterpart to `requireTemplateSource`.
|
|
44
|
+
*
|
|
45
|
+
* `source` is a giget specifier (`gh:owner/repo`, optionally `#ref`), defaulting to
|
|
46
|
+
* `TEMPLATE_REPOSITORY`; `--from` passes whatever the operator typed straight through, so a
|
|
47
|
+
* branch or a fork needs no flag of its own. What arrives is checked for `TEMPLATE_MARKER`
|
|
48
|
+
* before `newApp` is let near it: a specifier that resolves to some other repository would
|
|
49
|
+
* otherwise be copied, substituted and committed as an app.
|
|
50
|
+
*/
|
|
51
|
+
export async function fetchTemplate(source, dir, options = {}) {
|
|
52
|
+
const specifier = source ?? TEMPLATE_REPOSITORY;
|
|
53
|
+
const download = options.download ?? defaultDownload;
|
|
54
|
+
const target = path.resolve(dir);
|
|
55
|
+
const { dir: fetched } = await download(specifier, { dir: target, force: true });
|
|
56
|
+
if (!(await isTemplate(fetched))) {
|
|
57
|
+
throw new TemplateError(`${specifier} has no ${TEMPLATE_MARKER}: it is not the hyperfixation template`);
|
|
58
|
+
}
|
|
59
|
+
return fetched;
|
|
60
|
+
}
|
|
61
|
+
const defaultDownload = async (source, options) => await downloadTemplate(source, { ...options, silent: true });
|
|
39
62
|
async function isTemplate(dir) {
|
|
40
63
|
try {
|
|
41
64
|
return (await stat(path.join(dir, TEMPLATE_MARKER))).isFile();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperfixation/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The hf binary and its Turborepo generator templates",
|
|
6
6
|
"repository": {
|
|
@@ -29,17 +29,20 @@
|
|
|
29
29
|
"!dist/test-support/**"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hyperfixation/auth": "0.1.
|
|
33
|
-
"@hyperfixation/core": "0.1.
|
|
34
|
-
"@hyperfixation/db": "0.1.
|
|
32
|
+
"@hyperfixation/auth": "0.1.2",
|
|
33
|
+
"@hyperfixation/core": "0.1.2",
|
|
34
|
+
"@hyperfixation/db": "0.1.2",
|
|
35
|
+
"giget": "3.3.1",
|
|
35
36
|
"pg": "^8.23.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@hyperfixation/eslint-config": "0.1.
|
|
39
|
-
"@hyperfixation/testing": "0.1.
|
|
39
|
+
"@hyperfixation/eslint-config": "0.1.2",
|
|
40
|
+
"@hyperfixation/testing": "0.1.2",
|
|
40
41
|
"@microsoft/api-extractor": "^7.59.1",
|
|
41
42
|
"@types/pg": "^8.23.1",
|
|
42
|
-
"eslint": "^10.10.0"
|
|
43
|
+
"eslint": "^10.10.0",
|
|
44
|
+
"msw": "2.15.0",
|
|
45
|
+
"openapi-request-validator": "12.1.3"
|
|
43
46
|
},
|
|
44
47
|
"scripts": {
|
|
45
48
|
"build": "tsc -p tsconfig.json",
|