@tailor-platform/sdk 1.67.1 → 1.69.0
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/CHANGELOG.md +98 -1
- package/dist/application-Br48NXBD.mjs +4 -0
- package/dist/application-Cr-limKC.mjs +6192 -0
- package/dist/application-Cr-limKC.mjs.map +1 -0
- package/dist/cli/index.mjs +147 -34
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +297 -157
- package/dist/cli/lib.mjs +4 -4
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/skills.mjs +1 -1
- package/dist/completion/zsh-worker.zsh +127 -48
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +4 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{crashreport-u9y2npiy.mjs → crashreport-BqyvFk-_.mjs} +2 -2
- package/dist/{crashreport-u9y2npiy.mjs.map → crashreport-BqyvFk-_.mjs.map} +1 -1
- package/dist/{crashreport-6jpCceOF.mjs → crashreport-BwF8cHF0.mjs} +1 -1
- package/dist/enum-constants-C7DaWeQo.mjs.map +1 -1
- package/dist/field-C4zdJLW5.mjs.map +1 -1
- package/dist/file-utils-BHPxPXmn.mjs.map +1 -1
- package/dist/{idp-BlBPtXJ-.d.mts → idp-BmYwCXnJ.d.mts} +30 -3
- package/dist/{idp-BZPqpcYY.mjs → idp-ynUfzwpz.mjs} +9 -1
- package/dist/idp-ynUfzwpz.mjs.map +1 -0
- package/dist/{index-DvEUb3pX.d.mts → index-B7VbJm0_.d.mts} +25 -16
- package/dist/{index-DRhMpdnA.d.mts → index-dKNk8hjo.d.mts} +2 -2
- package/dist/job-BpsFXPbi.mjs.map +1 -1
- package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-CSoZxVKN.mjs} +2 -2
- package/dist/{kysely-type-D1e0Vwkd.mjs.map → kysely-type-CSoZxVKN.mjs.map} +1 -1
- package/dist/{logger-DpJyJvNz.mjs → logger-DKF-JsAK.mjs} +3 -3
- package/dist/{logger-DpJyJvNz.mjs.map → logger-DKF-JsAK.mjs.map} +1 -1
- package/dist/{mock-DMgIygjE.mjs → mock-wf5qeZLi.mjs} +19 -9
- package/dist/mock-wf5qeZLi.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/registry-D0uB0OrK.mjs.map +1 -1
- package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-DD5YP5mt.mjs} +4 -4
- package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-DD5YP5mt.mjs.map} +1 -1
- package/dist/runtime/globals.d.mts +3 -2
- package/dist/runtime/idp.d.mts +2 -2
- package/dist/runtime/idp.mjs +1 -1
- package/dist/runtime/index.d.mts +2 -2
- package/dist/runtime/index.mjs +1 -1
- package/dist/{runtime-BU6KtCvk.mjs → runtime-jowoN6qC.mjs} +803 -226
- package/dist/runtime-jowoN6qC.mjs.map +1 -0
- package/dist/schema-1msIhXwA.mjs.map +1 -1
- package/dist/seed-YAbtMy65.mjs.map +1 -1
- package/dist/{service-wI3Hvrgx.mjs → service-B2Jd9CxS.mjs} +2 -2
- package/dist/service-B2Jd9CxS.mjs.map +1 -0
- package/dist/service-CRaa4Joe.mjs +4 -0
- package/dist/{service-DMohAx8a.mjs → service-DDWgZL_L2.mjs} +2 -2
- package/dist/service-DDWgZL_L2.mjs.map +1 -0
- package/dist/service_pb-DGSmn-aF.mjs +4 -0
- package/dist/{application-WpWwTyk9.mjs → service_pb-DSNjrcbW.mjs} +22 -6176
- package/dist/service_pb-DSNjrcbW.mjs.map +1 -0
- package/dist/telemetry-BQbbVo2t.mjs.map +1 -1
- package/dist/types-CmzfQP_m.mjs.map +1 -1
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs +4 -4
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workflow.generated-1S50BhEb.d.mts → workflow.generated-Br9bmLdX.d.mts} +98 -3
- package/docs/cli/application.md +5 -202
- package/docs/cli/auth.md +12 -256
- package/docs/cli/completion.md +0 -24
- package/docs/cli/crashreport.md +0 -58
- package/docs/cli/executor.md +53 -164
- package/docs/cli/function.md +2 -118
- package/docs/cli/organization.md +1 -211
- package/docs/cli/query.md +0 -20
- package/docs/cli/secret.md +70 -250
- package/docs/cli/setup.md +21 -59
- package/docs/cli/skills.md +0 -39
- package/docs/cli/staticwebsite.md +24 -172
- package/docs/cli/tailordb.md +5 -255
- package/docs/cli/upgrade.md +0 -20
- package/docs/cli/user.md +32 -247
- package/docs/cli/workflow.md +139 -161
- package/docs/cli/workspace.md +158 -537
- package/docs/cli-reference.md +59 -40
- package/docs/configuration.md +7 -1
- package/docs/github-actions.md +27 -14
- package/docs/services/idp.md +55 -2
- package/docs/services/staticwebsite.md +7 -1
- package/package.json +23 -18
- package/dist/application-Djeezk3m.mjs +0 -4
- package/dist/application-WpWwTyk9.mjs.map +0 -1
- package/dist/idp-BZPqpcYY.mjs.map +0 -1
- package/dist/mock-DMgIygjE.mjs.map +0 -1
- package/dist/runtime-BU6KtCvk.mjs.map +0 -1
- package/dist/service-BHQIerYh.mjs +0 -4
- package/dist/service-DMohAx8a.mjs.map +0 -1
- package/dist/service-wI3Hvrgx.mjs.map +0 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { C as CustomDomainStatus, R as FunctionExecution_Type, ft as AuthInvokerSchema, yt as PATScope } from "../service_pb-DSNjrcbW.mjs";
|
|
4
4
|
import { t as assertDefined } from "../assert-CKfwrmCV.mjs";
|
|
5
|
-
import { n as logger, r as styles } from "../logger-
|
|
6
|
-
import { $ as
|
|
7
|
-
import {
|
|
5
|
+
import { n as logger, r as styles } from "../logger-DKF-JsAK.mjs";
|
|
6
|
+
import { $ as updateCommand$2, $t as protoGqlPermission, A as listCommand$12, At as jobsCommand, Bn as toPageDirection, Bt as functionExecutionStatusToString, C as listCommand$13, Cn as ensureConfigId, Ct as webhookCommand, Dn as generateUserTypes, E as waitCommand, En as PluginManager, Et as listCommand$6, F as generateCommand$1, Fn as confirmationArgs, Ft as getCommand$6, G as updateCommand$3, Gt as executeScript, H as logBetaWarning, Ht as getCommand$1, I as generateMigrationScript, In as deploymentArgs, J as treeCommand, Jt as MIGRATION_LABEL_KEY, L as writeDbTypesFile, Ln as isVerbose, Lt as executionsCommand, Mn as defineAppCommand, N as truncateCommand, Nn as commonArgs, Nt as startCommand, O as resumeCommand, On as prompt, Pn as configArg, Qt as generateAllTypeManifestsFromSnapshot, R as getConfiguredEditorCommand, Rn as pagedLogArgs, Sn as getNamespacesWithMigrations, T as healthCommand, Tn as sdkNameLabelKey, V as showCommand, Vn as workspaceArgs, Vt as formatKeyValueTable, W as removeCommand$1, Wt as deploy, Xt as parseMigrationLabelNumber, Y as listCommand$11, Yt as handleOptionalToRequiredError, Z as getCommand$5, Zt as compareSnapshotWithRemote, _n as formatMigrationNumber, _t as generate, an as assertValidMigrationFiles, at as deleteCommand$3, b as createCommand$4, bn as formatMigrationDiff, bt as getCommand$2, c as listCommand$14, cn as createSnapshotFromLocalTypes, dn as getMigrationFilePath, dt as getCommand$3, f as restoreCommand, fn as getMigrationFiles, g as getCommand$7, gn as reconstructSnapshotFromMigrations, hn as loadDiff, ht as listCommand$8, i as updateCommand$4, jn as assertWritable, kn as apiCommand, ln as getLatestMigrationNumber, lt as listCommand$9, m as listCommand$15, mn as isValidMigrationNumber, mt as tokenCommand, nn as INITIAL_SCHEMA_NUMBER, o as removeCommand, on as compareLocalTypesWithSnapshot, r as queryCommand, rt as getCommand$4, st as createCommand$3, t as isNativeTypeScriptRuntime, tt as listCommand$10, u as inviteCommand, v as deleteCommand$4, vn as parseMigrationNumberArg, vt as listCommand$7, wn as resourceTrn, wt as triggerCommand, xn as hasChanges, z as openInConfiguredEditor, zn as paginationArgs } from "../runtime-jowoN6qC.mjs";
|
|
7
|
+
import { A as loadMachineUserName, B as fetchPlatformMachineUserToken, C as hashContent$1, D as fetchLatestToken, E as deleteUserTokens, F as writePlatformConfig, H as initOAuth2Client, I as closeConnectionPool, L as fetchAll, M as readPlatformConfig, N as resolveTokens, O as loadAccessToken, P as saveUserTokens, S as getDistDir, T as loadConfig, U as initOperatorClient, V as fetchUserInfo, _ as createLogLevelTreeshakeOptions, a as WorkflowJobSchema, c as INVOKER_EXPR, g as composeFunctionTreeshakeOptions, h as platformBundleDefinePlugin, i as resolveInlineSourcemap, j as loadWorkspaceId, o as ResolverSchema, t as defineApplication, v as resolveBundleLogLevel, z as fetchPaged } from "../application-Cr-limKC.mjs";
|
|
8
|
+
import { n as ExecutorSchema } from "../service-B2Jd9CxS.mjs";
|
|
8
9
|
import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
|
|
9
10
|
import { r as isPluginGeneratedType } from "../seed-YAbtMy65.mjs";
|
|
10
11
|
import { t as readPackageJson } from "../package-json-DcQApfPQ.mjs";
|
|
11
12
|
import { i as userAgent } from "../secret-file-eB3R3Fil.mjs";
|
|
12
13
|
import { n as isCLIError } from "../errors-EsY4XO6O.mjs";
|
|
13
|
-
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crashreport-
|
|
14
|
+
import { a as JSON_FOOTER_MARKER, i as CRASH_LOG_EXTENSION, o as parseCrashReportConfig, r as sendCrashReport, t as initCrashReporting } from "../crashreport-BqyvFk-_.mjs";
|
|
14
15
|
import { arg, defineCommand, runCommand, runMain } from "politty";
|
|
15
16
|
import { withCompletionCommand } from "politty/completion";
|
|
16
17
|
import { z } from "zod";
|
|
@@ -31,12 +32,12 @@ import open from "open";
|
|
|
31
32
|
import * as rolldown from "rolldown";
|
|
32
33
|
import * as fsPromises from "node:fs/promises";
|
|
33
34
|
import { glob } from "node:fs/promises";
|
|
35
|
+
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
34
36
|
import { TraceMap, generatedPositionFor, originalPositionFor } from "@jridgewell/trace-mapping";
|
|
35
37
|
import { spawn, spawnSync } from "node:child_process";
|
|
36
38
|
import { watch } from "chokidar";
|
|
37
39
|
import * as fs from "fs";
|
|
38
40
|
import { lookup } from "mime-types";
|
|
39
|
-
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
40
41
|
|
|
41
42
|
//#region src/cli/commands/authconnection/args.ts
|
|
42
43
|
/**
|
|
@@ -2609,7 +2610,7 @@ const secretCommand = defineCommand({
|
|
|
2609
2610
|
});
|
|
2610
2611
|
|
|
2611
2612
|
//#endregion
|
|
2612
|
-
//#region src/cli/commands/setup/
|
|
2613
|
+
//#region src/cli/commands/setup/git.ts
|
|
2613
2614
|
const defaultGitRunner = (args, cwd) => {
|
|
2614
2615
|
const result = spawnSync("git", args, {
|
|
2615
2616
|
cwd,
|
|
@@ -2640,7 +2641,7 @@ function detectDefaultBranch(cwd, run = defaultGitRunner) {
|
|
|
2640
2641
|
}
|
|
2641
2642
|
|
|
2642
2643
|
//#endregion
|
|
2643
|
-
//#region src/cli/commands/setup/
|
|
2644
|
+
//#region src/cli/commands/setup/lock.ts
|
|
2644
2645
|
/** Current lock schema version. Bumped only on breaking lock-format changes. */
|
|
2645
2646
|
const LOCK_VERSION = 1;
|
|
2646
2647
|
/** Lock file path, relative to the repository root. */
|
|
@@ -2706,21 +2707,21 @@ function findTarget(lock, kind, workspaceName) {
|
|
|
2706
2707
|
}
|
|
2707
2708
|
|
|
2708
2709
|
//#endregion
|
|
2709
|
-
//#region src/cli/commands/setup/
|
|
2710
|
-
var branch_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n # __PULL_REQUEST_START__\n pull_request:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n # __PULL_REQUEST_END__\n push:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n workflow_dispatch:\n # __DISPATCH_INPUTS_START__\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n # __DISPATCH_INPUTS_END__\n\npermissions:\n contents: read\n\njobs:\n # __PLAN_JOB_START__\n tailor-plan:\n if: >-\n github.event_name == 'pull_request' ||\n (github.event_name == 'workflow_dispatch' && inputs['dry-run'])\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n pull-requests: write\n concurrency:\n group: tailor-plan-__WORKSPACE_NAME__-${{ github.event.pull_request.number || github.run_id }}\n cancel-in-progress: true\n steps:\n - id: tailor-checkout\n uses: actions/checkout@
|
|
2710
|
+
//#region src/cli/commands/setup/branch.workflow.yml
|
|
2711
|
+
var branch_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n # __PULL_REQUEST_START__\n pull_request:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n # __PULL_REQUEST_END__\n push:\n branches: [\"__BRANCH__\"]\n # __PATHS__\n workflow_dispatch:\n # __DISPATCH_INPUTS_START__\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n # __DISPATCH_INPUTS_END__\n\npermissions:\n contents: read\n\njobs:\n # __PLAN_JOB_START__\n tailor-plan:\n if: >-\n github.event_name == 'pull_request' ||\n (github.event_name == 'workflow_dispatch' && inputs['dry-run'])\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n pull-requests: write\n concurrency:\n group: tailor-plan-__WORKSPACE_NAME__-${{ github.event.pull_request.number || github.run_id }}\n cancel-in-progress: true\n steps:\n - id: tailor-checkout\n uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n - id: tailor-setup\n uses: tailor-platform/actions/setup@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n package-manager: __PACKAGE_MANAGER__\n - id: tailor-generate-check\n uses: tailor-platform/actions/generate-check@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n package-manager: __PACKAGE_MANAGER__\n # __WORKING_DIRECTORY__\n - id: tailor-plan\n # Fork PRs cannot read secrets; the checks above still run for them.\n if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork\n uses: tailor-platform/actions/plan@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n workspace-id: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n package-manager: __PACKAGE_MANAGER__\n label: __WORKSPACE_NAME__\n # __WORKING_DIRECTORY__\n platform-client-id: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n platform-client-secret: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n github-token: ${{ secrets.GITHUB_TOKEN }}\n # __PLAN_JOB_END__\n tailor-deploy:\n # __DEPLOY_IF__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n permissions:\n contents: read\n environment: __ENVIRONMENT__\n concurrency:\n group: tailor-deploy-__WORKSPACE_NAME__\n cancel-in-progress: false\n steps:\n - id: tailor-checkout\n uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n - id: tailor-setup\n uses: tailor-platform/actions/setup@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n package-manager: __PACKAGE_MANAGER__\n - id: tailor-apply\n uses: tailor-platform/actions/deploy@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n workspace-id: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n package-manager: __PACKAGE_MANAGER__\n # __WORKING_DIRECTORY__\n platform-client-id: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n platform-client-secret: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n";
|
|
2711
2712
|
|
|
2712
2713
|
//#endregion
|
|
2713
|
-
//#region src/cli/commands/setup/
|
|
2714
|
-
var tag_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n push:\n tags: [\"__TAG_PATTERN__\"]\n workflow_dispatch:\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n\npermissions:\n contents: read\n\njobs:\n # __TAG_GUARD_JOB_START__\n tailor-tag-guard:\n runs-on: ubuntu-latest\n timeout-minutes: 10\n permissions:\n contents: read\n outputs:\n on-branch: ${{ steps.tailor-tag-guard.outputs.on-branch }}\n steps:\n - id: tailor-checkout\n uses: actions/checkout@
|
|
2714
|
+
//#region src/cli/commands/setup/tag.workflow.yml
|
|
2715
|
+
var tag_workflow_default = "# __HEADER__\nname: Tailor (__WORKSPACE_NAME__)\n\non:\n push:\n tags: [\"__TAG_PATTERN__\"]\n workflow_dispatch:\n inputs:\n dry-run:\n description: Preview changes without deploying\n type: boolean\n default: false\n\npermissions:\n contents: read\n\njobs:\n # __TAG_GUARD_JOB_START__\n tailor-tag-guard:\n runs-on: ubuntu-latest\n timeout-minutes: 10\n permissions:\n contents: read\n outputs:\n on-branch: ${{ steps.tailor-tag-guard.outputs.on-branch }}\n steps:\n - id: tailor-checkout\n uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n with:\n fetch-depth: 0\n - id: tailor-tag-guard\n uses: tailor-platform/actions/tag-guard@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n target-branch: \"__BRANCH__\"\n # __TAG_GUARD_JOB_END__\n tailor-plan:\n # __PLAN_NEEDS__\n # __PLAN_IF__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n environment: __ENVIRONMENT__\n permissions:\n contents: read\n steps:\n - id: tailor-checkout\n uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n - id: tailor-setup\n uses: tailor-platform/actions/setup@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n package-manager: __PACKAGE_MANAGER__\n - id: tailor-generate-check\n uses: tailor-platform/actions/generate-check@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n package-manager: __PACKAGE_MANAGER__\n # __WORKING_DIRECTORY__\n - id: tailor-plan\n uses: tailor-platform/actions/plan@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n workspace-id: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n package-manager: __PACKAGE_MANAGER__\n label: __WORKSPACE_NAME__\n # __WORKING_DIRECTORY__\n platform-client-id: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n platform-client-secret: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n\n tailor-deploy:\n needs: tailor-plan\n if: ${{ !(github.event_name == 'workflow_dispatch' && inputs['dry-run']) }}\n environment: __ENVIRONMENT__\n runs-on: ubuntu-latest\n timeout-minutes: 30\n permissions:\n contents: read\n concurrency:\n group: tailor-deploy-__WORKSPACE_NAME__\n cancel-in-progress: false\n steps:\n - id: tailor-checkout\n uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n - id: tailor-setup\n uses: tailor-platform/actions/setup@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n package-manager: __PACKAGE_MANAGER__\n - id: tailor-apply\n uses: tailor-platform/actions/deploy@7817f37adf2891fbb2ebbe0a3b222a5fa2ed0c1f # v1.3.0\n with:\n workspace-id: ${{ vars.TAILOR_PLATFORM_WORKSPACE_ID }}\n package-manager: __PACKAGE_MANAGER__\n # __WORKING_DIRECTORY__\n platform-client-id: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID }}\n platform-client-secret: ${{ secrets.TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET }}\n";
|
|
2715
2716
|
|
|
2716
2717
|
//#endregion
|
|
2717
|
-
//#region src/cli/commands/setup/
|
|
2718
|
-
const HEADER = `# Generated by \`tailor-sdk setup
|
|
2718
|
+
//#region src/cli/commands/setup/templates.ts
|
|
2719
|
+
const HEADER = `# Generated by \`tailor-sdk setup\` — managed by the Tailor SDK.
|
|
2719
2720
|
#
|
|
2720
2721
|
# - Jobs and steps whose id starts with \`tailor-\` are managed by the SDK.
|
|
2721
2722
|
# Do not edit or rename them.
|
|
2722
2723
|
# - State is tracked in .github/tailor-sdk.lock (machine-owned: commit it, never edit it).
|
|
2723
|
-
# - Re-running \`tailor-sdk setup
|
|
2724
|
+
# - Re-running \`tailor-sdk setup\` regenerates this file. If you have
|
|
2724
2725
|
# edited it by hand, regeneration stops and asks for --force (which discards
|
|
2725
2726
|
# your edits), so prefer keeping customizations in your own jobs/steps and
|
|
2726
2727
|
# re-running setup after SDK updates.`;
|
|
@@ -2806,7 +2807,110 @@ function renderTagWorkflow(params) {
|
|
|
2806
2807
|
}
|
|
2807
2808
|
|
|
2808
2809
|
//#endregion
|
|
2809
|
-
//#region src/cli/commands/setup/
|
|
2810
|
+
//#region src/cli/commands/setup/check.ts
|
|
2811
|
+
/**
|
|
2812
|
+
* Compute drift findings for one target by comparing its recorded lock state
|
|
2813
|
+
* against the current repository/config state.
|
|
2814
|
+
* @param target - The lock target being audited
|
|
2815
|
+
* @param state - Current repository/config state for this target
|
|
2816
|
+
* @returns Drift findings (empty when the target is in sync)
|
|
2817
|
+
*/
|
|
2818
|
+
function findTargetDrift(target, state) {
|
|
2819
|
+
const id = `${target.kind} ${target.workspaceName}`;
|
|
2820
|
+
const findings = [];
|
|
2821
|
+
if (!state.fileExists) findings.push({
|
|
2822
|
+
target: id,
|
|
2823
|
+
rule: "missing-file",
|
|
2824
|
+
message: `${target.file} is missing or unreadable. Re-run setup to restore it.`
|
|
2825
|
+
});
|
|
2826
|
+
else if (state.currentHash !== null && state.currentHash !== target.contentHash) findings.push({
|
|
2827
|
+
target: id,
|
|
2828
|
+
rule: "hand-edit",
|
|
2829
|
+
message: `${target.file} was edited by hand since it was generated. Re-run setup with --force to regenerate, or keep customizations in your own jobs/steps.`
|
|
2830
|
+
});
|
|
2831
|
+
if (target.templateVersion < state.templateVersion) findings.push({
|
|
2832
|
+
target: id,
|
|
2833
|
+
rule: "template-version",
|
|
2834
|
+
message: `A newer workflow template is available (generated with v${String(target.templateVersion)}, current v${String(state.templateVersion)}). Re-run setup to update.`
|
|
2835
|
+
});
|
|
2836
|
+
if (!state.configExists) findings.push({
|
|
2837
|
+
target: id,
|
|
2838
|
+
rule: "config-dir",
|
|
2839
|
+
message: `tailor.config.ts not found under "${target.inputs.dir}". The app directory may have moved; re-run setup with the correct --dir.`
|
|
2840
|
+
});
|
|
2841
|
+
if (target.kind === "branch" && target.inputs.branchAutoDetected !== false && state.defaultBranch !== null && target.inputs.branch !== null && target.inputs.branch !== state.defaultBranch) findings.push({
|
|
2842
|
+
target: id,
|
|
2843
|
+
rule: "default-branch",
|
|
2844
|
+
message: `The workflow triggers on "${target.inputs.branch}" but the repository default branch is now "${state.defaultBranch}". If this is intentional, ignore this; otherwise re-run setup so the trigger matches the default branch.`
|
|
2845
|
+
});
|
|
2846
|
+
return findings;
|
|
2847
|
+
}
|
|
2848
|
+
function detectDefaultBranchSafe(cwd, run) {
|
|
2849
|
+
try {
|
|
2850
|
+
return detectDefaultBranch(cwd, run);
|
|
2851
|
+
} catch {
|
|
2852
|
+
return null;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
function escapesRoot$1(rel) {
|
|
2856
|
+
return path.isAbsolute(rel) || rel === ".." || rel.startsWith(`..${path.sep}`) || rel.startsWith("../");
|
|
2857
|
+
}
|
|
2858
|
+
function resolveWithinRoot(outputDir, relPath) {
|
|
2859
|
+
if (path.isAbsolute(relPath)) return null;
|
|
2860
|
+
const abs = path.join(outputDir, relPath);
|
|
2861
|
+
if (escapesRoot$1(path.relative(outputDir, abs))) return null;
|
|
2862
|
+
try {
|
|
2863
|
+
if (escapesRoot$1(path.relative(fs$1.realpathSync(outputDir), fs$1.realpathSync(abs)))) return null;
|
|
2864
|
+
} catch {}
|
|
2865
|
+
return abs;
|
|
2866
|
+
}
|
|
2867
|
+
function readHash(absFile) {
|
|
2868
|
+
try {
|
|
2869
|
+
return hashContent(fs$1.readFileSync(absFile, "utf-8"));
|
|
2870
|
+
} catch {
|
|
2871
|
+
return null;
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
/**
|
|
2875
|
+
* Audit the generated workflows for drift against the current config/repo
|
|
2876
|
+
* state. Read-only: never writes files, the lock, or the config.
|
|
2877
|
+
*
|
|
2878
|
+
* Throws when drift is found (so it composes like the other `:check`
|
|
2879
|
+
* commands). The workflow drift-check step layers advisory behaviour on top
|
|
2880
|
+
* (per-rule ignore / continue-on-error); the CLI itself reports via exit code.
|
|
2881
|
+
* @param options - Check options
|
|
2882
|
+
*/
|
|
2883
|
+
function checkGitHub(options) {
|
|
2884
|
+
logBetaWarning("setup");
|
|
2885
|
+
const { outputDir } = options;
|
|
2886
|
+
const lock = readLock(outputDir);
|
|
2887
|
+
if (!lock || lock.targets.length === 0) throw new Error("No managed workflows found (.github/tailor-sdk.lock is missing or empty). Run `tailor-sdk setup` first.");
|
|
2888
|
+
const exists = options.configExistsAt ?? ((p) => fs$1.existsSync(p));
|
|
2889
|
+
const defaultBranch = detectDefaultBranchSafe(outputDir, options.gitRunner);
|
|
2890
|
+
const findings = [];
|
|
2891
|
+
for (const target of lock.targets) {
|
|
2892
|
+
const absFile = resolveWithinRoot(outputDir, target.file);
|
|
2893
|
+
const currentHash = absFile === null ? null : readHash(absFile);
|
|
2894
|
+
const configAbs = resolveWithinRoot(outputDir, path.join(target.inputs.dir, "tailor.config.ts"));
|
|
2895
|
+
findings.push(...findTargetDrift(target, {
|
|
2896
|
+
fileExists: currentHash !== null,
|
|
2897
|
+
currentHash,
|
|
2898
|
+
configExists: configAbs !== null && exists(configAbs),
|
|
2899
|
+
defaultBranch,
|
|
2900
|
+
templateVersion: 2
|
|
2901
|
+
}));
|
|
2902
|
+
}
|
|
2903
|
+
const count = lock.targets.length;
|
|
2904
|
+
if (findings.length === 0) {
|
|
2905
|
+
logger.success(`No drift detected across ${String(count)} target(s).`);
|
|
2906
|
+
return;
|
|
2907
|
+
}
|
|
2908
|
+
for (const finding of findings) logger.warn(`[${finding.target}] ${finding.message} (ignore key: ${finding.rule})`);
|
|
2909
|
+
throw new Error(`Detected ${String(findings.length)} drift finding(s) across ${String(count)} target(s). Re-run \`tailor-sdk setup\` to regenerate, or address each finding above.`);
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
//#endregion
|
|
2913
|
+
//#region src/cli/commands/setup/generate.ts
|
|
2810
2914
|
async function defaultLoadConfigName(configPath) {
|
|
2811
2915
|
const { config } = await loadConfig(configPath);
|
|
2812
2916
|
return config.name;
|
|
@@ -2878,8 +2982,10 @@ async function resolve$1(options) {
|
|
|
2878
2982
|
validateEnvironment(environment);
|
|
2879
2983
|
if (kind === "tag") validateTagPattern(options.tagPattern);
|
|
2880
2984
|
let branch = null;
|
|
2985
|
+
let branchAutoDetected = false;
|
|
2881
2986
|
let render;
|
|
2882
2987
|
if (kind === "branch") {
|
|
2988
|
+
branchAutoDetected = options.branch === void 0;
|
|
2883
2989
|
branch = options.branch ?? detectDefaultBranch(options.outputDir, options.gitRunner);
|
|
2884
2990
|
validateBranch(branch);
|
|
2885
2991
|
render = renderBranchWorkflow({
|
|
@@ -2905,6 +3011,7 @@ async function resolve$1(options) {
|
|
|
2905
3011
|
const file = `.github/workflows/tailor-${workspaceName}.yml`;
|
|
2906
3012
|
const inputs = {
|
|
2907
3013
|
branch,
|
|
3014
|
+
branchAutoDetected: kind === "branch" ? branchAutoDetected : void 0,
|
|
2908
3015
|
tagPattern: kind === "tag" ? options.tagPattern : null,
|
|
2909
3016
|
environment,
|
|
2910
3017
|
dir,
|
|
@@ -2993,7 +3100,7 @@ function printNextSteps(obj) {
|
|
|
2993
3100
|
* @param options - Setup options
|
|
2994
3101
|
*/
|
|
2995
3102
|
async function setupGitHub(options) {
|
|
2996
|
-
logBetaWarning("setup
|
|
3103
|
+
logBetaWarning("setup");
|
|
2997
3104
|
const resolved = await resolve$1(options);
|
|
2998
3105
|
const lock = readLock(options.outputDir);
|
|
2999
3106
|
const absFile = path.join(options.outputDir, resolved.file);
|
|
@@ -3045,11 +3152,23 @@ async function setupGitHub(options) {
|
|
|
3045
3152
|
}
|
|
3046
3153
|
|
|
3047
3154
|
//#endregion
|
|
3048
|
-
//#region src/cli/commands/setup/
|
|
3049
|
-
const
|
|
3050
|
-
name: "
|
|
3051
|
-
description: "
|
|
3155
|
+
//#region src/cli/commands/setup/index.ts
|
|
3156
|
+
const checkCommand = defineAppCommand({
|
|
3157
|
+
name: "check",
|
|
3158
|
+
description: "Audit generated workflows for drift against the current config/repo (read-only).",
|
|
3159
|
+
args: z.object({}).strict(),
|
|
3160
|
+
run: () => {
|
|
3161
|
+
checkGitHub({ outputDir: process.cwd() });
|
|
3162
|
+
}
|
|
3163
|
+
});
|
|
3164
|
+
const setupCommand = defineAppCommand({
|
|
3165
|
+
name: "setup",
|
|
3166
|
+
description: "Generate a CI deploy workflow for your project. (beta)",
|
|
3052
3167
|
args: z.object({
|
|
3168
|
+
provider: arg(z.enum(["github"], { message: "Only the 'github' provider is supported." }).default("github"), {
|
|
3169
|
+
alias: "p",
|
|
3170
|
+
description: "CI provider to generate for (only 'github' is supported)"
|
|
3171
|
+
}),
|
|
3053
3172
|
"workspace-name": arg(z.string().min(1).optional(), {
|
|
3054
3173
|
alias: "n",
|
|
3055
3174
|
description: "Workspace name (defaults to the config 'name')"
|
|
@@ -3065,6 +3184,7 @@ const githubCommand = defineAppCommand({
|
|
|
3065
3184
|
}),
|
|
3066
3185
|
force: arg(z.boolean().default(false), { description: "Discard hand edits / take over unmanaged files and regenerate" })
|
|
3067
3186
|
}).strict(),
|
|
3187
|
+
subCommands: { check: checkCommand },
|
|
3068
3188
|
run: async (args) => {
|
|
3069
3189
|
if (args["tag-pattern"] !== void 0 && !args.tag) throw new Error("--tag-pattern requires --tag.");
|
|
3070
3190
|
if (args["no-plan"] && args.tag) throw new Error("--no-plan cannot be combined with --tag.");
|
|
@@ -3082,14 +3202,6 @@ const githubCommand = defineAppCommand({
|
|
|
3082
3202
|
}
|
|
3083
3203
|
});
|
|
3084
3204
|
|
|
3085
|
-
//#endregion
|
|
3086
|
-
//#region src/cli/commands/setup/index.ts
|
|
3087
|
-
const setupCommand = defineCommand({
|
|
3088
|
-
name: "setup",
|
|
3089
|
-
description: "Set up project infrastructure.",
|
|
3090
|
-
subCommands: { github: githubCommand }
|
|
3091
|
-
});
|
|
3092
|
-
|
|
3093
3205
|
//#endregion
|
|
3094
3206
|
//#region src/cli/shared/skills-installer.ts
|
|
3095
3207
|
const SKILL_NAME = "tailor-sdk";
|
|
@@ -3220,7 +3332,7 @@ async function withTimeout(p, ms, message) {
|
|
|
3220
3332
|
//#endregion
|
|
3221
3333
|
//#region src/cli/commands/staticwebsite/deploy.ts
|
|
3222
3334
|
const CHUNK_SIZE = 64 * 1024;
|
|
3223
|
-
const IGNORED_FILES = new Set([
|
|
3335
|
+
const IGNORED_FILES = /* @__PURE__ */ new Set([
|
|
3224
3336
|
".DS_Store",
|
|
3225
3337
|
"thumbs.db",
|
|
3226
3338
|
"desktop.ini"
|
|
@@ -4761,7 +4873,7 @@ async function fetchRemoteTypes(client, workspaceId, namespace) {
|
|
|
4761
4873
|
async function assertMigrationsReproduceLocalTypes(loaded, target) {
|
|
4762
4874
|
const { config, plugins } = loaded;
|
|
4763
4875
|
const pluginManager = plugins.length > 0 ? new PluginManager(plugins) : void 0;
|
|
4764
|
-
const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-
|
|
4876
|
+
const { defineApplication, generatePluginFilesIfNeeded } = await import("../application-Br48NXBD.mjs");
|
|
4765
4877
|
const application = defineApplication({
|
|
4766
4878
|
config,
|
|
4767
4879
|
pluginManager
|
|
@@ -4773,7 +4885,7 @@ async function assertMigrationsReproduceLocalTypes(loaded, target) {
|
|
|
4773
4885
|
await service.processNamespacePlugins();
|
|
4774
4886
|
}
|
|
4775
4887
|
const pluginExecutorFiles = generatePluginFilesIfNeeded(pluginManager, application.tailorDBServices, config.path);
|
|
4776
|
-
const executorService = application.executorService ?? (pluginExecutorFiles.length > 0 ? (await import("../service-
|
|
4888
|
+
const executorService = application.executorService ?? (pluginExecutorFiles.length > 0 ? (await import("../service-CRaa4Joe.mjs")).createExecutorService({ config: { files: [] } }) : void 0);
|
|
4777
4889
|
await executorService?.loadExecutors();
|
|
4778
4890
|
if (pluginExecutorFiles.length > 0) await executorService?.loadPluginExecutorFiles([...pluginExecutorFiles]);
|
|
4779
4891
|
const executorUsedTypes = /* @__PURE__ */ new Set();
|
|
@@ -5050,7 +5162,7 @@ const upgradeCommand = defineAppCommand({
|
|
|
5050
5162
|
run: async (args) => {
|
|
5051
5163
|
const { initTelemetry } = await import("../telemetry-w92bvGdC.mjs");
|
|
5052
5164
|
await initTelemetry();
|
|
5053
|
-
const { upgrade } = await import("../service-
|
|
5165
|
+
const { upgrade } = await import("../service-DDWgZL_L2.mjs");
|
|
5054
5166
|
await upgrade({
|
|
5055
5167
|
from: args.from,
|
|
5056
5168
|
dryRun: args["dry-run"],
|
|
@@ -5363,6 +5475,7 @@ const workflowCommand = defineCommand({
|
|
|
5363
5475
|
list: listCommand$12,
|
|
5364
5476
|
get: getCommand$6,
|
|
5365
5477
|
start: startCommand,
|
|
5478
|
+
wait: waitCommand,
|
|
5366
5479
|
executions: executionsCommand,
|
|
5367
5480
|
resume: resumeCommand
|
|
5368
5481
|
},
|
|
@@ -5476,7 +5589,7 @@ runMain(mainCommand, {
|
|
|
5476
5589
|
if (isVerbose() && error.stack) logger.debug(`\nStack trace:\n${error.stack}`);
|
|
5477
5590
|
} else logger.error(`Unknown error: ${error}`);
|
|
5478
5591
|
if (!isCLIError(error) && (!(error instanceof Error) || error instanceof TypeError || error instanceof RangeError)) {
|
|
5479
|
-
const { reportCrash } = await import("../crashreport-
|
|
5592
|
+
const { reportCrash } = await import("../crashreport-BwF8cHF0.mjs");
|
|
5480
5593
|
await reportCrash(error, "handledError");
|
|
5481
5594
|
}
|
|
5482
5595
|
}
|