@geekmidas/cli 10.0.0-alpha.111 → 10.0.0-alpha.112
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/{cli-Br5ApIgR.mjs → cli-DDY3jfTt.mjs} +3 -3
- package/dist/{cli-Br5ApIgR.mjs.map → cli-DDY3jfTt.mjs.map} +1 -1
- package/dist/{eas-BkLA60P2.cjs → eas-Cne743nQ.cjs} +21 -3
- package/dist/eas-Cne743nQ.cjs.map +1 -0
- package/dist/{eas-6ezdJtry.mjs → eas-DEpwISrQ.mjs} +25 -7
- package/dist/eas-DEpwISrQ.mjs.map +1 -0
- package/dist/{googlePlay-DNgybe5t.cjs → googlePlay-B6uiHi65.cjs} +2 -2
- package/dist/{googlePlay-DNgybe5t.cjs.map → googlePlay-B6uiHi65.cjs.map} +1 -1
- package/dist/{googlePlay-DY9vZQ1p.mjs → googlePlay-BYZ-J5sC.mjs} +4 -4
- package/dist/{googlePlay-DY9vZQ1p.mjs.map → googlePlay-BYZ-J5sC.mjs.map} +1 -1
- package/dist/index.cjs +155 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +164 -84
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-B9GswIAr.mjs → migrate-xHYaeBkd.mjs} +2 -2
- package/dist/{migrate-B9GswIAr.mjs.map → migrate-xHYaeBkd.mjs.map} +1 -1
- package/dist/{publish-B-EIjfQ0.mjs → publish-CSctCNf4.mjs} +2 -2
- package/dist/{publish-B-EIjfQ0.mjs.map → publish-CSctCNf4.mjs.map} +1 -1
- package/dist/{publish-CPgSbtcs.cjs → publish-SDG1WfYn.cjs} +2 -2
- package/dist/{publish-CPgSbtcs.cjs.map → publish-SDG1WfYn.cjs.map} +1 -1
- package/dist/{stage-DjxR_7C0.mjs → stage-ClKTHQoM.mjs} +2 -2
- package/dist/{stage-DjxR_7C0.mjs.map → stage-ClKTHQoM.mjs.map} +1 -1
- package/dist/{terminal-mXM-Lqc6.mjs → terminal-CybB-cjk.mjs} +2 -2
- package/dist/{terminal-mXM-Lqc6.mjs.map → terminal-CybB-cjk.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/eas-6ezdJtry.mjs.map +0 -1
- package/dist/eas-BkLA60P2.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -57,7 +57,7 @@ crypto = require_rolldown_runtime.__toESM(crypto, 1);
|
|
|
57
57
|
let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
|
|
58
58
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
59
59
|
//#region package.json
|
|
60
|
-
var version = "10.0.0-alpha.
|
|
60
|
+
var version = "10.0.0-alpha.112";
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region src/prompt.ts
|
|
63
63
|
/**
|
|
@@ -5949,25 +5949,25 @@ function loadPackageJson() {
|
|
|
5949
5949
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
5950
5950
|
*/
|
|
5951
5951
|
const GEEKMIDAS_VERSIONS = {
|
|
5952
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
5953
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
5954
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
5955
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
5956
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
5957
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
5958
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
5959
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
5960
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
5961
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
5962
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
5963
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
5964
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
5965
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
5966
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
5967
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
5968
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
5969
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
5970
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
5952
|
+
"@geekmidas/audit": "~10.0.0-alpha.112",
|
|
5953
|
+
"@geekmidas/auth": "~10.0.0-alpha.112",
|
|
5954
|
+
"@geekmidas/cache": "~10.0.0-alpha.112",
|
|
5955
|
+
"@geekmidas/client": "~10.0.0-alpha.112",
|
|
5956
|
+
"@geekmidas/cloud": "~10.0.0-alpha.112",
|
|
5957
|
+
"@geekmidas/constructs": "~10.0.0-alpha.112",
|
|
5958
|
+
"@geekmidas/db": "~10.0.0-alpha.112",
|
|
5959
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.112",
|
|
5960
|
+
"@geekmidas/envkit": "~10.0.0-alpha.112",
|
|
5961
|
+
"@geekmidas/errors": "~10.0.0-alpha.112",
|
|
5962
|
+
"@geekmidas/events": "~10.0.0-alpha.112",
|
|
5963
|
+
"@geekmidas/logger": "~10.0.0-alpha.112",
|
|
5964
|
+
"@geekmidas/manifest": "~10.0.0-alpha.112",
|
|
5965
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.112",
|
|
5966
|
+
"@geekmidas/schema": "~10.0.0-alpha.112",
|
|
5967
|
+
"@geekmidas/services": "~10.0.0-alpha.112",
|
|
5968
|
+
"@geekmidas/storage": "~10.0.0-alpha.112",
|
|
5969
|
+
"@geekmidas/telescope": "~10.0.0-alpha.112",
|
|
5970
|
+
"@geekmidas/testkit": "~10.0.0-alpha.112",
|
|
5971
5971
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
5972
5972
|
};
|
|
5973
5973
|
//#endregion
|
|
@@ -7160,7 +7160,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
|
|
|
7160
7160
|
* The `uses:` value for the stages action, with a comment saying which CLI
|
|
7161
7161
|
* release the pinned commit is.
|
|
7162
7162
|
*/
|
|
7163
|
-
function stagesActionUses(commit = "
|
|
7163
|
+
function stagesActionUses(commit = "4f82632d8355cb858b895c3caf36228e040d39b0", version = cliVersion()) {
|
|
7164
7164
|
return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
|
|
7165
7165
|
}
|
|
7166
7166
|
//#endregion
|
|
@@ -7659,26 +7659,6 @@ ${registryLogin(registry)}
|
|
|
7659
7659
|
SHA: \${{ steps.commit.outputs.sha }}
|
|
7660
7660
|
GODADDY_API_TOKEN: \${{ secrets.GODADDY_API_TOKEN }}
|
|
7661
7661
|
HOSTINGER_API_TOKEN: \${{ secrets.HOSTINGER_API_TOKEN }}
|
|
7662
|
-
${options.mobileApp ? publishMobile(pm.exec) : ""}`;
|
|
7663
|
-
}
|
|
7664
|
-
/**
|
|
7665
|
-
* The phone app, once its stage's servers run this release: its values
|
|
7666
|
-
* synced to the stage's EAS environment, then an update on the stage's
|
|
7667
|
-
* channel when a store build has its native code, or a store build
|
|
7668
|
-
* submitted to the stores when none does (\`gkm publish\`). The build runs
|
|
7669
|
-
* on EAS; this step only starts it.
|
|
7670
|
-
*/
|
|
7671
|
-
function publishMobile(exec) {
|
|
7672
|
-
return `
|
|
7673
|
-
# The phone app, after its servers: an update when a store build has
|
|
7674
|
-
# this native code, a store build submitted to the stores when none
|
|
7675
|
-
# does. EXPO_TOKEN is a secret on the stage's environment (an EAS
|
|
7676
|
-
# access token); the build runs on EAS, not here.
|
|
7677
|
-
- name: Publish the app
|
|
7678
|
-
run: ${exec} gkm publish --stage "$STAGE"
|
|
7679
|
-
env:
|
|
7680
|
-
STAGE: \${{ matrix.stage }}
|
|
7681
|
-
EXPO_TOKEN: \${{ secrets.EXPO_TOKEN }}
|
|
7682
7662
|
`;
|
|
7683
7663
|
}
|
|
7684
7664
|
/**
|
|
@@ -7784,6 +7764,97 @@ function generateGithubFiles(options) {
|
|
|
7784
7764
|
return files;
|
|
7785
7765
|
}
|
|
7786
7766
|
//#endregion
|
|
7767
|
+
//#region src/mobile/easWorkflow.ts
|
|
7768
|
+
/**
|
|
7769
|
+
* A stage's EAS workflow (`.eas/workflows/publish-<stage>.yml`): what
|
|
7770
|
+
* `gkm publish` does, run by EAS itself — so shipping the app needs no CI
|
|
7771
|
+
* of the project's own, no runner and no token in GitHub.
|
|
7772
|
+
*
|
|
7773
|
+
* Per platform: the native code's fingerprint, read with the stage's EAS
|
|
7774
|
+
* environment; a finished store build of the stage's profile with that
|
|
7775
|
+
* fingerprint; then an update on the stage's channel when there is one, or
|
|
7776
|
+
* a store build, submitted with the stage's submit profile, when there is
|
|
7777
|
+
* not. iOS is submitted once `submit.<stage>.ios.ascAppId` is set — until
|
|
7778
|
+
* then it is built and not submitted.
|
|
7779
|
+
*
|
|
7780
|
+
* It runs when the stage is deployed: the protected stage on a release tag
|
|
7781
|
+
* (`v*`), every other deployed stage on a push to `main` — and on demand,
|
|
7782
|
+
* `eas workflow:run .eas/workflows/publish-<stage>.yml`. The values a build
|
|
7783
|
+
* reads are the stage's EAS environment, which `gkm eas:sync` keeps.
|
|
7784
|
+
*
|
|
7785
|
+
* Generated: written by `gkm eas:sync`, and overwritten by the next one.
|
|
7786
|
+
*/
|
|
7787
|
+
/** Where a stage's workflow is written, relative to the app. */
|
|
7788
|
+
function easWorkflowPath(stage) {
|
|
7789
|
+
return `.eas/workflows/publish-${stage}.yml`;
|
|
7790
|
+
}
|
|
7791
|
+
/** The stage's EAS workflow, as YAML. */
|
|
7792
|
+
function easWorkflow(stage, options) {
|
|
7793
|
+
const profile = stage.stage;
|
|
7794
|
+
const jobs = { fingerprint: {
|
|
7795
|
+
name: "Fingerprint",
|
|
7796
|
+
type: "fingerprint",
|
|
7797
|
+
environment: stage.environment
|
|
7798
|
+
} };
|
|
7799
|
+
for (const platform of ["android", "ios"]) {
|
|
7800
|
+
const existing = `get_${platform}_build`;
|
|
7801
|
+
const build = `build_${platform}`;
|
|
7802
|
+
const name = platform === "ios" ? "iOS" : "Android";
|
|
7803
|
+
jobs[existing] = {
|
|
7804
|
+
name: `Find an ${name} store build with this native code`,
|
|
7805
|
+
needs: ["fingerprint"],
|
|
7806
|
+
type: "get-build",
|
|
7807
|
+
params: {
|
|
7808
|
+
fingerprint_hash: `\${{ needs.fingerprint.outputs.${platform}_fingerprint_hash }}`,
|
|
7809
|
+
profile,
|
|
7810
|
+
platform,
|
|
7811
|
+
distribution: "store"
|
|
7812
|
+
}
|
|
7813
|
+
};
|
|
7814
|
+
jobs[build] = {
|
|
7815
|
+
name: `Build ${name}`,
|
|
7816
|
+
needs: [existing],
|
|
7817
|
+
if: `\${{ !needs.${existing}.outputs.build_id }}`,
|
|
7818
|
+
type: "build",
|
|
7819
|
+
params: {
|
|
7820
|
+
platform,
|
|
7821
|
+
profile
|
|
7822
|
+
}
|
|
7823
|
+
};
|
|
7824
|
+
if (platform === "android" || options.iosSubmits) jobs[`submit_${platform}`] = {
|
|
7825
|
+
name: `Submit ${name}`,
|
|
7826
|
+
needs: [build],
|
|
7827
|
+
type: "submit",
|
|
7828
|
+
params: {
|
|
7829
|
+
build_id: `\${{ needs.${build}.outputs.build_id }}`,
|
|
7830
|
+
profile
|
|
7831
|
+
}
|
|
7832
|
+
};
|
|
7833
|
+
jobs[`update_${platform}`] = {
|
|
7834
|
+
name: `Update ${name} on '${stage.channel}'`,
|
|
7835
|
+
needs: [existing],
|
|
7836
|
+
if: `\${{ needs.${existing}.outputs.build_id }}`,
|
|
7837
|
+
type: "update",
|
|
7838
|
+
environment: stage.environment,
|
|
7839
|
+
params: {
|
|
7840
|
+
platform,
|
|
7841
|
+
channel: stage.channel
|
|
7842
|
+
}
|
|
7843
|
+
};
|
|
7844
|
+
}
|
|
7845
|
+
return `${[
|
|
7846
|
+
`# Generated by \`gkm eas:sync --stage ${stage.stage}\`: run it again rather than`,
|
|
7847
|
+
"# editing this file. An update when a store build has this native code,",
|
|
7848
|
+
`# a store build submitted to the stores when none does. Run by hand:`,
|
|
7849
|
+
`# eas workflow:run ${easWorkflowPath(stage.stage)}`,
|
|
7850
|
+
""
|
|
7851
|
+
].join("\n")}${(0, yaml.stringify)({
|
|
7852
|
+
name: `Publish to ${stage.stage}`,
|
|
7853
|
+
on: options.release ? { push: { tags: ["v*"] } } : { push: { branches: ["main"] } },
|
|
7854
|
+
jobs
|
|
7855
|
+
}, { lineWidth: 0 })}`;
|
|
7856
|
+
}
|
|
7857
|
+
//#endregion
|
|
7787
7858
|
//#region src/mobile/stage.ts
|
|
7788
7859
|
/** A `MobileApp`'s `stages` names a stage the project does not deploy. */
|
|
7789
7860
|
var MobileAppStageUndeclared = class extends require_errors.GkmError {
|
|
@@ -8702,6 +8773,35 @@ export default function SigningInScreen() {
|
|
|
8702
8773
|
</SafeAreaView>
|
|
8703
8774
|
);
|
|
8704
8775
|
}
|
|
8776
|
+
`;
|
|
8777
|
+
const appConstructTs = `import { MobileApp } from '@geekmidas/constructs/mobile-app';
|
|
8778
|
+
import { api } from './api.ts';
|
|
8779
|
+
import { auth } from './auth.ts';
|
|
8780
|
+
import { email } from './email.ts';
|
|
8781
|
+
|
|
8782
|
+
/**
|
|
8783
|
+
* The mobile app — a construct like a site, which is what makes it an app.
|
|
8784
|
+
*
|
|
8785
|
+
* \`.dependsOn()\` is the single fact behind what a mobile app otherwise has
|
|
8786
|
+
* written down by hand: its API and auth URLs, its URL scheme, the scheme in
|
|
8787
|
+
* the auth server's trusted origins, Better Auth's Expo plugin, sign-in links
|
|
8788
|
+
* a phone can open — and, on a local stage, the mailer's inbox, so a link sent
|
|
8789
|
+
* in development is read on the device.
|
|
8790
|
+
*/
|
|
8791
|
+
export const app = new MobileApp('App', { path: 'apps/app' }).dependsOn([
|
|
8792
|
+
api,
|
|
8793
|
+
auth,
|
|
8794
|
+
email,
|
|
8795
|
+
]);
|
|
8796
|
+
`;
|
|
8797
|
+
const gitignore = `node_modules/
|
|
8798
|
+
.expo/
|
|
8799
|
+
dist/
|
|
8800
|
+
*.log
|
|
8801
|
+
.env*.local
|
|
8802
|
+
ios/
|
|
8803
|
+
android/
|
|
8804
|
+
.eas/
|
|
8705
8805
|
`;
|
|
8706
8806
|
return [
|
|
8707
8807
|
{
|
|
@@ -8716,6 +8816,13 @@ export default function SigningInScreen() {
|
|
|
8716
8816
|
path: "apps/app/eas.json",
|
|
8717
8817
|
content: `${JSON.stringify(easJson, null, 2)}\n`
|
|
8718
8818
|
},
|
|
8819
|
+
...stages.map((stage) => ({
|
|
8820
|
+
path: `apps/app/${easWorkflowPath(stage.stage)}`,
|
|
8821
|
+
content: easWorkflow(stage, {
|
|
8822
|
+
release: options.stages.protected?.includes(stage.stage) ?? false,
|
|
8823
|
+
iosSubmits: false
|
|
8824
|
+
})
|
|
8825
|
+
})),
|
|
8719
8826
|
{
|
|
8720
8827
|
path: "apps/app/babel.config.js",
|
|
8721
8828
|
content: babelConfig
|
|
@@ -8806,38 +8913,11 @@ export default function SigningInScreen() {
|
|
|
8806
8913
|
},
|
|
8807
8914
|
{
|
|
8808
8915
|
path: "apps/app/.gitignore",
|
|
8809
|
-
content:
|
|
8810
|
-
.expo/
|
|
8811
|
-
dist/
|
|
8812
|
-
*.log
|
|
8813
|
-
.env*.local
|
|
8814
|
-
ios/
|
|
8815
|
-
android/
|
|
8816
|
-
.eas/
|
|
8817
|
-
`
|
|
8916
|
+
content: gitignore
|
|
8818
8917
|
},
|
|
8819
8918
|
{
|
|
8820
8919
|
path: "constructs/app.ts",
|
|
8821
|
-
content:
|
|
8822
|
-
import { api } from './api.ts';
|
|
8823
|
-
import { auth } from './auth.ts';
|
|
8824
|
-
import { email } from './email.ts';
|
|
8825
|
-
|
|
8826
|
-
/**
|
|
8827
|
-
* The mobile app — a construct like a site, which is what makes it an app.
|
|
8828
|
-
*
|
|
8829
|
-
* \`.dependsOn()\` is the single fact behind what a mobile app otherwise has
|
|
8830
|
-
* written down by hand: its API and auth URLs, its URL scheme, the scheme in
|
|
8831
|
-
* the auth server's trusted origins, Better Auth's Expo plugin, sign-in links
|
|
8832
|
-
* a phone can open — and, on a local stage, the mailer's inbox, so a link sent
|
|
8833
|
-
* in development is read on the device.
|
|
8834
|
-
*/
|
|
8835
|
-
export const app = new MobileApp('App', { path: 'apps/app' }).dependsOn([
|
|
8836
|
-
api,
|
|
8837
|
-
auth,
|
|
8838
|
-
email,
|
|
8839
|
-
]);
|
|
8840
|
-
`
|
|
8920
|
+
content: appConstructTs
|
|
8841
8921
|
}
|
|
8842
8922
|
];
|
|
8843
8923
|
}
|
|
@@ -16339,7 +16419,7 @@ program.command("eas:sync").description("Set up a mobile app's EAS project for a
|
|
|
16339
16419
|
try {
|
|
16340
16420
|
const globalOptions = program.opts();
|
|
16341
16421
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16342
|
-
const { easSync } = await Promise.resolve().then(() => require("./eas-
|
|
16422
|
+
const { easSync } = await Promise.resolve().then(() => require("./eas-Cne743nQ.cjs"));
|
|
16343
16423
|
await easSync(options);
|
|
16344
16424
|
} catch (error) {
|
|
16345
16425
|
exitWithError(error);
|
|
@@ -16349,7 +16429,7 @@ program.command("publish").description("Ship a mobile app for a deployed stage:
|
|
|
16349
16429
|
try {
|
|
16350
16430
|
const globalOptions = program.opts();
|
|
16351
16431
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16352
|
-
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish-
|
|
16432
|
+
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish-SDG1WfYn.cjs"));
|
|
16353
16433
|
if (options.build && options.update) throw new PublishModeConflict();
|
|
16354
16434
|
const { build, update, ...rest } = options;
|
|
16355
16435
|
await publish({
|
|
@@ -16365,7 +16445,7 @@ program.command("deploy:google-play").description("Let EAS Submit publish a mobi
|
|
|
16365
16445
|
try {
|
|
16366
16446
|
const globalOptions = program.opts();
|
|
16367
16447
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16368
|
-
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-
|
|
16448
|
+
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-B6uiHi65.cjs"));
|
|
16369
16449
|
await deployGooglePlay(options);
|
|
16370
16450
|
} catch (error) {
|
|
16371
16451
|
exitWithError(error);
|
|
@@ -16839,6 +16919,8 @@ try {
|
|
|
16839
16919
|
program.parse();
|
|
16840
16920
|
//#endregion
|
|
16841
16921
|
exports.canPrompt = canPrompt;
|
|
16922
|
+
exports.easWorkflow = easWorkflow;
|
|
16923
|
+
exports.easWorkflowPath = easWorkflowPath;
|
|
16842
16924
|
exports.formatError = formatError;
|
|
16843
16925
|
exports.generateFullstackCustomSecrets = generateFullstackCustomSecrets;
|
|
16844
16926
|
exports.mobileStage = mobileStage;
|