primitive-admin 1.0.61 → 1.0.62
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/README.md +125 -69
- package/assets/skill/skills/primitive-platform/SKILL.md +336 -37
- package/dist/bin/primitive.js +25 -14
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/analytics.js +36 -16
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.js +49 -188
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +13 -153
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +14 -100
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/collections.js +47 -8
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/config.d.ts +46 -0
- package/dist/src/commands/config.js +479 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/connections.js +12 -7
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/cron-triggers.js +84 -176
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-type-configs.d.ts +2 -0
- package/dist/src/commands/database-type-configs.js +171 -0
- package/dist/src/commands/database-type-configs.js.map +1 -0
- package/dist/src/commands/database-types.js +4 -4
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.d.ts +63 -0
- package/dist/src/commands/databases.js +649 -87
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.js +869 -12
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +18 -125
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.d.ts +12 -1
- package/dist/src/commands/env.js +98 -25
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/feature-flags.d.ts +14 -0
- package/dist/src/commands/feature-flags.js +116 -0
- package/dist/src/commands/feature-flags.js.map +1 -0
- package/dist/src/commands/group-type-configs.js +14 -109
- package/dist/src/commands/group-type-configs.js.map +1 -1
- package/dist/src/commands/init.d.ts +9 -1
- package/dist/src/commands/init.js +1056 -277
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +136 -421
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +12 -0
- package/dist/src/commands/metadata-category-configs.js +112 -0
- package/dist/src/commands/metadata-category-configs.js.map +1 -0
- package/dist/src/commands/metadata.js +33 -141
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +206 -563
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +16 -132
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.js +67 -234
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/sessions.js +17 -5
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/sync-app-settings.d.ts +113 -70
- package/dist/src/commands/sync-app-settings.js +193 -242
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +1932 -49
- package/dist/src/commands/sync.js +9521 -1769
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +8 -2
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +92 -1
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +44 -58
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/webhooks.js +318 -156
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +49 -12
- package/dist/src/commands/workflows.js +652 -1086
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/access-rule-display.d.ts +21 -0
- package/dist/src/lib/access-rule-display.js +34 -0
- package/dist/src/lib/access-rule-display.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +541 -61
- package/dist/src/lib/api-client.js +559 -102
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +180 -25
- package/dist/src/lib/app-settings-descriptor.js +403 -82
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/canonical-json.d.ts +12 -0
- package/dist/src/lib/canonical-json.js +35 -0
- package/dist/src/lib/canonical-json.js.map +1 -0
- package/dist/src/lib/cli-manifest.d.ts +8 -0
- package/dist/src/lib/cli-manifest.js +1 -0
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -2
- package/dist/src/lib/codegen-shared/generatedFiles.js +9 -2
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +6 -6
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +8 -8
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
- package/dist/src/lib/config-object-descriptor.d.ts +127 -0
- package/dist/src/lib/config-object-descriptor.js +658 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +85 -0
- package/dist/src/lib/config-payload.js +116 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +130 -0
- package/dist/src/lib/config-surface.js +300 -0
- package/dist/src/lib/config-surface.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +10 -0
- package/dist/src/lib/credentials-store.js +23 -0
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/data-input.d.ts +23 -0
- package/dist/src/lib/data-input.js +50 -0
- package/dist/src/lib/data-input.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +1 -1
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +1 -1
- package/dist/src/lib/env-resolver-core.d.ts +147 -0
- package/dist/src/lib/env-resolver-core.js +265 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +28 -6
- package/dist/src/lib/env-resolver.js +44 -32
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/generated-allowlist.js +12 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +682 -0
- package/dist/src/lib/generated-config-surfaces.js +4058 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-template-lint.d.ts +212 -0
- package/dist/src/lib/generated-template-lint.js +624 -0
- package/dist/src/lib/generated-template-lint.js.map +1 -0
- package/dist/src/lib/init-adopt.d.ts +16 -0
- package/dist/src/lib/init-adopt.js +34 -0
- package/dist/src/lib/init-adopt.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +39 -0
- package/dist/src/lib/init-assets.js +97 -0
- package/dist/src/lib/init-assets.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +44 -5
- package/dist/src/lib/init-config.js +80 -7
- package/dist/src/lib/init-config.js.map +1 -1
- package/dist/src/lib/init-ios-links.d.ts +50 -0
- package/dist/src/lib/init-ios-links.js +153 -0
- package/dist/src/lib/init-ios-links.js.map +1 -0
- package/dist/src/lib/init-plan.d.ts +80 -0
- package/dist/src/lib/init-plan.js +95 -0
- package/dist/src/lib/init-plan.js.map +1 -0
- package/dist/src/lib/init-production-env.d.ts +48 -0
- package/dist/src/lib/init-production-env.js +59 -0
- package/dist/src/lib/init-production-env.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +74 -0
- package/dist/src/lib/init-schema.js +358 -0
- package/dist/src/lib/init-schema.js.map +1 -0
- package/dist/src/lib/init-xcode.d.ts +33 -0
- package/dist/src/lib/init-xcode.js +114 -0
- package/dist/src/lib/init-xcode.js.map +1 -0
- package/dist/src/lib/integration-request-config.d.ts +30 -0
- package/dist/src/lib/integration-request-config.js +145 -0
- package/dist/src/lib/integration-request-config.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +55 -0
- package/dist/src/lib/local-state.js +167 -0
- package/dist/src/lib/local-state.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +568 -0
- package/dist/src/lib/log-inspection.js +639 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/migration-nag.d.ts +2 -2
- package/dist/src/lib/migration-nag.js +3 -3
- package/dist/src/lib/object-status-filter.d.ts +22 -0
- package/dist/src/lib/object-status-filter.js +45 -0
- package/dist/src/lib/object-status-filter.js.map +1 -0
- package/dist/src/lib/output.d.ts +24 -1
- package/dist/src/lib/output.js +42 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/package-manager.d.ts +140 -0
- package/dist/src/lib/package-manager.js +305 -0
- package/dist/src/lib/package-manager.js.map +1 -0
- package/dist/src/lib/paginate.d.ts +50 -0
- package/dist/src/lib/paginate.js +53 -0
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/platform-owned.d.ts +29 -3
- package/dist/src/lib/platform-owned.js +42 -3
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/project-config.js +13 -5
- package/dist/src/lib/project-config.js.map +1 -1
- package/dist/src/lib/query-operators.d.ts +1 -1
- package/dist/src/lib/query-operators.js +1 -1
- package/dist/src/lib/record-filter.d.ts +18 -0
- package/dist/src/lib/record-filter.js +55 -0
- package/dist/src/lib/record-filter.js.map +1 -0
- package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
- package/dist/src/lib/resolve-init-dev-port.js +55 -0
- package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
- package/dist/src/lib/resolve-init-server.d.ts +64 -0
- package/dist/src/lib/resolve-init-server.js +77 -0
- package/dist/src/lib/resolve-init-server.js.map +1 -0
- package/dist/src/lib/resolve-platform.d.ts +43 -14
- package/dist/src/lib/resolve-platform.js +74 -12
- package/dist/src/lib/resolve-platform.js.map +1 -1
- package/dist/src/lib/run-status.d.ts +19 -0
- package/dist/src/lib/run-status.generated.d.ts +39 -0
- package/dist/src/lib/run-status.generated.js +66 -0
- package/dist/src/lib/run-status.generated.js.map +1 -0
- package/dist/src/lib/run-status.js +19 -0
- package/dist/src/lib/run-status.js.map +1 -0
- package/dist/src/lib/server-text-normalization.d.ts +51 -0
- package/dist/src/lib/server-text-normalization.js +90 -0
- package/dist/src/lib/server-text-normalization.js.map +1 -0
- package/dist/src/lib/server-url.d.ts +22 -0
- package/dist/src/lib/server-url.js +33 -0
- package/dist/src/lib/server-url.js.map +1 -0
- package/dist/src/lib/signing-secret-status.d.ts +81 -0
- package/dist/src/lib/signing-secret-status.js +116 -0
- package/dist/src/lib/signing-secret-status.js.map +1 -0
- package/dist/src/lib/skill-installer.js +6 -3
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/snapshots.d.ts +2 -2
- package/dist/src/lib/snapshots.js +2 -2
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +15 -2
- package/dist/src/lib/swift-codegen/dbGenerator.js +250 -18
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/generator.d.ts +11 -2
- package/dist/src/lib/swift-codegen/generator.js +181 -7
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +7 -3
- package/dist/src/lib/swift-codegen/siblingSymbols.js +4 -1
- package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -1
- package/dist/src/lib/sync-dir-selector.d.ts +21 -0
- package/dist/src/lib/sync-dir-selector.js +30 -0
- package/dist/src/lib/sync-dir-selector.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +39 -0
- package/dist/src/lib/sync-paths.js +70 -2
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/sync-resource-types.d.ts +138 -31
- package/dist/src/lib/sync-resource-types.js +241 -47
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +95 -0
- package/dist/src/lib/sync-selectors.js +228 -0
- package/dist/src/lib/sync-selectors.js.map +1 -0
- package/dist/src/lib/template.d.ts +62 -4
- package/dist/src/lib/template.js +147 -39
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-keys.d.ts +29 -0
- package/dist/src/lib/test-case-keys.js +55 -0
- package/dist/src/lib/test-case-keys.js.map +1 -0
- package/dist/src/lib/test-case-variables.d.ts +15 -0
- package/dist/src/lib/test-case-variables.js +29 -0
- package/dist/src/lib/test-case-variables.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -4
- package/dist/src/lib/toml-database-config.js +27 -34
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-metadata-config.d.ts +9 -5
- package/dist/src/lib/toml-metadata-config.js +40 -45
- package/dist/src/lib/toml-metadata-config.js.map +1 -1
- package/dist/src/lib/toml-native-form.d.ts +1 -1
- package/dist/src/lib/toml-native-form.js +1 -1
- package/dist/src/lib/toml-params-validator.d.ts +1 -1
- package/dist/src/lib/toml-params-validator.js +1 -1
- package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
- package/dist/src/lib/toml-scalar-edit.js +283 -0
- package/dist/src/lib/toml-scalar-edit.js.map +1 -0
- package/dist/src/lib/user-selector.d.ts +24 -0
- package/dist/src/lib/user-selector.js +33 -0
- package/dist/src/lib/user-selector.js.map +1 -0
- package/dist/src/lib/version-check.d.ts +25 -0
- package/dist/src/lib/version-check.js +77 -8
- package/dist/src/lib/version-check.js.map +1 -1
- package/dist/src/lib/watch.d.ts +121 -0
- package/dist/src/lib/watch.js +169 -0
- package/dist/src/lib/watch.js.map +1 -0
- package/dist/src/lib/workflow-apply.d.ts +69 -45
- package/dist/src/lib/workflow-apply.js +99 -72
- package/dist/src/lib/workflow-apply.js.map +1 -1
- package/dist/src/lib/workflow-codegen/generator.js +4 -4
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +11 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +5 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
- package/dist/src/lib/workflow-config-apply.d.ts +70 -0
- package/dist/src/lib/workflow-config-apply.js +137 -0
- package/dist/src/lib/workflow-config-apply.js.map +1 -0
- package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
- package/dist/src/lib/workflow-config-sidecar.js +96 -0
- package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
- package/dist/src/lib/workflow-defaults.d.ts +29 -0
- package/dist/src/lib/workflow-defaults.js +41 -0
- package/dist/src/lib/workflow-defaults.js.map +1 -0
- package/dist/src/lib/workflow-include-preserve.d.ts +76 -0
- package/dist/src/lib/workflow-include-preserve.js +286 -0
- package/dist/src/lib/workflow-include-preserve.js.map +1 -0
- package/dist/src/lib/workflow-payload.d.ts +31 -20
- package/dist/src/lib/workflow-payload.js +100 -110
- package/dist/src/lib/workflow-payload.js.map +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +37 -16
- package/dist/src/lib/workflow-toml-validator.js +141 -16
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +78 -22
- package/dist/src/validators.d.ts +7 -7
- package/dist/src/validators.js +6 -6
- package/package.json +11 -6
- package/dist/src/commands/settings.d.ts +0 -15
- package/dist/src/commands/settings.js +0 -102
- package/dist/src/commands/settings.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the app identity out of the project a run is adopting (#2890).
|
|
3
|
+
*
|
|
4
|
+
* `getCurrentEnvironment()` resolves from the process's working directory,
|
|
5
|
+
* which is not necessarily inside the project being adopted — `primitive init
|
|
6
|
+
* ../ios` resolves against the TARGET, not the cwd. This resolves the same
|
|
7
|
+
* precedence order (`--env` -> `PRIMITIVE_ENV` -> this machine's selection ->
|
|
8
|
+
* the committed default -> the sole environment) against an explicit root.
|
|
9
|
+
*/
|
|
10
|
+
import { join } from "path";
|
|
11
|
+
import { readLocalSelection, selectEnvironmentName } from "./env-resolver-core.js";
|
|
12
|
+
import { PROJECT_CONFIG_DIR, PROJECT_CONFIG_FILENAME, loadProjectConfigFromPath, } from "./project-config.js";
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the environment `init` adopts from the project rooted at `root`.
|
|
15
|
+
* Throws whatever the loader or the selector throws — a broken or ambiguous
|
|
16
|
+
* project config must stop the run, not be guessed around.
|
|
17
|
+
*/
|
|
18
|
+
export function resolveAdoptedEnvironment(root, options = {}) {
|
|
19
|
+
const projectConfigPath = join(root, PROJECT_CONFIG_DIR, PROJECT_CONFIG_FILENAME);
|
|
20
|
+
const projectConfig = loadProjectConfigFromPath(projectConfigPath);
|
|
21
|
+
const { name } = selectEnvironmentName(projectConfig, {
|
|
22
|
+
explicitEnvName: options.explicitEnvName ?? null,
|
|
23
|
+
envVarName: options.envVarName ?? null,
|
|
24
|
+
localSelection: readLocalSelection(projectConfigPath),
|
|
25
|
+
configPath: projectConfigPath,
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
name,
|
|
29
|
+
config: projectConfig.environments[name],
|
|
30
|
+
projectConfig,
|
|
31
|
+
projectConfigPath,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=init-adopt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-adopt.js","sourceRoot":"","sources":["../../../src/lib/init-adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,GAG1B,MAAM,qBAAqB,CAAC;AAS7B;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,UAA2E,EAAE;IAE7E,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;IAClF,MAAM,aAAa,GAAG,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;IACnE,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,CAAC,aAAoB,EAAE;QAC3D,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,IAAI;QAChD,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI;QACtC,cAAc,EAAE,kBAAkB,CAAC,iBAAiB,CAAC;QACrD,UAAU,EAAE,iBAAiB;KAC9B,CAAC,CAAC;IACH,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC;QACxC,aAAa;QACb,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The files `primitive init` writes at the ROOT of a repository that holds
|
|
3
|
+
* several clients of one Primitive app (#2890).
|
|
4
|
+
*
|
|
5
|
+
* These are app-wide, not client-wide: each client's own `AGENTS.md`,
|
|
6
|
+
* `package.json`, runtime config and dependencies ship with its template. What
|
|
7
|
+
* belongs here is only what the clients share — which is exactly the part a
|
|
8
|
+
* team otherwise has to reverse-engineer.
|
|
9
|
+
*/
|
|
10
|
+
import type { Platform } from "./resolve-platform.js";
|
|
11
|
+
/** Human label for a platform, used in generated prose and summaries. */
|
|
12
|
+
export declare function platformLabel(platform: Platform): string;
|
|
13
|
+
/**
|
|
14
|
+
* The header prepended to the canonical `models/models.toml`.
|
|
15
|
+
*
|
|
16
|
+
* The schema is not client state: its TOML keys are the wire field names, so a
|
|
17
|
+
* second copy that drifts orphans the first one's records. Saying so in the
|
|
18
|
+
* file is the cheapest place for a reader to find that rule.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CANONICAL_SCHEMA_HEADER = "# The model schema for this app \u2014 ONE copy, shared by every client.\n#\n# The TOML keys here are the wire field names, so a second copy that drifts\n# orphans the other one's records. Every client reads THIS file:\n# - the web client's codegen input points at it, and its generated barrel\n# imports it directly\n# - the Swift client names it in `bao-codegen.json` beside its sources\n# Add or change a model here, then re-run each client's codegen.\n";
|
|
21
|
+
/**
|
|
22
|
+
* A starter schema for the rare composition that has no template starter to
|
|
23
|
+
* adopt. The scaffolded clients normally supply their own, which is what a
|
|
24
|
+
* composed repo promotes to the root.
|
|
25
|
+
*/
|
|
26
|
+
export declare const FALLBACK_STARTER_SCHEMA = "[models.user_prefs.fields.id]\ntype = \"id\"\nauto_assign = true\nindexed = true\nrequired = true\n\n[models.user_prefs.fields.key]\ntype = \"string\"\nindexed = true\nunique = true\n\n[models.user_prefs.fields.value]\ntype = \"string\"\n";
|
|
27
|
+
/**
|
|
28
|
+
* The app-wide `AGENTS.md` for a repository with several clients.
|
|
29
|
+
*
|
|
30
|
+
* Written only when there is no `AGENTS.md` at the root already — a client's
|
|
31
|
+
* own file is never replaced by init.
|
|
32
|
+
*/
|
|
33
|
+
export declare function rootAgentsMarkdown(input: {
|
|
34
|
+
appName: string;
|
|
35
|
+
clients: Array<{
|
|
36
|
+
platform: Platform;
|
|
37
|
+
dir: string;
|
|
38
|
+
}>;
|
|
39
|
+
}): string;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Human label for a platform, used in generated prose and summaries. */
|
|
2
|
+
export function platformLabel(platform) {
|
|
3
|
+
return platform === "ios" ? "iOS (SwiftUI)" : "Web (Vue)";
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The header prepended to the canonical `models/models.toml`.
|
|
7
|
+
*
|
|
8
|
+
* The schema is not client state: its TOML keys are the wire field names, so a
|
|
9
|
+
* second copy that drifts orphans the first one's records. Saying so in the
|
|
10
|
+
* file is the cheapest place for a reader to find that rule.
|
|
11
|
+
*/
|
|
12
|
+
export const CANONICAL_SCHEMA_HEADER = `# The model schema for this app — ONE copy, shared by every client.
|
|
13
|
+
#
|
|
14
|
+
# The TOML keys here are the wire field names, so a second copy that drifts
|
|
15
|
+
# orphans the other one's records. Every client reads THIS file:
|
|
16
|
+
# - the web client's codegen input points at it, and its generated barrel
|
|
17
|
+
# imports it directly
|
|
18
|
+
# - the Swift client names it in \`bao-codegen.json\` beside its sources
|
|
19
|
+
# Add or change a model here, then re-run each client's codegen.
|
|
20
|
+
`;
|
|
21
|
+
/**
|
|
22
|
+
* A starter schema for the rare composition that has no template starter to
|
|
23
|
+
* adopt. The scaffolded clients normally supply their own, which is what a
|
|
24
|
+
* composed repo promotes to the root.
|
|
25
|
+
*/
|
|
26
|
+
export const FALLBACK_STARTER_SCHEMA = `[models.user_prefs.fields.id]
|
|
27
|
+
type = "id"
|
|
28
|
+
auto_assign = true
|
|
29
|
+
indexed = true
|
|
30
|
+
required = true
|
|
31
|
+
|
|
32
|
+
[models.user_prefs.fields.key]
|
|
33
|
+
type = "string"
|
|
34
|
+
indexed = true
|
|
35
|
+
unique = true
|
|
36
|
+
|
|
37
|
+
[models.user_prefs.fields.value]
|
|
38
|
+
type = "string"
|
|
39
|
+
`;
|
|
40
|
+
/**
|
|
41
|
+
* The app-wide `AGENTS.md` for a repository with several clients.
|
|
42
|
+
*
|
|
43
|
+
* Written only when there is no `AGENTS.md` at the root already — a client's
|
|
44
|
+
* own file is never replaced by init.
|
|
45
|
+
*/
|
|
46
|
+
export function rootAgentsMarkdown(input) {
|
|
47
|
+
const rows = input.clients
|
|
48
|
+
.map((client) => `- \`${client.dir}/\` — ${platformLabel(client.platform)} client`)
|
|
49
|
+
.join("\n");
|
|
50
|
+
return `# ${input.appName}
|
|
51
|
+
|
|
52
|
+
One Primitive app, several clients. The app is the shared thing: one app ID,
|
|
53
|
+
one set of environments, one exported server config, one model schema. Each
|
|
54
|
+
client is an independent project in its own directory — there is no workspace
|
|
55
|
+
file and no root \`package.json\`.
|
|
56
|
+
|
|
57
|
+
## Layout
|
|
58
|
+
|
|
59
|
+
- \`.primitive/config.json\` — the Primitive environments (backend URL + app ID
|
|
60
|
+
per environment). The single source of truth, for every client.
|
|
61
|
+
- \`.primitive/sync/<env>/<appId>/\` — the exported server config (workflows,
|
|
62
|
+
database type configs, app settings) that \`primitive config diff\` and
|
|
63
|
+
\`primitive config push\` read and write.
|
|
64
|
+
- \`models/models.toml\` — the model schema. ONE copy: its keys are the wire
|
|
65
|
+
field names, so a second copy that drifts orphans the other's records. Each
|
|
66
|
+
client's codegen reads this file in place; never copy it into a client.
|
|
67
|
+
${rows}
|
|
68
|
+
|
|
69
|
+
## Per app vs per client
|
|
70
|
+
|
|
71
|
+
| Per app (here, at the root) | Per client (in its directory) |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| Environments and app ID | Generated code |
|
|
74
|
+
| Exported server config | Dependencies and build config |
|
|
75
|
+
| Model schema | Runtime connection settings |
|
|
76
|
+
| Secrets | Deploy configuration |
|
|
77
|
+
| — | Its own \`AGENTS.md\` |
|
|
78
|
+
|
|
79
|
+
## Running commands
|
|
80
|
+
|
|
81
|
+
Every \`primitive\` command walks up to this directory's \`.primitive/config.json\`,
|
|
82
|
+
so it resolves the same app from any client directory and needs no path flag.
|
|
83
|
+
\`primitive env use <name>\` selects the environment every command in this
|
|
84
|
+
repository targets — it is an app-wide selection, not a per-client one.
|
|
85
|
+
|
|
86
|
+
## Adding another client
|
|
87
|
+
|
|
88
|
+
\`\`\`sh
|
|
89
|
+
primitive init <dir> --platform <web|ios>
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
Run from inside this repository, that adds a client to THIS app: it reuses this
|
|
93
|
+
config, wires the new client to \`models/models.toml\`, and creates no second
|
|
94
|
+
\`.primitive/\` and no second git repository.
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=init-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-assets.js","sourceRoot":"","sources":["../../../src/lib/init-assets.ts"],"names":[],"mappings":"AAWA,yEAAyE;AACzE,MAAM,UAAU,aAAa,CAAC,QAAkB;IAC9C,OAAO,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;CAQtC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;CAatC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAGlC;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO;SACvB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,GAAG,SAAS,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;SAClF,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,KAAK,KAAK,CAAC,OAAO;;;;;;;;;;;;;;;;;EAiBzB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BL,CAAC;AACF,CAAC"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export declare const INIT_CONFIG_FILENAME = ".primitive-init.toml";
|
|
2
2
|
export interface InitConfig {
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* What this run does with the app:
|
|
5
|
+
* - `create` — make a new app (needs `app_name`)
|
|
6
|
+
* - `use-existing` — scaffold against an app that already exists (needs `app_id`)
|
|
7
|
+
* - `add-client` — add another client to the Primitive app the surrounding
|
|
8
|
+
* project already targets (#2890). The app comes from the selected
|
|
9
|
+
* environment of the nearest ancestor `.primitive/config.json`, so this
|
|
10
|
+
* action names no app of its own.
|
|
11
|
+
*/
|
|
12
|
+
action: "create" | "use-existing" | "add-client";
|
|
5
13
|
/** App name (required for action = "create") */
|
|
6
14
|
app_name?: string;
|
|
7
15
|
/** Existing app ID (required for action = "use-existing") */
|
|
@@ -14,7 +22,11 @@ export interface InitConfig {
|
|
|
14
22
|
dev_port?: number;
|
|
15
23
|
/** Whether to skip npm install */
|
|
16
24
|
skip_install?: boolean;
|
|
17
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Custom server URL. Behaves like the `-s/--server` flag: the app is created
|
|
27
|
+
* on this server and the scaffolded project config records it. The flag wins
|
|
28
|
+
* when both are given. (#2376)
|
|
29
|
+
*/
|
|
18
30
|
server?: string;
|
|
19
31
|
/** Email addresses to invite (for invite-only mode) */
|
|
20
32
|
invite_emails?: string[];
|
|
@@ -22,8 +34,17 @@ export interface InitConfig {
|
|
|
22
34
|
allowed_domains?: string[];
|
|
23
35
|
/** Whether to overwrite a non-empty target directory (default: false) */
|
|
24
36
|
overwrite?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Target platform(s) for the scaffolded client(s): `"web"`, `"ios"`, a
|
|
39
|
+
* comma-separated string, or a TOML array (`platform = ["web", "ios"]`).
|
|
40
|
+
*/
|
|
41
|
+
platform?: string | string[];
|
|
42
|
+
/**
|
|
43
|
+
* Non-interactive consent to move an existing single-client repo's model
|
|
44
|
+
* schema to `<project root>/models/models.toml` so both clients read one copy
|
|
45
|
+
* (#2890). Valid only with `action = "add-client"`.
|
|
46
|
+
*/
|
|
47
|
+
promote_schema?: boolean;
|
|
27
48
|
}
|
|
28
49
|
export interface ValidationResult {
|
|
29
50
|
valid: boolean;
|
|
@@ -42,6 +63,24 @@ export interface ValidationResult {
|
|
|
42
63
|
* should create a new app).
|
|
43
64
|
*/
|
|
44
65
|
export declare function resolveUseExistingAppId(flag: string | undefined, initConfig: InitConfig | null): string | undefined;
|
|
66
|
+
/** Where the resolved "skip dependency install" decision came from. */
|
|
67
|
+
export type SkipInstallSource = "flag" | "config" | "default";
|
|
68
|
+
export interface ResolvedSkipInstall {
|
|
69
|
+
skipInstall: boolean;
|
|
70
|
+
source: SkipInstallSource;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Resolves whether `primitive init` skips the dependency install, from the two
|
|
74
|
+
* places it can be requested: the `--skip-install` flag (highest precedence)
|
|
75
|
+
* or `skip_install = true` in the init-config TOML.
|
|
76
|
+
*
|
|
77
|
+
* `init` used to read only the flag, so a config's `skip_install` was silently
|
|
78
|
+
* ignored and CI runs installed anyway (#2720). Precedence matches #2376's
|
|
79
|
+
* `server` fix: the flag wins. Because `--skip-install` is a boolean flag it
|
|
80
|
+
* can only ever request a skip, so an explicit `skip_install = false` in the
|
|
81
|
+
* config cannot un-skip a run that passed the flag.
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveSkipInstall(flag: boolean | undefined, initConfig: InitConfig | null): ResolvedSkipInstall;
|
|
45
84
|
/**
|
|
46
85
|
* Parses a TOML string into an InitConfig object.
|
|
47
86
|
* Throws if the string contains invalid TOML.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
2
|
import { join } from "path";
|
|
3
3
|
import { parseConfigToml } from "./config-toml.js";
|
|
4
|
+
import { PROJECT_CONFIG_DISPLAY_NAME } from "./project-config.js";
|
|
5
|
+
import { parsePlatformList } from "./resolve-platform.js";
|
|
6
|
+
import { validateServerUrl } from "./server-url.js";
|
|
4
7
|
export const INIT_CONFIG_FILENAME = ".primitive-init.toml";
|
|
5
8
|
/**
|
|
6
9
|
* Resolves the "use an existing app" app id from the two places it can be
|
|
@@ -21,6 +24,27 @@ export function resolveUseExistingAppId(flag, initConfig) {
|
|
|
21
24
|
return initConfig.app_id;
|
|
22
25
|
return undefined;
|
|
23
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolves whether `primitive init` skips the dependency install, from the two
|
|
29
|
+
* places it can be requested: the `--skip-install` flag (highest precedence)
|
|
30
|
+
* or `skip_install = true` in the init-config TOML.
|
|
31
|
+
*
|
|
32
|
+
* `init` used to read only the flag, so a config's `skip_install` was silently
|
|
33
|
+
* ignored and CI runs installed anyway (#2720). Precedence matches #2376's
|
|
34
|
+
* `server` fix: the flag wins. Because `--skip-install` is a boolean flag it
|
|
35
|
+
* can only ever request a skip, so an explicit `skip_install = false` in the
|
|
36
|
+
* config cannot un-skip a run that passed the flag.
|
|
37
|
+
*/
|
|
38
|
+
export function resolveSkipInstall(flag, initConfig) {
|
|
39
|
+
if (flag)
|
|
40
|
+
return { skipInstall: true, source: "flag" };
|
|
41
|
+
// Strict `=== true`: a non-boolean that slipped past validation must not
|
|
42
|
+
// skip the install by truthiness (`skip_install = "false"` reads as a skip).
|
|
43
|
+
if (initConfig?.skip_install === true) {
|
|
44
|
+
return { skipInstall: true, source: "config" };
|
|
45
|
+
}
|
|
46
|
+
return { skipInstall: false, source: "default" };
|
|
47
|
+
}
|
|
24
48
|
/**
|
|
25
49
|
* Parses a TOML string into an InitConfig object.
|
|
26
50
|
* Throws if the string contains invalid TOML.
|
|
@@ -49,11 +73,12 @@ export function loadInitConfig(dir) {
|
|
|
49
73
|
export function validateInitConfig(config) {
|
|
50
74
|
const errors = [];
|
|
51
75
|
// action is required
|
|
76
|
+
const ACTIONS = ["create", "use-existing", "add-client"];
|
|
52
77
|
if (!config.action) {
|
|
53
|
-
errors.push(
|
|
78
|
+
errors.push(`Missing required field: "action" (must be ${ACTIONS.map((a) => `"${a}"`).join(", ")})`);
|
|
54
79
|
}
|
|
55
|
-
else if (
|
|
56
|
-
errors.push(
|
|
80
|
+
else if (!ACTIONS.includes(config.action)) {
|
|
81
|
+
errors.push(`"action" must be ${ACTIONS.map((a) => `"${a}"`).join(", ")}`);
|
|
57
82
|
}
|
|
58
83
|
else {
|
|
59
84
|
// Validate action-specific required fields
|
|
@@ -63,6 +88,24 @@ export function validateInitConfig(config) {
|
|
|
63
88
|
if (config.action === "use-existing" && !config.app_id) {
|
|
64
89
|
errors.push('"app_id" is required when action is "use-existing"');
|
|
65
90
|
}
|
|
91
|
+
// `add-client` takes its app — and therefore its access mode and its
|
|
92
|
+
// invitations — from the environment it adopts. Naming any of them here
|
|
93
|
+
// would describe a second app this run is not allowed to touch.
|
|
94
|
+
if (config.action === "add-client") {
|
|
95
|
+
for (const key of [
|
|
96
|
+
"app_name",
|
|
97
|
+
"app_id",
|
|
98
|
+
"access_mode",
|
|
99
|
+
"invite_emails",
|
|
100
|
+
"allowed_domains",
|
|
101
|
+
]) {
|
|
102
|
+
const value = config[key];
|
|
103
|
+
const present = Array.isArray(value) ? value.length > 0 : value !== undefined;
|
|
104
|
+
if (present) {
|
|
105
|
+
errors.push(`"${key}" is not allowed with action = "add-client": the app comes from the selected environment of the existing ${PROJECT_CONFIG_DISPLAY_NAME}.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
66
109
|
}
|
|
67
110
|
// Validate access_mode if provided
|
|
68
111
|
if (config.access_mode) {
|
|
@@ -74,12 +117,42 @@ export function validateInitConfig(config) {
|
|
|
74
117
|
errors.push('"allowed_domains" is required when access_mode is "domain"');
|
|
75
118
|
}
|
|
76
119
|
}
|
|
77
|
-
// Validate platform if provided.
|
|
78
|
-
// (`macos` is intentionally rejected until the macOS
|
|
120
|
+
// Validate platform if provided. A string or an array of strings; only "web"
|
|
121
|
+
// and "ios" are supported (`macos` is intentionally rejected until the macOS
|
|
122
|
+
// template is ready), and each may be named once (#2890).
|
|
79
123
|
if (config.platform !== undefined) {
|
|
80
|
-
if (config.platform !== "
|
|
81
|
-
errors.push('"platform" must be
|
|
124
|
+
if (typeof config.platform !== "string" && !Array.isArray(config.platform)) {
|
|
125
|
+
errors.push('"platform" must be a string or an array of strings');
|
|
82
126
|
}
|
|
127
|
+
else {
|
|
128
|
+
const parsed = parsePlatformList(config.platform);
|
|
129
|
+
if (!parsed.ok)
|
|
130
|
+
errors.push(`"platform": ${parsed.error}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// `promote_schema` is consent for a move that only the add-client path can
|
|
134
|
+
// make; anywhere else it would silently do nothing.
|
|
135
|
+
if (config.promote_schema !== undefined) {
|
|
136
|
+
if (typeof config.promote_schema !== "boolean") {
|
|
137
|
+
errors.push('"promote_schema" must be a boolean (true or false)');
|
|
138
|
+
}
|
|
139
|
+
else if (config.action !== "add-client") {
|
|
140
|
+
errors.push('"promote_schema" is only valid with action = "add-client"');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Validate server if provided. An unusable value must fail here rather than
|
|
144
|
+
// fall through to the current server, which is how #2376 went unnoticed.
|
|
145
|
+
if (config.server !== undefined) {
|
|
146
|
+
const serverValidation = validateServerUrl(config.server);
|
|
147
|
+
if (serverValidation !== true) {
|
|
148
|
+
errors.push(`"server" must be a valid URL (e.g., https://primitiveapi.com): ${serverValidation}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Validate skip_install if provided. The TOML is cast to InitConfig without
|
|
152
|
+
// runtime narrowing, so a non-boolean has to be rejected here rather than
|
|
153
|
+
// reach the resolver, where anything truthy would skip the install.
|
|
154
|
+
if (config.skip_install !== undefined && typeof config.skip_install !== "boolean") {
|
|
155
|
+
errors.push('"skip_install" must be a boolean (true or false)');
|
|
83
156
|
}
|
|
84
157
|
// Validate dev_port if provided
|
|
85
158
|
if (config.dev_port !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-config.js","sourceRoot":"","sources":["../../../src/lib/init-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"init-config.js","sourceRoot":"","sources":["../../../src/lib/init-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM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on. Changing it
|
|
3
|
+
* breaks the manager's scheme resolution, so it is pinned by a test that reads
|
|
4
|
+
* both files.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PRIMITIVE_AUTH_URL_TYPE_NAME = "PrimitiveAuth";
|
|
7
|
+
/** The library's fallback scheme — reserved, never a derived result. */
|
|
8
|
+
export declare const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
9
|
+
/**
|
|
10
|
+
* The custom URL scheme for one scaffolded client: a readable prefix from the
|
|
11
|
+
* app name, then the full lowercased app ID.
|
|
12
|
+
*
|
|
13
|
+
* Deterministic and injective over server-generated app IDs — two apps never
|
|
14
|
+
* share a scheme, whatever they are called.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deriveCallbackScheme(appName: string, appId: string, clientDirName?: string): string;
|
|
17
|
+
/** The redirect target the emailed sign-in link uses, for one scheme. */
|
|
18
|
+
export declare function iosMagicLinkRedirectUri(scheme: string): string;
|
|
19
|
+
export interface StampResult {
|
|
20
|
+
/** `not-found` when the plist predates the `PrimitiveAuth` URL type. */
|
|
21
|
+
outcome: "stamped" | "already" | "not-found";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replaces the scheme registered under the `PrimitiveAuth` URL type in a
|
|
25
|
+
* scaffolded client's `Info-Partial.plist`.
|
|
26
|
+
*
|
|
27
|
+
* A targeted text substitution, not a plist rewrite: the file's comments are
|
|
28
|
+
* the checklist a developer reads when their emailed link does nothing, and a
|
|
29
|
+
* serializer would drop them.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stampCallbackScheme(clientDir: string, scheme: string): StampResult;
|
|
32
|
+
/**
|
|
33
|
+
* What init prints about email sign-in on the iOS path: it already works, and
|
|
34
|
+
* this is the one opt-in that adds the link.
|
|
35
|
+
*
|
|
36
|
+
* The allow-list step is phrased as a MERGE into the existing array — `app.toml`
|
|
37
|
+
* is the whole app-settings truth on push (#2880), so a replacement array would
|
|
38
|
+
* silently drop the web callback the app was seeded with.
|
|
39
|
+
*
|
|
40
|
+
* `registered` is false when the scheme could not be stamped (an older template
|
|
41
|
+
* with no `PrimitiveAuth` URL type). The allow-list entry and the flag are the
|
|
42
|
+
* same either way, but the closing line must not claim a registration that is
|
|
43
|
+
* not there: a developer who did only the two steps would be left with a dead
|
|
44
|
+
* tap and nothing naming the missing piece.
|
|
45
|
+
*/
|
|
46
|
+
export declare function linkOptInGuidance(scheme: string, options?: {
|
|
47
|
+
registered?: boolean;
|
|
48
|
+
}): string[];
|
|
49
|
+
/** What init says when the template predates the `PrimitiveAuth` URL type. */
|
|
50
|
+
export declare function missingUrlTypeGuidance(scheme: string): string[];
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The iOS app's own URL scheme, and the documented opt-in that turns the
|
|
3
|
+
* sign-in email's LINK on (#2969).
|
|
4
|
+
*
|
|
5
|
+
* The Swift template registers one custom URL scheme, under the
|
|
6
|
+
* `PrimitiveAuth` URL-type name that `PrimitiveAuthManager` reads its callback
|
|
7
|
+
* scheme from. Shipped, that scheme is `primitiveapp` — which every app
|
|
8
|
+
* scaffolded from the template would otherwise share, making iOS link routing
|
|
9
|
+
* between two of them on one device ambiguous. So init stamps an app-unique
|
|
10
|
+
* scheme in its place.
|
|
11
|
+
*
|
|
12
|
+
* The suffix is the WHOLE app ID, not a tail or a hash of it: app IDs are
|
|
13
|
+
* 26-character ULIDs, and any fixed-width squeeze of them is many-to-one — two
|
|
14
|
+
* distinct apps could still be handed the same scheme, which is the failure
|
|
15
|
+
* this stamping exists to prevent.
|
|
16
|
+
*
|
|
17
|
+
* Init writes no app settings here. Email sign-in works out of the box because
|
|
18
|
+
* the manager sends NO redirect target by default, so the email carries the
|
|
19
|
+
* code alone and the allow-list is not consulted at all. Sending the link is
|
|
20
|
+
* the developer's opt-in — one allow-list entry plus one flag — and init only
|
|
21
|
+
* prints what those are.
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
24
|
+
import { join } from "path";
|
|
25
|
+
/**
|
|
26
|
+
* The `CFBundleURLName` the library and the template agree on. Changing it
|
|
27
|
+
* breaks the manager's scheme resolution, so it is pinned by a test that reads
|
|
28
|
+
* both files.
|
|
29
|
+
*/
|
|
30
|
+
export const PRIMITIVE_AUTH_URL_TYPE_NAME = "PrimitiveAuth";
|
|
31
|
+
/** The library's fallback scheme — reserved, never a derived result. */
|
|
32
|
+
export const FALLBACK_CALLBACK_SCHEME = "primitiveapp";
|
|
33
|
+
/** How much of the app name survives into the readable prefix. */
|
|
34
|
+
const PREFIX_MAX_LENGTH = 20;
|
|
35
|
+
/** The app-name placeholder init carries when it never asked for one. */
|
|
36
|
+
const APP_NAME_PLACEHOLDER = "(existing app)";
|
|
37
|
+
/**
|
|
38
|
+
* A URL-scheme-safe, letter-first fragment of `value`, or `""` when nothing
|
|
39
|
+
* usable survives (an empty name, an emoji-only one, digits alone).
|
|
40
|
+
*/
|
|
41
|
+
function schemeFragment(value, maxLength) {
|
|
42
|
+
const sanitized = (value ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
43
|
+
// RFC 3986 schemes start with a letter, and the prefix is what leads.
|
|
44
|
+
const letterFirst = sanitized.replace(/^[0-9]+/, "");
|
|
45
|
+
return letterFirst.slice(0, maxLength);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The custom URL scheme for one scaffolded client: a readable prefix from the
|
|
49
|
+
* app name, then the full lowercased app ID.
|
|
50
|
+
*
|
|
51
|
+
* Deterministic and injective over server-generated app IDs — two apps never
|
|
52
|
+
* share a scheme, whatever they are called.
|
|
53
|
+
*/
|
|
54
|
+
export function deriveCallbackScheme(appName, appId, clientDirName) {
|
|
55
|
+
const named = appName === APP_NAME_PLACEHOLDER ? "" : appName;
|
|
56
|
+
const prefix = schemeFragment(named, PREFIX_MAX_LENGTH) ||
|
|
57
|
+
schemeFragment(clientDirName, PREFIX_MAX_LENGTH) ||
|
|
58
|
+
"app";
|
|
59
|
+
// No truncation: the whole ID is what makes the scheme unique.
|
|
60
|
+
const suffix = (appId ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
61
|
+
const scheme = suffix ? `${prefix}-${suffix}` : prefix;
|
|
62
|
+
// Only reachable with no app ID at all, but the reserved scheme is exactly
|
|
63
|
+
// what a derived one must never collide with.
|
|
64
|
+
return scheme === FALLBACK_CALLBACK_SCHEME ? `${scheme}-app` : scheme;
|
|
65
|
+
}
|
|
66
|
+
/** The redirect target the emailed sign-in link uses, for one scheme. */
|
|
67
|
+
export function iosMagicLinkRedirectUri(scheme) {
|
|
68
|
+
return `${scheme}://auth/magic-link`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Replaces the scheme registered under the `PrimitiveAuth` URL type in a
|
|
72
|
+
* scaffolded client's `Info-Partial.plist`.
|
|
73
|
+
*
|
|
74
|
+
* A targeted text substitution, not a plist rewrite: the file's comments are
|
|
75
|
+
* the checklist a developer reads when their emailed link does nothing, and a
|
|
76
|
+
* serializer would drop them.
|
|
77
|
+
*/
|
|
78
|
+
export function stampCallbackScheme(clientDir, scheme) {
|
|
79
|
+
const plistPath = join(clientDir, "Info-Partial.plist");
|
|
80
|
+
if (!existsSync(plistPath))
|
|
81
|
+
return { outcome: "not-found" };
|
|
82
|
+
let text;
|
|
83
|
+
try {
|
|
84
|
+
text = readFileSync(plistPath, "utf-8");
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return { outcome: "not-found" };
|
|
88
|
+
}
|
|
89
|
+
const marker = `<string>${PRIMITIVE_AUTH_URL_TYPE_NAME}</string>`;
|
|
90
|
+
const markerIndex = text.indexOf(marker);
|
|
91
|
+
if (markerIndex === -1)
|
|
92
|
+
return { outcome: "not-found" };
|
|
93
|
+
// Stay inside the URL-type dict the marker names: an app may register other
|
|
94
|
+
// schemes (a Google reversed client ID, say) and those are not ours to move.
|
|
95
|
+
const dictStart = text.lastIndexOf("<dict>", markerIndex);
|
|
96
|
+
const dictEnd = text.indexOf("</dict>", markerIndex);
|
|
97
|
+
if (dictStart === -1 || dictEnd === -1)
|
|
98
|
+
return { outcome: "not-found" };
|
|
99
|
+
const block = text.slice(dictStart, dictEnd);
|
|
100
|
+
if (!block.includes("<key>CFBundleURLName</key>"))
|
|
101
|
+
return { outcome: "not-found" };
|
|
102
|
+
const schemesPattern = /(<key>CFBundleURLSchemes<\/key>\s*<array>\s*<string>)([^<]*)(<\/string>)/;
|
|
103
|
+
const match = schemesPattern.exec(block);
|
|
104
|
+
if (!match)
|
|
105
|
+
return { outcome: "not-found" };
|
|
106
|
+
if (match[2] === scheme)
|
|
107
|
+
return { outcome: "already" };
|
|
108
|
+
const rewritten = block.replace(schemesPattern, `$1${scheme}$3`);
|
|
109
|
+
writeFileSync(plistPath, text.slice(0, dictStart) + rewritten + text.slice(dictEnd));
|
|
110
|
+
return { outcome: "stamped" };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* What init prints about email sign-in on the iOS path: it already works, and
|
|
114
|
+
* this is the one opt-in that adds the link.
|
|
115
|
+
*
|
|
116
|
+
* The allow-list step is phrased as a MERGE into the existing array — `app.toml`
|
|
117
|
+
* is the whole app-settings truth on push (#2880), so a replacement array would
|
|
118
|
+
* silently drop the web callback the app was seeded with.
|
|
119
|
+
*
|
|
120
|
+
* `registered` is false when the scheme could not be stamped (an older template
|
|
121
|
+
* with no `PrimitiveAuth` URL type). The allow-list entry and the flag are the
|
|
122
|
+
* same either way, but the closing line must not claim a registration that is
|
|
123
|
+
* not there: a developer who did only the two steps would be left with a dead
|
|
124
|
+
* tap and nothing naming the missing piece.
|
|
125
|
+
*/
|
|
126
|
+
export function linkOptInGuidance(scheme, options = {}) {
|
|
127
|
+
const registered = options.registered !== false;
|
|
128
|
+
const redirectUri = iosMagicLinkRedirectUri(scheme);
|
|
129
|
+
return [
|
|
130
|
+
"Email sign-in works now: the email carries a 6-digit code and needs no app settings.",
|
|
131
|
+
`To ALSO send a sign-in link that opens this app, add "${redirectUri}" to the existing`,
|
|
132
|
+
" [auth].emailRedirectUris array in config/app.toml (merge it in — run",
|
|
133
|
+
" `primitive config pull --only app` first if that file is not there yet), then run",
|
|
134
|
+
" `primitive config push --only app` and set `authManager.sendsEmailSignInLink = true`.",
|
|
135
|
+
registered
|
|
136
|
+
? "The scheme registration and the link routing are already in this client."
|
|
137
|
+
: `The scheme "${scheme}" is NOT registered in this client yet — register it first (see`
|
|
138
|
+
+ ` the ${PRIMITIVE_AUTH_URL_TYPE_NAME} warning above), or the link stays a dead tap.`,
|
|
139
|
+
" Full checklist: `primitive guides get authentication --language swift`, or the",
|
|
140
|
+
" authentication.md docs page — 'Make the emailed sign-in link open your app'.",
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
/** What init says when the template predates the `PrimitiveAuth` URL type. */
|
|
144
|
+
export function missingUrlTypeGuidance(scheme) {
|
|
145
|
+
return [
|
|
146
|
+
`This template's Info-Partial.plist registers no ${PRIMITIVE_AUTH_URL_TYPE_NAME} URL type, so the`,
|
|
147
|
+
` scheme "${scheme}" was not stamped and an emailed sign-in link cannot open this app.`,
|
|
148
|
+
` Add a CFBundleURLTypes entry named ${PRIMITIVE_AUTH_URL_TYPE_NAME} with that scheme, then follow`,
|
|
149
|
+
" the authentication.md docs page — 'Make the emailed sign-in link open your app'",
|
|
150
|
+
" (or `primitive guides get authentication --language swift`).",
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=init-ios-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-ios-links.js","sourceRoot":"","sources":["../../../src/lib/init-ios-links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B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