@qpqjs/cli 0.0.0-stage → 0.2.1
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 +92 -2
- package/docker/cdk-deployer/Dockerfile +13 -0
- package/docker/dev-server/Dockerfile +47 -0
- package/lib/commonjs/bin/qpq.d.ts +2 -0
- package/lib/commonjs/bin/qpq.js +6 -0
- package/lib/commonjs/bin/qpq.js.map +1 -0
- package/lib/commonjs/bin/qpqCdkApp.d.ts +1 -0
- package/lib/commonjs/bin/qpqCdkApp.js +8 -0
- package/lib/commonjs/bin/qpqCdkApp.js.map +1 -0
- package/lib/commonjs/cli/commandMenu.d.ts +2 -0
- package/lib/commonjs/cli/commandMenu.js +81 -0
- package/lib/commonjs/cli/commandMenu.js.map +1 -0
- package/lib/commonjs/cli/commandRegistry.d.ts +10 -0
- package/lib/commonjs/cli/commandRegistry.js +177 -0
- package/lib/commonjs/cli/commandRegistry.js.map +1 -0
- package/lib/commonjs/cli/index.d.ts +1 -0
- package/lib/commonjs/cli/index.js +18 -0
- package/lib/commonjs/cli/index.js.map +1 -0
- package/lib/commonjs/cli/runCli.d.ts +1 -0
- package/lib/commonjs/cli/runCli.js +86 -0
- package/lib/commonjs/cli/runCli.js.map +1 -0
- package/lib/commonjs/commands/checkCircular.d.ts +1 -0
- package/lib/commonjs/commands/checkCircular.js +70 -0
- package/lib/commonjs/commands/checkCircular.js.map +1 -0
- package/lib/commonjs/commands/clearResources.d.ts +1 -0
- package/lib/commonjs/commands/clearResources.js +36 -0
- package/lib/commonjs/commands/clearResources.js.map +1 -0
- package/lib/commonjs/commands/go.d.ts +1 -0
- package/lib/commonjs/commands/go.js +30 -0
- package/lib/commonjs/commands/go.js.map +1 -0
- package/lib/commonjs/commands/goDev.d.ts +1 -0
- package/lib/commonjs/commands/goDev.js +46 -0
- package/lib/commonjs/commands/goDev.js.map +1 -0
- package/lib/commonjs/commands/goDevApi.d.ts +1 -0
- package/lib/commonjs/commands/goDevApi.js +158 -0
- package/lib/commonjs/commands/goDevApi.js.map +1 -0
- package/lib/commonjs/commands/goDevWeb.d.ts +4 -0
- package/lib/commonjs/commands/goDevWeb.js +144 -0
- package/lib/commonjs/commands/goDevWeb.js.map +1 -0
- package/lib/commonjs/commands/goDocker.d.ts +1 -0
- package/lib/commonjs/commands/goDocker.js +43 -0
- package/lib/commonjs/commands/goDocker.js.map +1 -0
- package/lib/commonjs/commands/hooks.d.ts +1 -0
- package/lib/commonjs/commands/hooks.js +39 -0
- package/lib/commonjs/commands/hooks.js.map +1 -0
- package/lib/commonjs/commands/migrate.d.ts +1 -0
- package/lib/commonjs/commands/migrate.js +70 -0
- package/lib/commonjs/commands/migrate.js.map +1 -0
- package/lib/commonjs/commands/prep.d.ts +1 -0
- package/lib/commonjs/commands/prep.js +28 -0
- package/lib/commonjs/commands/prep.js.map +1 -0
- package/lib/commonjs/commands/publish.d.ts +4 -0
- package/lib/commonjs/commands/publish.js +54 -0
- package/lib/commonjs/commands/publish.js.map +1 -0
- package/lib/commonjs/commands/scriptBuild.d.ts +1 -0
- package/lib/commonjs/commands/scriptBuild.js +46 -0
- package/lib/commonjs/commands/scriptBuild.js.map +1 -0
- package/lib/commonjs/commands/scriptBuilderLayer.d.ts +1 -0
- package/lib/commonjs/commands/scriptBuilderLayer.js +48 -0
- package/lib/commonjs/commands/scriptBuilderLayer.js.map +1 -0
- package/lib/commonjs/commands/scriptNew.d.ts +1 -0
- package/lib/commonjs/commands/scriptNew.js +35 -0
- package/lib/commonjs/commands/scriptNew.js.map +1 -0
- package/lib/commonjs/commands/setup.d.ts +1 -0
- package/lib/commonjs/commands/setup.js +102 -0
- package/lib/commonjs/commands/setup.js.map +1 -0
- package/lib/commonjs/commands/synth.d.ts +1 -0
- package/lib/commonjs/commands/synth.js +89 -0
- package/lib/commonjs/commands/synth.js.map +1 -0
- package/lib/commonjs/commands/teardown.d.ts +1 -0
- package/lib/commonjs/commands/teardown.js +33 -0
- package/lib/commonjs/commands/teardown.js.map +1 -0
- package/lib/commonjs/index.d.ts +1 -0
- package/lib/commonjs/index.js +18 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lib/args.d.ts +3 -0
- package/lib/commonjs/lib/args.js +31 -0
- package/lib/commonjs/lib/args.js.map +1 -0
- package/lib/commonjs/lib/circularImports.d.ts +3 -0
- package/lib/commonjs/lib/circularImports.js +79 -0
- package/lib/commonjs/lib/circularImports.js.map +1 -0
- package/lib/commonjs/lib/clearResourcesPlan.d.ts +15 -0
- package/lib/commonjs/lib/clearResourcesPlan.js +79 -0
- package/lib/commonjs/lib/clearResourcesPlan.js.map +1 -0
- package/lib/commonjs/lib/deployPrompts.d.ts +26 -0
- package/lib/commonjs/lib/deployPrompts.js +118 -0
- package/lib/commonjs/lib/deployPrompts.js.map +1 -0
- package/lib/commonjs/lib/devServerEntry.d.ts +22 -0
- package/lib/commonjs/lib/devServerEntry.js +135 -0
- package/lib/commonjs/lib/devServerEntry.js.map +1 -0
- package/lib/commonjs/lib/devServerPorts.d.ts +13 -0
- package/lib/commonjs/lib/devServerPorts.js +36 -0
- package/lib/commonjs/lib/devServerPorts.js.map +1 -0
- package/lib/commonjs/lib/discovery.d.ts +10 -0
- package/lib/commonjs/lib/discovery.js +56 -0
- package/lib/commonjs/lib/discovery.js.map +1 -0
- package/lib/commonjs/lib/getDefaultHookJobs.d.ts +2 -0
- package/lib/commonjs/lib/getDefaultHookJobs.js +11 -0
- package/lib/commonjs/lib/getDefaultHookJobs.js.map +1 -0
- package/lib/commonjs/lib/getDeployTargetLabel.d.ts +2 -0
- package/lib/commonjs/lib/getDeployTargetLabel.js +12 -0
- package/lib/commonjs/lib/getDeployTargetLabel.js.map +1 -0
- package/lib/commonjs/lib/goDockerMode.d.ts +6 -0
- package/lib/commonjs/lib/goDockerMode.js +23 -0
- package/lib/commonjs/lib/goDockerMode.js.map +1 -0
- package/lib/commonjs/lib/hooks.d.ts +9 -0
- package/lib/commonjs/lib/hooks.js +178 -0
- package/lib/commonjs/lib/hooks.js.map +1 -0
- package/lib/commonjs/lib/keepOtherDevServersFlag.d.ts +1 -0
- package/lib/commonjs/lib/keepOtherDevServersFlag.js +11 -0
- package/lib/commonjs/lib/keepOtherDevServersFlag.js.map +1 -0
- package/lib/commonjs/lib/killChildWithEscalation.d.ts +10 -0
- package/lib/commonjs/lib/killChildWithEscalation.js +33 -0
- package/lib/commonjs/lib/killChildWithEscalation.js.map +1 -0
- package/lib/commonjs/lib/killStaleListeners.d.ts +17 -0
- package/lib/commonjs/lib/killStaleListeners.js +220 -0
- package/lib/commonjs/lib/killStaleListeners.js.map +1 -0
- package/lib/commonjs/lib/packageRoot.d.ts +1 -0
- package/lib/commonjs/lib/packageRoot.js +21 -0
- package/lib/commonjs/lib/packageRoot.js.map +1 -0
- package/lib/commonjs/lib/prompts.d.ts +15 -0
- package/lib/commonjs/lib/prompts.js +78 -0
- package/lib/commonjs/lib/prompts.js.map +1 -0
- package/lib/commonjs/lib/qpqConfigs.d.ts +4 -0
- package/lib/commonjs/lib/qpqConfigs.js +27 -0
- package/lib/commonjs/lib/qpqConfigs.js.map +1 -0
- package/lib/commonjs/lib/resolveAppSelection.d.ts +6 -0
- package/lib/commonjs/lib/resolveAppSelection.js +58 -0
- package/lib/commonjs/lib/resolveAppSelection.js.map +1 -0
- package/lib/commonjs/lib/resolveDeployment.d.ts +14 -0
- package/lib/commonjs/lib/resolveDeployment.js +58 -0
- package/lib/commonjs/lib/resolveDeployment.js.map +1 -0
- package/lib/commonjs/lib/runCommand.d.ts +14 -0
- package/lib/commonjs/lib/runCommand.js +103 -0
- package/lib/commonjs/lib/runCommand.js.map +1 -0
- package/lib/commonjs/lib/runTasks.d.ts +15 -0
- package/lib/commonjs/lib/runTasks.js +123 -0
- package/lib/commonjs/lib/runTasks.js.map +1 -0
- package/lib/commonjs/lib/setupStep.d.ts +16 -0
- package/lib/commonjs/lib/setupStep.js +3 -0
- package/lib/commonjs/lib/setupStep.js.map +1 -0
- package/lib/commonjs/lib/timing.d.ts +2 -0
- package/lib/commonjs/lib/timing.js +11 -0
- package/lib/commonjs/lib/timing.js.map +1 -0
- package/lib/commonjs/lib/typeWatcher.d.ts +2 -0
- package/lib/commonjs/lib/typeWatcher.js +59 -0
- package/lib/commonjs/lib/typeWatcher.js.map +1 -0
- package/lib/commonjs/lib/userScriptBuilderLayer.d.ts +23 -0
- package/lib/commonjs/lib/userScriptBuilderLayer.js +74 -0
- package/lib/commonjs/lib/userScriptBuilderLayer.js.map +1 -0
- package/lib/commonjs/lib/userScriptTemplate.d.ts +6 -0
- package/lib/commonjs/lib/userScriptTemplate.js +47 -0
- package/lib/commonjs/lib/userScriptTemplate.js.map +1 -0
- package/lib/commonjs/lib/views.d.ts +2 -0
- package/lib/commonjs/lib/views.js +31 -0
- package/lib/commonjs/lib/views.js.map +1 -0
- package/lib/commonjs/lib/webAddressingEnv.d.ts +7 -0
- package/lib/commonjs/lib/webAddressingEnv.js +16 -0
- package/lib/commonjs/lib/webAddressingEnv.js.map +1 -0
- package/lib/commonjs/platforms/aws/awsCredentials.d.ts +1 -0
- package/lib/commonjs/platforms/aws/awsCredentials.js +28 -0
- package/lib/commonjs/platforms/aws/awsCredentials.js.map +1 -0
- package/lib/commonjs/platforms/aws/cdkApp.d.ts +3 -0
- package/lib/commonjs/platforms/aws/cdkApp.js +31 -0
- package/lib/commonjs/platforms/aws/cdkApp.js.map +1 -0
- package/lib/commonjs/platforms/aws/clearResources.d.ts +2 -0
- package/lib/commonjs/platforms/aws/clearResources.js +167 -0
- package/lib/commonjs/platforms/aws/clearResources.js.map +1 -0
- package/lib/commonjs/platforms/aws/go.d.ts +2 -0
- package/lib/commonjs/platforms/aws/go.js +131 -0
- package/lib/commonjs/platforms/aws/go.js.map +1 -0
- package/lib/commonjs/platforms/aws/goDocker.d.ts +3 -0
- package/lib/commonjs/platforms/aws/goDocker.js +457 -0
- package/lib/commonjs/platforms/aws/goDocker.js.map +1 -0
- package/lib/commonjs/platforms/aws/goDockerManifest.d.ts +44 -0
- package/lib/commonjs/platforms/aws/goDockerManifest.js +38 -0
- package/lib/commonjs/platforms/aws/goDockerManifest.js.map +1 -0
- package/lib/commonjs/platforms/aws/index.d.ts +2 -0
- package/lib/commonjs/platforms/aws/index.js +23 -0
- package/lib/commonjs/platforms/aws/index.js.map +1 -0
- package/lib/commonjs/platforms/aws/prepareDeployment.d.ts +3 -0
- package/lib/commonjs/platforms/aws/prepareDeployment.js +10 -0
- package/lib/commonjs/platforms/aws/prepareDeployment.js.map +1 -0
- package/lib/commonjs/platforms/aws/publish.d.ts +4 -0
- package/lib/commonjs/platforms/aws/publish.js +66 -0
- package/lib/commonjs/platforms/aws/publish.js.map +1 -0
- package/lib/commonjs/platforms/aws/remote.d.ts +11 -0
- package/lib/commonjs/platforms/aws/remote.js +105 -0
- package/lib/commonjs/platforms/aws/remote.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/awsSetupContext.d.ts +12 -0
- package/lib/commonjs/platforms/aws/setup/awsSetupContext.js +20 -0
- package/lib/commonjs/platforms/aws/setup/awsSetupContext.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/awsSetupSteps.d.ts +8 -0
- package/lib/commonjs/platforms/aws/setup/awsSetupSteps.js +44 -0
- package/lib/commonjs/platforms/aws/setup/awsSetupSteps.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildBucketNamesStep.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/buildBucketNamesStep.js +77 -0
- package/lib/commonjs/platforms/aws/setup/buildBucketNamesStep.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildCdkBootstrapSteps.d.ts +5 -0
- package/lib/commonjs/platforms/aws/setup/buildCdkBootstrapSteps.js +38 -0
- package/lib/commonjs/platforms/aws/setup/buildCdkBootstrapSteps.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildGithubDeployRoleStep.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/buildGithubDeployRoleStep.js +55 -0
- package/lib/commonjs/platforms/aws/setup/buildGithubDeployRoleStep.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildGithubOidcProviderStep.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/buildGithubOidcProviderStep.js +54 -0
- package/lib/commonjs/platforms/aws/setup/buildGithubOidcProviderStep.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildHostedZonesStep.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/buildHostedZonesStep.js +63 -0
- package/lib/commonjs/platforms/aws/setup/buildHostedZonesStep.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildIamCapabilityStep.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/buildIamCapabilityStep.js +48 -0
- package/lib/commonjs/platforms/aws/setup/buildIamCapabilityStep.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildIdentityStep.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/buildIdentityStep.js +39 -0
- package/lib/commonjs/platforms/aws/setup/buildIdentityStep.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/buildStackSteps.d.ts +5 -0
- package/lib/commonjs/platforms/aws/setup/buildStackSteps.js +32 -0
- package/lib/commonjs/platforms/aws/setup/buildStackSteps.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/describeStackStatus.d.ts +4 -0
- package/lib/commonjs/platforms/aws/setup/describeStackStatus.js +32 -0
- package/lib/commonjs/platforms/aws/setup/describeStackStatus.js.map +1 -0
- package/lib/commonjs/platforms/aws/setup/index.d.ts +1 -0
- package/lib/commonjs/platforms/aws/setup/index.js +18 -0
- package/lib/commonjs/platforms/aws/setup/index.js.map +1 -0
- package/lib/commonjs/platforms/aws/stacks.d.ts +7 -0
- package/lib/commonjs/platforms/aws/stacks.js +94 -0
- package/lib/commonjs/platforms/aws/stacks.js.map +1 -0
- package/lib/commonjs/platforms/aws/teardown.d.ts +2 -0
- package/lib/commonjs/platforms/aws/teardown.js +59 -0
- package/lib/commonjs/platforms/aws/teardown.js.map +1 -0
- package/lib/commonjs/platforms/aws/viewsSync.d.ts +3 -0
- package/lib/commonjs/platforms/aws/viewsSync.js +77 -0
- package/lib/commonjs/platforms/aws/viewsSync.js.map +1 -0
- package/lib/commonjs/platforms/docker/QpqDockerPlatformSettings.d.ts +10 -0
- package/lib/commonjs/platforms/docker/QpqDockerPlatformSettings.js +3 -0
- package/lib/commonjs/platforms/docker/QpqDockerPlatformSettings.js.map +1 -0
- package/lib/commonjs/platforms/docker/getContainerPorts.d.ts +4 -0
- package/lib/commonjs/platforms/docker/getContainerPorts.js +12 -0
- package/lib/commonjs/platforms/docker/getContainerPorts.js.map +1 -0
- package/lib/commonjs/platforms/docker/getDefaultPortMappings.d.ts +3 -0
- package/lib/commonjs/platforms/docker/getDefaultPortMappings.js +10 -0
- package/lib/commonjs/platforms/docker/getDefaultPortMappings.js.map +1 -0
- package/lib/commonjs/platforms/docker/getDockerPlatformSettings.d.ts +14 -0
- package/lib/commonjs/platforms/docker/getDockerPlatformSettings.js +39 -0
- package/lib/commonjs/platforms/docker/getDockerPlatformSettings.js.map +1 -0
- package/lib/commonjs/platforms/docker/getImageName.d.ts +6 -0
- package/lib/commonjs/platforms/docker/getImageName.js +10 -0
- package/lib/commonjs/platforms/docker/getImageName.js.map +1 -0
- package/lib/commonjs/platforms/docker/go.d.ts +2 -0
- package/lib/commonjs/platforms/docker/go.js +261 -0
- package/lib/commonjs/platforms/docker/go.js.map +1 -0
- package/lib/commonjs/platforms/docker/index.d.ts +2 -0
- package/lib/commonjs/platforms/docker/index.js +43 -0
- package/lib/commonjs/platforms/docker/index.js.map +1 -0
- package/lib/commonjs/platforms/docker/parseMounts.d.ts +7 -0
- package/lib/commonjs/platforms/docker/parseMounts.js +27 -0
- package/lib/commonjs/platforms/docker/parseMounts.js.map +1 -0
- package/lib/commonjs/platforms/docker/parsePortMappings.d.ts +8 -0
- package/lib/commonjs/platforms/docker/parsePortMappings.js +26 -0
- package/lib/commonjs/platforms/docker/parsePortMappings.js.map +1 -0
- package/lib/commonjs/platforms/docker/resolvePortMappings.d.ts +8 -0
- package/lib/commonjs/platforms/docker/resolvePortMappings.js +23 -0
- package/lib/commonjs/platforms/docker/resolvePortMappings.js.map +1 -0
- package/lib/commonjs/platforms/docker/writeComposeFile.d.ts +20 -0
- package/lib/commonjs/platforms/docker/writeComposeFile.js +44 -0
- package/lib/commonjs/platforms/docker/writeComposeFile.js.map +1 -0
- package/lib/commonjs/platforms/index.d.ts +3 -0
- package/lib/commonjs/platforms/index.js +35 -0
- package/lib/commonjs/platforms/index.js.map +1 -0
- package/lib/commonjs/platforms/types.d.ts +21 -0
- package/lib/commonjs/platforms/types.js +9 -0
- package/lib/commonjs/platforms/types.js.map +1 -0
- package/lib/esm/bin/qpq.d.ts +2 -0
- package/lib/esm/bin/qpq.js +4 -0
- package/lib/esm/bin/qpq.js.map +1 -0
- package/lib/esm/bin/qpqCdkApp.d.ts +1 -0
- package/lib/esm/bin/qpqCdkApp.js +6 -0
- package/lib/esm/bin/qpqCdkApp.js.map +1 -0
- package/lib/esm/cli/commandMenu.d.ts +2 -0
- package/lib/esm/cli/commandMenu.js +67 -0
- package/lib/esm/cli/commandMenu.js.map +1 -0
- package/lib/esm/cli/commandRegistry.d.ts +10 -0
- package/lib/esm/cli/commandRegistry.js +161 -0
- package/lib/esm/cli/commandRegistry.js.map +1 -0
- package/lib/esm/cli/index.d.ts +1 -0
- package/lib/esm/cli/index.js +2 -0
- package/lib/esm/cli/index.js.map +1 -0
- package/lib/esm/cli/runCli.d.ts +1 -0
- package/lib/esm/cli/runCli.js +73 -0
- package/lib/esm/cli/runCli.js.map +1 -0
- package/lib/esm/commands/checkCircular.d.ts +1 -0
- package/lib/esm/commands/checkCircular.js +55 -0
- package/lib/esm/commands/checkCircular.js.map +1 -0
- package/lib/esm/commands/clearResources.d.ts +1 -0
- package/lib/esm/commands/clearResources.js +23 -0
- package/lib/esm/commands/clearResources.js.map +1 -0
- package/lib/esm/commands/go.d.ts +1 -0
- package/lib/esm/commands/go.js +16 -0
- package/lib/esm/commands/go.js.map +1 -0
- package/lib/esm/commands/goDev.d.ts +1 -0
- package/lib/esm/commands/goDev.js +33 -0
- package/lib/esm/commands/goDev.js.map +1 -0
- package/lib/esm/commands/goDevApi.d.ts +1 -0
- package/lib/esm/commands/goDevApi.js +142 -0
- package/lib/esm/commands/goDevApi.js.map +1 -0
- package/lib/esm/commands/goDevWeb.d.ts +4 -0
- package/lib/esm/commands/goDevWeb.js +129 -0
- package/lib/esm/commands/goDevWeb.js.map +1 -0
- package/lib/esm/commands/goDocker.d.ts +1 -0
- package/lib/esm/commands/goDocker.js +29 -0
- package/lib/esm/commands/goDocker.js.map +1 -0
- package/lib/esm/commands/hooks.d.ts +1 -0
- package/lib/esm/commands/hooks.js +26 -0
- package/lib/esm/commands/hooks.js.map +1 -0
- package/lib/esm/commands/migrate.d.ts +1 -0
- package/lib/esm/commands/migrate.js +57 -0
- package/lib/esm/commands/migrate.js.map +1 -0
- package/lib/esm/commands/prep.d.ts +1 -0
- package/lib/esm/commands/prep.js +15 -0
- package/lib/esm/commands/prep.js.map +1 -0
- package/lib/esm/commands/publish.d.ts +4 -0
- package/lib/esm/commands/publish.js +38 -0
- package/lib/esm/commands/publish.js.map +1 -0
- package/lib/esm/commands/scriptBuild.d.ts +1 -0
- package/lib/esm/commands/scriptBuild.js +29 -0
- package/lib/esm/commands/scriptBuild.js.map +1 -0
- package/lib/esm/commands/scriptBuilderLayer.d.ts +1 -0
- package/lib/esm/commands/scriptBuilderLayer.js +34 -0
- package/lib/esm/commands/scriptBuilderLayer.js.map +1 -0
- package/lib/esm/commands/scriptNew.d.ts +1 -0
- package/lib/esm/commands/scriptNew.js +19 -0
- package/lib/esm/commands/scriptNew.js.map +1 -0
- package/lib/esm/commands/setup.d.ts +1 -0
- package/lib/esm/commands/setup.js +88 -0
- package/lib/esm/commands/setup.js.map +1 -0
- package/lib/esm/commands/synth.d.ts +1 -0
- package/lib/esm/commands/synth.js +73 -0
- package/lib/esm/commands/synth.js.map +1 -0
- package/lib/esm/commands/teardown.d.ts +1 -0
- package/lib/esm/commands/teardown.js +20 -0
- package/lib/esm/commands/teardown.js.map +1 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/lib/args.d.ts +3 -0
- package/lib/esm/lib/args.js +25 -0
- package/lib/esm/lib/args.js.map +1 -0
- package/lib/esm/lib/circularImports.d.ts +3 -0
- package/lib/esm/lib/circularImports.js +61 -0
- package/lib/esm/lib/circularImports.js.map +1 -0
- package/lib/esm/lib/clearResourcesPlan.d.ts +15 -0
- package/lib/esm/lib/clearResourcesPlan.js +65 -0
- package/lib/esm/lib/clearResourcesPlan.js.map +1 -0
- package/lib/esm/lib/deployPrompts.d.ts +26 -0
- package/lib/esm/lib/deployPrompts.js +103 -0
- package/lib/esm/lib/deployPrompts.js.map +1 -0
- package/lib/esm/lib/devServerEntry.d.ts +22 -0
- package/lib/esm/lib/devServerEntry.js +127 -0
- package/lib/esm/lib/devServerEntry.js.map +1 -0
- package/lib/esm/lib/devServerPorts.d.ts +13 -0
- package/lib/esm/lib/devServerPorts.js +27 -0
- package/lib/esm/lib/devServerPorts.js.map +1 -0
- package/lib/esm/lib/discovery.d.ts +10 -0
- package/lib/esm/lib/discovery.js +40 -0
- package/lib/esm/lib/discovery.js.map +1 -0
- package/lib/esm/lib/getDefaultHookJobs.d.ts +2 -0
- package/lib/esm/lib/getDefaultHookJobs.js +4 -0
- package/lib/esm/lib/getDefaultHookJobs.js.map +1 -0
- package/lib/esm/lib/getDeployTargetLabel.d.ts +2 -0
- package/lib/esm/lib/getDeployTargetLabel.js +8 -0
- package/lib/esm/lib/getDeployTargetLabel.js.map +1 -0
- package/lib/esm/lib/goDockerMode.d.ts +6 -0
- package/lib/esm/lib/goDockerMode.js +19 -0
- package/lib/esm/lib/goDockerMode.js.map +1 -0
- package/lib/esm/lib/hooks.d.ts +9 -0
- package/lib/esm/lib/hooks.js +154 -0
- package/lib/esm/lib/hooks.js.map +1 -0
- package/lib/esm/lib/keepOtherDevServersFlag.d.ts +1 -0
- package/lib/esm/lib/keepOtherDevServersFlag.js +8 -0
- package/lib/esm/lib/keepOtherDevServersFlag.js.map +1 -0
- package/lib/esm/lib/killChildWithEscalation.d.ts +10 -0
- package/lib/esm/lib/killChildWithEscalation.js +29 -0
- package/lib/esm/lib/killChildWithEscalation.js.map +1 -0
- package/lib/esm/lib/killStaleListeners.d.ts +17 -0
- package/lib/esm/lib/killStaleListeners.js +210 -0
- package/lib/esm/lib/killStaleListeners.js.map +1 -0
- package/lib/esm/lib/packageRoot.d.ts +1 -0
- package/lib/esm/lib/packageRoot.js +14 -0
- package/lib/esm/lib/packageRoot.js.map +1 -0
- package/lib/esm/lib/prompts.d.ts +15 -0
- package/lib/esm/lib/prompts.js +28 -0
- package/lib/esm/lib/prompts.js.map +1 -0
- package/lib/esm/lib/qpqConfigs.d.ts +4 -0
- package/lib/esm/lib/qpqConfigs.js +21 -0
- package/lib/esm/lib/qpqConfigs.js.map +1 -0
- package/lib/esm/lib/resolveAppSelection.d.ts +6 -0
- package/lib/esm/lib/resolveAppSelection.js +45 -0
- package/lib/esm/lib/resolveAppSelection.js.map +1 -0
- package/lib/esm/lib/resolveDeployment.d.ts +14 -0
- package/lib/esm/lib/resolveDeployment.js +45 -0
- package/lib/esm/lib/resolveDeployment.js.map +1 -0
- package/lib/esm/lib/runCommand.d.ts +14 -0
- package/lib/esm/lib/runCommand.js +92 -0
- package/lib/esm/lib/runCommand.js.map +1 -0
- package/lib/esm/lib/runTasks.d.ts +15 -0
- package/lib/esm/lib/runTasks.js +108 -0
- package/lib/esm/lib/runTasks.js.map +1 -0
- package/lib/esm/lib/setupStep.d.ts +16 -0
- package/lib/esm/lib/setupStep.js +2 -0
- package/lib/esm/lib/setupStep.js.map +1 -0
- package/lib/esm/lib/timing.d.ts +2 -0
- package/lib/esm/lib/timing.js +6 -0
- package/lib/esm/lib/timing.js.map +1 -0
- package/lib/esm/lib/typeWatcher.d.ts +2 -0
- package/lib/esm/lib/typeWatcher.js +51 -0
- package/lib/esm/lib/typeWatcher.js.map +1 -0
- package/lib/esm/lib/userScriptBuilderLayer.d.ts +23 -0
- package/lib/esm/lib/userScriptBuilderLayer.js +65 -0
- package/lib/esm/lib/userScriptBuilderLayer.js.map +1 -0
- package/lib/esm/lib/userScriptTemplate.d.ts +6 -0
- package/lib/esm/lib/userScriptTemplate.js +39 -0
- package/lib/esm/lib/userScriptTemplate.js.map +1 -0
- package/lib/esm/lib/views.d.ts +2 -0
- package/lib/esm/lib/views.js +14 -0
- package/lib/esm/lib/views.js.map +1 -0
- package/lib/esm/lib/webAddressingEnv.d.ts +7 -0
- package/lib/esm/lib/webAddressingEnv.js +11 -0
- package/lib/esm/lib/webAddressingEnv.js.map +1 -0
- package/lib/esm/platforms/aws/awsCredentials.d.ts +1 -0
- package/lib/esm/platforms/aws/awsCredentials.js +15 -0
- package/lib/esm/platforms/aws/awsCredentials.js.map +1 -0
- package/lib/esm/platforms/aws/cdkApp.d.ts +3 -0
- package/lib/esm/platforms/aws/cdkApp.js +22 -0
- package/lib/esm/platforms/aws/cdkApp.js.map +1 -0
- package/lib/esm/platforms/aws/clearResources.d.ts +2 -0
- package/lib/esm/platforms/aws/clearResources.js +151 -0
- package/lib/esm/platforms/aws/clearResources.js.map +1 -0
- package/lib/esm/platforms/aws/go.d.ts +2 -0
- package/lib/esm/platforms/aws/go.js +115 -0
- package/lib/esm/platforms/aws/go.js.map +1 -0
- package/lib/esm/platforms/aws/goDocker.d.ts +3 -0
- package/lib/esm/platforms/aws/goDocker.js +441 -0
- package/lib/esm/platforms/aws/goDocker.js.map +1 -0
- package/lib/esm/platforms/aws/goDockerManifest.d.ts +44 -0
- package/lib/esm/platforms/aws/goDockerManifest.js +26 -0
- package/lib/esm/platforms/aws/goDockerManifest.js.map +1 -0
- package/lib/esm/platforms/aws/index.d.ts +2 -0
- package/lib/esm/platforms/aws/index.js +20 -0
- package/lib/esm/platforms/aws/index.js.map +1 -0
- package/lib/esm/platforms/aws/prepareDeployment.d.ts +3 -0
- package/lib/esm/platforms/aws/prepareDeployment.js +6 -0
- package/lib/esm/platforms/aws/prepareDeployment.js.map +1 -0
- package/lib/esm/platforms/aws/publish.d.ts +4 -0
- package/lib/esm/platforms/aws/publish.js +50 -0
- package/lib/esm/platforms/aws/publish.js.map +1 -0
- package/lib/esm/platforms/aws/remote.d.ts +11 -0
- package/lib/esm/platforms/aws/remote.js +89 -0
- package/lib/esm/platforms/aws/remote.js.map +1 -0
- package/lib/esm/platforms/aws/setup/awsSetupContext.d.ts +12 -0
- package/lib/esm/platforms/aws/setup/awsSetupContext.js +16 -0
- package/lib/esm/platforms/aws/setup/awsSetupContext.js.map +1 -0
- package/lib/esm/platforms/aws/setup/awsSetupSteps.d.ts +8 -0
- package/lib/esm/platforms/aws/setup/awsSetupSteps.js +31 -0
- package/lib/esm/platforms/aws/setup/awsSetupSteps.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildBucketNamesStep.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/buildBucketNamesStep.js +62 -0
- package/lib/esm/platforms/aws/setup/buildBucketNamesStep.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildCdkBootstrapSteps.d.ts +5 -0
- package/lib/esm/platforms/aws/setup/buildCdkBootstrapSteps.js +24 -0
- package/lib/esm/platforms/aws/setup/buildCdkBootstrapSteps.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildGithubDeployRoleStep.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/buildGithubDeployRoleStep.js +40 -0
- package/lib/esm/platforms/aws/setup/buildGithubDeployRoleStep.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildGithubOidcProviderStep.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/buildGithubOidcProviderStep.js +40 -0
- package/lib/esm/platforms/aws/setup/buildGithubOidcProviderStep.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildHostedZonesStep.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/buildHostedZonesStep.js +49 -0
- package/lib/esm/platforms/aws/setup/buildHostedZonesStep.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildIamCapabilityStep.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/buildIamCapabilityStep.js +34 -0
- package/lib/esm/platforms/aws/setup/buildIamCapabilityStep.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildIdentityStep.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/buildIdentityStep.js +26 -0
- package/lib/esm/platforms/aws/setup/buildIdentityStep.js.map +1 -0
- package/lib/esm/platforms/aws/setup/buildStackSteps.d.ts +5 -0
- package/lib/esm/platforms/aws/setup/buildStackSteps.js +17 -0
- package/lib/esm/platforms/aws/setup/buildStackSteps.js.map +1 -0
- package/lib/esm/platforms/aws/setup/describeStackStatus.d.ts +4 -0
- package/lib/esm/platforms/aws/setup/describeStackStatus.js +17 -0
- package/lib/esm/platforms/aws/setup/describeStackStatus.js.map +1 -0
- package/lib/esm/platforms/aws/setup/index.d.ts +1 -0
- package/lib/esm/platforms/aws/setup/index.js +2 -0
- package/lib/esm/platforms/aws/setup/index.js.map +1 -0
- package/lib/esm/platforms/aws/stacks.d.ts +7 -0
- package/lib/esm/platforms/aws/stacks.js +72 -0
- package/lib/esm/platforms/aws/stacks.js.map +1 -0
- package/lib/esm/platforms/aws/teardown.d.ts +2 -0
- package/lib/esm/platforms/aws/teardown.js +46 -0
- package/lib/esm/platforms/aws/teardown.js.map +1 -0
- package/lib/esm/platforms/aws/viewsSync.d.ts +3 -0
- package/lib/esm/platforms/aws/viewsSync.js +60 -0
- package/lib/esm/platforms/aws/viewsSync.js.map +1 -0
- package/lib/esm/platforms/docker/QpqDockerPlatformSettings.d.ts +10 -0
- package/lib/esm/platforms/docker/QpqDockerPlatformSettings.js +2 -0
- package/lib/esm/platforms/docker/QpqDockerPlatformSettings.js.map +1 -0
- package/lib/esm/platforms/docker/getContainerPorts.d.ts +4 -0
- package/lib/esm/platforms/docker/getContainerPorts.js +8 -0
- package/lib/esm/platforms/docker/getContainerPorts.js.map +1 -0
- package/lib/esm/platforms/docker/getDefaultPortMappings.d.ts +3 -0
- package/lib/esm/platforms/docker/getDefaultPortMappings.js +6 -0
- package/lib/esm/platforms/docker/getDefaultPortMappings.js.map +1 -0
- package/lib/esm/platforms/docker/getDockerPlatformSettings.d.ts +14 -0
- package/lib/esm/platforms/docker/getDockerPlatformSettings.js +34 -0
- package/lib/esm/platforms/docker/getDockerPlatformSettings.js.map +1 -0
- package/lib/esm/platforms/docker/getImageName.d.ts +6 -0
- package/lib/esm/platforms/docker/getImageName.js +6 -0
- package/lib/esm/platforms/docker/getImageName.js.map +1 -0
- package/lib/esm/platforms/docker/go.d.ts +2 -0
- package/lib/esm/platforms/docker/go.js +242 -0
- package/lib/esm/platforms/docker/go.js.map +1 -0
- package/lib/esm/platforms/docker/index.d.ts +2 -0
- package/lib/esm/platforms/docker/index.js +31 -0
- package/lib/esm/platforms/docker/index.js.map +1 -0
- package/lib/esm/platforms/docker/parseMounts.d.ts +7 -0
- package/lib/esm/platforms/docker/parseMounts.js +23 -0
- package/lib/esm/platforms/docker/parseMounts.js.map +1 -0
- package/lib/esm/platforms/docker/parsePortMappings.d.ts +8 -0
- package/lib/esm/platforms/docker/parsePortMappings.js +21 -0
- package/lib/esm/platforms/docker/parsePortMappings.js.map +1 -0
- package/lib/esm/platforms/docker/resolvePortMappings.d.ts +8 -0
- package/lib/esm/platforms/docker/resolvePortMappings.js +18 -0
- package/lib/esm/platforms/docker/resolvePortMappings.js.map +1 -0
- package/lib/esm/platforms/docker/writeComposeFile.d.ts +20 -0
- package/lib/esm/platforms/docker/writeComposeFile.js +37 -0
- package/lib/esm/platforms/docker/writeComposeFile.js.map +1 -0
- package/lib/esm/platforms/index.d.ts +3 -0
- package/lib/esm/platforms/index.js +17 -0
- package/lib/esm/platforms/index.js.map +1 -0
- package/lib/esm/platforms/types.d.ts +21 -0
- package/lib/esm/platforms/types.js +6 -0
- package/lib/esm/platforms/types.js.map +1 -0
- package/package.json +71 -3
- package/templates/user-script/README.md +28 -0
- package/templates/user-script/gitignore +2 -0
- package/templates/user-script/package.json +16 -0
- package/templates/user-script/src/main.ts +15 -0
- package/templates/user-script/tsconfig.json +12 -0
package/README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @qpqjs/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `qpq` command line tool: build, dev, and deploy orchestration for [quidproquo](https://github.com/qpqjs/quidproquo) apps.
|
|
4
|
+
|
|
5
|
+
An app scaffolded with `create-qpq-app` already depends on this and aliases the common commands in its npm scripts, so `npm run dev` and `npm run deploy` are the usual way in. Everything else you call as `qpq` directly.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-dev @qpqjs/cli
|
|
9
|
+
npx qpq
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Running `qpq` with no command opens an interactive menu. Every command also takes `--app` and `--deployment` (an entry in `apps/<app>/deploy.config.json`).
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
**Local development**
|
|
17
|
+
|
|
18
|
+
| Command | Does |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `qpq go:dev` | Runs the full local stack, api and web, in one process |
|
|
21
|
+
| `qpq go:dev:api` | Just the api dev server, with hot reload |
|
|
22
|
+
| `qpq go:dev:web` | Just the views microfrontend dev servers |
|
|
23
|
+
| `qpq migrate [app]` | Runs pending migrations against the local dev store once, then exits |
|
|
24
|
+
|
|
25
|
+
**Deploying**
|
|
26
|
+
|
|
27
|
+
| Command | Does |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `qpq setup` | Prepares a cloud environment for its first deploy: checks every step (credentials, IAM, hosted zones, bucket names, CDK bootstrap, then the account, domain and bootstrap stacks with the GitHub OIDC provider and deploy role they create), shows what is already in place, and runs the ones you tick in order. Services are deployed afterwards with `qpq go` or `qpq go:docker`. `--check` only reports, `--yes` runs everything, `--only <ids>` a subset |
|
|
30
|
+
| `qpq go [svc] [stack]` | Deploys services. Interactive unless you pass the positional args |
|
|
31
|
+
| `qpq go:docker` | The same, but deploys in parallel via docker. `--build-only` and `--from-build` split it across machines (see below) |
|
|
32
|
+
| `qpq synth [service]` | Synthesises the configs to `dist/apps/<app>/infrastructure` without deploying |
|
|
33
|
+
| `qpq teardown` | Destroys the web, api, and inf stacks for selected services |
|
|
34
|
+
| `qpq clear-resources` | Empties selected buckets and tables. Data only, stacks are untouched |
|
|
35
|
+
|
|
36
|
+
For `go`, `svc` is `all`, a comma-separated list, or one of `account`, `domain`, `bootstrap`. `stack` is `all`, `inf`, `api`, `web`, or `views`. A full `all all` or `all api` deploy also publishes federated backends.
|
|
37
|
+
|
|
38
|
+
**Splitting a docker deploy across machines**
|
|
39
|
+
|
|
40
|
+
`qpq go:docker` can stop after its build half and resume from the result on another machine, so a CI deploy of a multi-service app can run one job per service and phase while keeping the orders a single `go:docker all all` enforces: every inf stack lands before any api stack, and each api deploy is followed by its federated publish.
|
|
41
|
+
|
|
42
|
+
| Command | Does |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `qpq go:docker <svc> <stack> --build-only` | Builds the app's workspace packages (other apps' are skipped unless this app depends on them), bundles the api, views and federated remote, synthesises the CDK assembly and writes a manifest. No docker needed. AWS credentials are, since `cdk synth` looks up hosted zones and VPCs |
|
|
45
|
+
| `qpq go:docker <svc> <stack> --from-build` | Deploys the chosen stack from that saved build without rebuilding. After `api` it also publishes the federated remote. Needs docker and the same `--deployment`; the workspace does not need to be built |
|
|
46
|
+
|
|
47
|
+
The build prints the directories that make up each service's saved build: `dist/qpq/go-docker/<app>/<svc>` (the assembly and the manifest), plus `dist/apps/<app>/services/<svc>/views` and `dist/apps/<app>/services/<svc>/service-remote-published` when the service has them. Upload those as the job's artifact. A build made with `all` can deploy any stack. One made with a single stack can only deploy that stack, so a build for `inf` cannot deploy `api` and skip the publish.
|
|
48
|
+
|
|
49
|
+
The CI shape is a build matrix (`<svc> all --build-only`, one job per service, in parallel), then `<svc> inf --from-build` for every service, then `api` and `web`, then `views`, each job downloading its artifact first. The `qpq:predeploy` hook runs in the build half only. The saved build holds your bundled code and synthesised templates, never credentials; keep the artifact retention short all the same.
|
|
50
|
+
|
|
51
|
+
`GO_DOCKER_BUILD_CONCURRENCY` caps how many bundles and synths run at once and defaults to the machine's core count. `GO_DOCKER_DEPLOY_CONCURRENCY` caps the deploy containers and defaults to unlimited.
|
|
52
|
+
|
|
53
|
+
**Federated remotes**
|
|
54
|
+
|
|
55
|
+
| Command | Does |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `qpq publish` | Build, upload, and deploy federated remotes |
|
|
58
|
+
| `qpq publish:build` | Build them locally |
|
|
59
|
+
| `qpq publish:upload` | Upload the built version directories. Nothing goes live |
|
|
60
|
+
| `qpq publish:deploy` | Flip the manifests to the uploaded versions |
|
|
61
|
+
|
|
62
|
+
Splitting upload from deploy is what makes a rollback a manifest change rather than a redeploy.
|
|
63
|
+
|
|
64
|
+
**Workspace**
|
|
65
|
+
|
|
66
|
+
| Command | Does |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `qpq prep` | Regenerates `apps/<app>/tsconfig.federated.json` |
|
|
69
|
+
| `qpq script:new <dir>` | Writes a user-script template project: `src/main.ts` exporting functions, built into one `main.js` a service loads from a storage drive with `askUserScriptExecute` |
|
|
70
|
+
| `qpq script:build <dir> [--out <dir>] [--source-map]` | Bundles a user-script project into one file, `dist/main.js` (or `--out`), npm packages folded in, framework packages external, Node builtins refused. No source map unless `--source-map`, which embeds it in `main.js`; a `.map` file is never written. Needs no `npm install` in the project |
|
|
71
|
+
| `qpq script:builder-layer [--arch arm64\|x86_64]` | Installs rspack for the lambda architecture (default arm64, matching `defineJavascriptRuntime`'s default) into the builder layer directory owned by `@qpqjs/user-script`, so a service that registered `defineUserScriptBuilder` can build scripts on lambda. Run it from the app's `qpq:predeploy` hook; it loads no config, since that hook fires before the workspace is built |
|
|
72
|
+
| `qpq check:circular` | Scans workspace sources for circular imports. `--warn` to report without failing |
|
|
73
|
+
| `qpq hooks <name>` | Runs `qpq:<name>` in every app and package that defines it, dependency ordered and in parallel |
|
|
74
|
+
|
|
75
|
+
## User scripts
|
|
76
|
+
|
|
77
|
+
A user script is a small TypeScript project (`src/main.ts` exporting functions) that a service loads from a storage drive and calls by name with `askUserScriptExecute`. `qpq script:new` writes one and `qpq script:build` bundles it on your machine. To build on the platform instead, a service registers `defineUserScriptBuilder()` from `@qpqjs/user-script` and calls `askUserScriptBuild` with the source directory and the output file on a drive, or `askUserScriptBuildFromZip` with the project as one zip file; either writes exactly one file, at the path given, which is what `askUserScriptExecute` is then pointed at; on the dev server that just works, and on lambda the service also needs the rspack layer: pass `getUserScriptBuilderApiLayer()` in its api layers and have the app's `qpq:predeploy` hook run `qpq script:builder-layer` (with `--arch x86_64` if the app's lambdas are x86). Both sides use the one directory the package owns, so no path is configured anywhere.
|
|
78
|
+
|
|
79
|
+
## Platforms
|
|
80
|
+
|
|
81
|
+
The target platform comes from your app's `deploy.config.json`, so the same commands work whichever one an environment uses. AWS and docker are supported today.
|
|
82
|
+
|
|
83
|
+
## Status
|
|
84
|
+
|
|
85
|
+
Pre-1.0. The whole `@qpqjs/*` family releases in lockstep, so versions that share a number were built and tested together. Expect APIs to move between releases, and pin your versions.
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
[docs.quidproquojs.com](https://docs.quidproquojs.com)
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT. See [LICENSE](https://github.com/qpqjs/quidproquo/blob/main/LICENSE).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Deploy runner for `qpq go:docker`. Containers deploy PRE-SYNTHESIZED
|
|
2
|
+
# cloud assemblies (`cdk deploy --app /assembly <stack>`), so the image needs
|
|
3
|
+
# only the CDK CLI — not the workspace, its npm-linked quidproquo packages, or
|
|
4
|
+
# any platform-specific node_modules.
|
|
5
|
+
#
|
|
6
|
+
# CDK_VERSION is passed at build time to match the workspace's aws-cdk, so the
|
|
7
|
+
# CLI can always read the assembly schema the host synthesized.
|
|
8
|
+
FROM node:24-slim
|
|
9
|
+
|
|
10
|
+
ARG CDK_VERSION=2
|
|
11
|
+
RUN npm install -g aws-cdk@${CDK_VERSION}
|
|
12
|
+
|
|
13
|
+
WORKDIR /work
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Runtime image for `qpq go` on the docker platform: the QPQ dev server
|
|
2
|
+
# (a full local platform emulation — sqlite KVS, file storage, queues,
|
|
3
|
+
# websockets) hosting every service of the app, plus the pre-built views.
|
|
4
|
+
#
|
|
5
|
+
# The server bundle externalizes bare packages (native modules must load from
|
|
6
|
+
# a real install), so runtime deps are npm-installed in the image, then the
|
|
7
|
+
# locally-built quidproquo packages are overlaid so the image runs the same
|
|
8
|
+
# qpq code the bundle was built against.
|
|
9
|
+
FROM node:24-trixie-slim
|
|
10
|
+
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
|
|
13
|
+
# Runtime deps (package.json is the consumer root's, with workspaces/scripts
|
|
14
|
+
# stripped by the assemble step). Slow but correct: natives compile for linux.
|
|
15
|
+
# vendor/ must be present before the install: consumers on file: refs have
|
|
16
|
+
# their quidproquo deps rewritten to file:./vendor/<pkg> so npm can resolve
|
|
17
|
+
# them (and their transitive deps) inside the context.
|
|
18
|
+
COPY vendor/ ./vendor/
|
|
19
|
+
COPY package.json ./
|
|
20
|
+
RUN npm install --omit=dev
|
|
21
|
+
|
|
22
|
+
# Overlay the locally-built quidproquo packages over the installed ones.
|
|
23
|
+
# npm leaves file:./vendor deps as symlinks and registry deps as real
|
|
24
|
+
# directories — rm+cp replaces either shape with the vendored code (a plain
|
|
25
|
+
# COPY cannot write a directory over a symlink).
|
|
26
|
+
RUN set -e; for d in ./vendor/*/; do \
|
|
27
|
+
[ -d "$d" ] || continue; \
|
|
28
|
+
pkg="$(basename "$d")"; \
|
|
29
|
+
rm -rf "./node_modules/$pkg"; \
|
|
30
|
+
cp -a "$d" "./node_modules/$pkg"; \
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
COPY server/ ./server/
|
|
34
|
+
COPY web/ ./web/
|
|
35
|
+
|
|
36
|
+
ENV QPQ_WEB_ROOT=/app/web
|
|
37
|
+
ENV NODE_ENV=production
|
|
38
|
+
|
|
39
|
+
# api + site / websocket / file-storage secure urls, then one port per hosted web
|
|
40
|
+
# entry. The build rewrites this line from the app's config.
|
|
41
|
+
EXPOSE 8080 8888 3001
|
|
42
|
+
|
|
43
|
+
# Emulated platform state (KVS JSON files + file storage) lives here — mount
|
|
44
|
+
# a volume to persist it across container restarts.
|
|
45
|
+
VOLUME /app/.qpq-runtime
|
|
46
|
+
|
|
47
|
+
CMD ["node", "server/main.js"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qpq.js","sourceRoot":"","sources":["../../../src/bin/qpq.ts"],"names":[],"mappings":";;;AACA,gCAAgC;AAEhC,IAAA,YAAM,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { runCli } from '../cli';\n\nrunCli(process.argv.slice(2));\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// The CDK app command (`cdk ... --app "node -r ts-node/register/transpile-only <this file>"`).
|
|
4
|
+
// Runs under ts-node hooks so per-app TS config fragments and service
|
|
5
|
+
// infrastructure.ts files can be required directly.
|
|
6
|
+
const deploy_aws_1 = require("@qpqjs/deploy-aws");
|
|
7
|
+
(0, deploy_aws_1.createWorkspaceQpqCdkApp)();
|
|
8
|
+
//# sourceMappingURL=qpqCdkApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qpqCdkApp.js","sourceRoot":"","sources":["../../../src/bin/qpqCdkApp.ts"],"names":[],"mappings":";;AAAA,+FAA+F;AAC/F,sEAAsE;AACtE,oDAAoD;AACpD,kDAA6D;AAE7D,IAAA,qCAAwB,GAAE,CAAC","sourcesContent":["// The CDK app command (`cdk ... --app \"node -r ts-node/register/transpile-only <this file>\"`).\n// Runs under ts-node hooks so per-app TS config fragments and service\n// infrastructure.ts files can be required directly.\nimport { createWorkspaceQpqCdkApp } from '@qpqjs/deploy-aws';\n\ncreateWorkspaceQpqCdkApp();\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.promptCommandFromMenu = void 0;
|
|
13
|
+
// Interactive drill-down for a bare `qpq`: the colon-separated command names
|
|
14
|
+
// form a tree (go, go:dev, go:dev:api, ...). Each menu level renders its
|
|
15
|
+
// options as the full command line they resolve to (`qpq go:dev:api`) with
|
|
16
|
+
// the command's summary alongside, groups shown as `qpq go:??`, and drilling
|
|
17
|
+
// continues until the user picks a runnable leaf. Rows are deliberately left
|
|
18
|
+
// unstyled so inquirer's active-item highlight colours the whole row.
|
|
19
|
+
const prompts_1 = require("../lib/prompts");
|
|
20
|
+
const lastSegment = (name) => name.split(':').slice(-1)[0];
|
|
21
|
+
// The first path segment of `name` below `prefix` ('' means the tree root).
|
|
22
|
+
const childSegment = (name, prefix) => name.slice(prefix ? prefix.length + 1 : 0).split(':')[0];
|
|
23
|
+
const runRow = (command) => ({
|
|
24
|
+
label: `qpq ${command.name}`,
|
|
25
|
+
summary: command.summary,
|
|
26
|
+
value: { kind: 'run', command },
|
|
27
|
+
});
|
|
28
|
+
const buildRows = (commands, prefix) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const exact = prefix ? commands.find((command) => command.name === prefix) : undefined;
|
|
31
|
+
const deeper = commands.filter((command) => command.name !== prefix && (!prefix || command.name.startsWith(`${prefix}:`)));
|
|
32
|
+
const segments = [...new Set(deeper.map((command) => childSegment(command.name, prefix)))];
|
|
33
|
+
const groupRows = [];
|
|
34
|
+
const leafRows = [];
|
|
35
|
+
for (const segment of segments) {
|
|
36
|
+
const segmentPrefix = prefix ? `${prefix}:${segment}` : segment;
|
|
37
|
+
const subtree = deeper.filter((command) => command.name === segmentPrefix || command.name.startsWith(`${segmentPrefix}:`));
|
|
38
|
+
if (subtree.length === 1 && subtree[0].name === segmentPrefix) {
|
|
39
|
+
leafRows.push(runRow(subtree[0]));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// A group's summary is its own runnable command's summary when it has
|
|
43
|
+
// one, otherwise a listing of what's inside.
|
|
44
|
+
const groupSummary = (_a = subtree.find((command) => command.name === segmentPrefix)) === null || _a === void 0 ? void 0 : _a.summary;
|
|
45
|
+
groupRows.push({
|
|
46
|
+
label: `qpq ${segmentPrefix}:??`,
|
|
47
|
+
summary: groupSummary !== null && groupSummary !== void 0 ? groupSummary : subtree.map((command) => lastSegment(command.name)).join(', '),
|
|
48
|
+
value: { kind: 'drill', prefix: segmentPrefix },
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// The current prefix's own command (run what this menu is named after)
|
|
53
|
+
// leads, then groups, then the remaining runnable commands.
|
|
54
|
+
const rows = [...(exact ? [runRow(exact)] : []), ...groupRows, ...leafRows];
|
|
55
|
+
if (prefix) {
|
|
56
|
+
rows.push({ label: '(back)', value: { kind: 'back' } });
|
|
57
|
+
}
|
|
58
|
+
return rows;
|
|
59
|
+
};
|
|
60
|
+
// Align the rows into two columns: the command line, then its summary.
|
|
61
|
+
const toChoices = (rows) => {
|
|
62
|
+
const columnWidth = Math.max(...rows.map((row) => row.label.length)) + 2;
|
|
63
|
+
return rows.map((row) => ({
|
|
64
|
+
name: row.summary ? `${row.label.padEnd(columnWidth)}${row.summary}` : row.label,
|
|
65
|
+
value: row.value,
|
|
66
|
+
short: row.label,
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
// Walk the menu until a runnable command is picked.
|
|
70
|
+
const promptCommandFromMenu = (commands) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
let prefix = '';
|
|
72
|
+
for (;;) {
|
|
73
|
+
const picked = yield (0, prompts_1.promptSelectDetailed)('Run:', toChoices(buildRows(commands, prefix)));
|
|
74
|
+
if (picked.kind === 'run') {
|
|
75
|
+
return picked.command;
|
|
76
|
+
}
|
|
77
|
+
prefix = picked.kind === 'drill' ? picked.prefix : prefix.split(':').slice(0, -1).join(':');
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
exports.promptCommandFromMenu = promptCommandFromMenu;
|
|
81
|
+
//# sourceMappingURL=commandMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandMenu.js","sourceRoot":"","sources":["../../../src/cli/commandMenu.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,sEAAsE;AACtE,4CAAsD;AAOtD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CA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AAM,CAAC,OAAO,CAAC;QACxB,CAAC;QAED,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC,CAAA,CAAC;AAZW,QAAA,qBAAqB,yBAYhC","sourcesContent":["// Interactive drill-down for a bare `qpq`: the colon-separated command names\n// form a tree (go, go:dev, go:dev:api, ...). Each menu level renders its\n// options as the full command line they resolve to (`qpq go:dev:api`) with\n// the command's summary alongside, groups shown as `qpq go:??`, and drilling\n// continues until the user picks a runnable leaf. Rows are deliberately left\n// unstyled so inquirer's active-item highlight colours the whole row.\nimport { promptSelectDetailed } from '../lib/prompts';\nimport { CliCommand } from './commandRegistry';\n\ntype MenuChoice = { kind: 'run'; command: CliCommand } | { kind: 'drill'; prefix: string } | { kind: 'back' };\n\ntype MenuRow = { label: string; summary?: string; value: MenuChoice };\n\nconst lastSegment = (name: string): string => name.split(':').slice(-1)[0];\n\n// The first path segment of `name` below `prefix` ('' means the tree root).\nconst childSegment = (name: string, prefix: string): string => name.slice(prefix ? prefix.length + 1 : 0).split(':')[0];\n\nconst runRow = (command: CliCommand): MenuRow => ({\n label: `qpq ${command.name}`,\n summary: command.summary,\n value: { kind: 'run', command },\n});\n\nconst buildRows = (commands: CliCommand[], prefix: string): MenuRow[] => {\n const exact = prefix ? commands.find((command) => command.name === prefix) : undefined;\n const deeper = commands.filter((command) => command.name !== prefix && (!prefix || command.name.startsWith(`${prefix}:`)));\n const segments = [...new Set(deeper.map((command) => childSegment(command.name, prefix)))];\n\n const groupRows: MenuRow[] = [];\n const leafRows: MenuRow[] = [];\n\n for (const segment of segments) {\n const segmentPrefix = prefix ? `${prefix}:${segment}` : segment;\n const subtree = deeper.filter((command) => command.name === segmentPrefix || command.name.startsWith(`${segmentPrefix}:`));\n\n if (subtree.length === 1 && subtree[0].name === segmentPrefix) {\n leafRows.push(runRow(subtree[0]));\n } else {\n // A group's summary is its own runnable command's summary when it has\n // one, otherwise a listing of what's inside.\n const groupSummary = subtree.find((command) => command.name === segmentPrefix)?.summary;\n groupRows.push({\n label: `qpq ${segmentPrefix}:??`,\n summary: groupSummary ?? subtree.map((command) => lastSegment(command.name)).join(', '),\n value: { kind: 'drill', prefix: segmentPrefix },\n });\n }\n }\n\n // The current prefix's own command (run what this menu is named after)\n // leads, then groups, then the remaining runnable commands.\n const rows = [...(exact ? [runRow(exact)] : []), ...groupRows, ...leafRows];\n\n if (prefix) {\n rows.push({ label: '(back)', value: { kind: 'back' } });\n }\n\n return rows;\n};\n\n// Align the rows into two columns: the command line, then its summary.\nconst toChoices = (rows: MenuRow[]): { name: string; value: MenuChoice; short?: string }[] => {\n const columnWidth = Math.max(...rows.map((row) => row.label.length)) + 2;\n\n return rows.map((row) => ({\n name: row.summary ? `${row.label.padEnd(columnWidth)}${row.summary}` : row.label,\n value: row.value,\n short: row.label,\n }));\n};\n\n// Walk the menu until a runnable command is picked.\nexport const promptCommandFromMenu = async (commands: CliCommand[]): Promise<CliCommand> => {\n let prefix = '';\n\n for (;;) {\n const picked = await promptSelectDetailed<MenuChoice>('Run:', toChoices(buildRows(commands, prefix)));\n\n if (picked.kind === 'run') {\n return picked.command;\n }\n\n prefix = picked.kind === 'drill' ? picked.prefix : prefix.split(':').slice(0, -1).join(':');\n }\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CliCommand = {
|
|
2
|
+
name: string;
|
|
3
|
+
usageArgs?: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
usageExtra?: string[];
|
|
6
|
+
promptArgs?: () => Promise<string[]>;
|
|
7
|
+
run: (commandArgv: string[]) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
export declare const cliCommands: CliCommand[];
|
|
10
|
+
export declare const buildUsage: () => string;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.buildUsage = exports.cliCommands = void 0;
|
|
13
|
+
// Single source of truth for every qpq command: its name, the one-line
|
|
14
|
+
// summary (shared by `qpq help` and the interactive menu) and a runner.
|
|
15
|
+
//
|
|
16
|
+
// Command modules are required lazily inside each runner so a simple
|
|
17
|
+
// `qpq help` doesn't pay for the whole toolchain, and so ts-node can be
|
|
18
|
+
// registered before any command module (or anything it requires) loads.
|
|
19
|
+
const prompts_1 = require("../lib/prompts");
|
|
20
|
+
// `qpq hooks` needs a hook name; when launched from the menu there is no
|
|
21
|
+
// argv to pass it in, so ask.
|
|
22
|
+
const promptHookName = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
return [
|
|
24
|
+
yield (0, prompts_1.promptText)('Hook name (runs qpq:<name>, or plain <name>, in every app/package that defines it):'),
|
|
25
|
+
];
|
|
26
|
+
});
|
|
27
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
28
|
+
exports.cliCommands = [
|
|
29
|
+
{
|
|
30
|
+
name: 'go',
|
|
31
|
+
usageArgs: '[svc] [stack]',
|
|
32
|
+
summary: 'Deploy services (interactive; platform from the deployment in deploy.config.json).',
|
|
33
|
+
usageExtra: [
|
|
34
|
+
'Pass positional args to skip prompts, e.g. qpq go all all — svc is',
|
|
35
|
+
"'all' | comma-list | account | domain | bootstrap; stack is all|inf|api|web|views.",
|
|
36
|
+
"A full 'all all' (or 'all api') deploy also publishes federated backends.",
|
|
37
|
+
],
|
|
38
|
+
run: (a) => require('../commands/go').goCommand(a),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'setup',
|
|
42
|
+
summary: 'Take a cloud environment from empty to deployed: checked steps, run in order (interactive)',
|
|
43
|
+
usageExtra: ["--check prints each step's status; --yes runs them all; --only <ids> runs a subset."],
|
|
44
|
+
run: (a) => require('../commands/setup').setupCommand(a),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'go:docker',
|
|
48
|
+
usageArgs: '[svc] [stack]',
|
|
49
|
+
summary: 'Same as go (incl. positional args), but deploys in parallel via docker',
|
|
50
|
+
usageExtra: [
|
|
51
|
+
'--build-only builds and saves everything a deploy needs (no docker needed);',
|
|
52
|
+
'--from-build deploys the chosen stack from that saved build without rebuilding',
|
|
53
|
+
'(an api deploy also publishes the federated remote). One CI job per service and phase.',
|
|
54
|
+
],
|
|
55
|
+
run: (a) => require('../commands/goDocker').goDockerCommand(a),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'go:dev',
|
|
59
|
+
summary: 'Run the full local dev stack (api + web) in one process',
|
|
60
|
+
run: (a) => require('../commands/goDev').goDevCommand(a),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'go:dev:api',
|
|
64
|
+
summary: 'Run the local API dev server (hot reload)',
|
|
65
|
+
run: (a) => require('../commands/goDevApi').goDevApiCommand(a),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'go:dev:web',
|
|
69
|
+
summary: 'Run every views microfrontend dev server',
|
|
70
|
+
run: (a) => require('../commands/goDevWeb').goDevWebCommand(a),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'migrate',
|
|
74
|
+
usageArgs: '[app]',
|
|
75
|
+
summary: 'Run pending migrations against the LOCAL dev store, once, then exit.',
|
|
76
|
+
usageExtra: [
|
|
77
|
+
'Deployed, migrations run on a stack update; nothing local ever deploys, so',
|
|
78
|
+
'this is how you exercise one before shipping it. Records what it runs, so a',
|
|
79
|
+
'second call is a no-op.',
|
|
80
|
+
],
|
|
81
|
+
run: (a) => require('../commands/migrate').migrateCommand(a),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'teardown',
|
|
85
|
+
summary: 'Destroy web/api/inf stacks for selected services (interactive)',
|
|
86
|
+
run: (a) => require('../commands/teardown').teardownCommand(a),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'clear-resources',
|
|
90
|
+
summary: 'Empty selected buckets/tables (data only, stacks untouched; interactive)',
|
|
91
|
+
run: (a) => require('../commands/clearResources').clearResourcesCommand(a),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'synth',
|
|
95
|
+
usageArgs: '[service]',
|
|
96
|
+
summary: 'Synth QPQ configs to dist/apps/<app>/infrastructure',
|
|
97
|
+
run: (a) => require('../commands/synth').synthCommand(a),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'prep',
|
|
101
|
+
summary: 'Regenerate apps/<app>/tsconfig.federated.json',
|
|
102
|
+
run: (a) => require('../commands/prep').prepCommand(a),
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'publish',
|
|
106
|
+
summary: 'Build + upload + deploy federated remotes',
|
|
107
|
+
run: (a) => require('../commands/publish').publishCommand(a),
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'publish:build',
|
|
111
|
+
summary: 'Build federated remotes locally',
|
|
112
|
+
run: (a) => require('../commands/publish').publishBuildCommand(a),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'publish:upload',
|
|
116
|
+
summary: 'Upload built version dirs (nothing goes live)',
|
|
117
|
+
run: (a) => require('../commands/publish').publishUploadCommand(a),
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'publish:deploy',
|
|
121
|
+
summary: 'Flip manifests to the uploaded versions',
|
|
122
|
+
run: (a) => require('../commands/publish').publishDeployCommand(a),
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'script:new',
|
|
126
|
+
usageArgs: '<dir>',
|
|
127
|
+
summary: 'Write a user-script template project (src/main.ts exporting functions) into a new directory',
|
|
128
|
+
run: (a) => require('../commands/scriptNew').scriptNewCommand(a),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'script:build',
|
|
132
|
+
usageArgs: '<dir> [--out <dir>] [--source-map]',
|
|
133
|
+
summary: 'Bundle a user-script project into one main.js that askUserScriptExecute loads from a drive (--source-map embeds the map in it)',
|
|
134
|
+
run: (a) => require('../commands/scriptBuild').scriptBuildCommand(a),
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: 'script:builder-layer',
|
|
138
|
+
usageArgs: '[--arch arm64|x86_64]',
|
|
139
|
+
summary: 'Install rspack for the lambda architecture (default arm64) into the user-script builder layer, for services that build user scripts',
|
|
140
|
+
run: (a) => require('../commands/scriptBuilderLayer').scriptBuilderLayerCommand(a),
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'check:circular',
|
|
144
|
+
summary: 'Scan workspace sources for circular imports (fails on cycles; --warn to only report)',
|
|
145
|
+
run: (a) => require('../commands/checkCircular').checkCircularCommand(a),
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'hooks',
|
|
149
|
+
usageArgs: '<name>',
|
|
150
|
+
summary: 'Run qpq:<name> (or plain <name>) in every app/package that defines it (dependency ordered, parallel; --jobs=N)',
|
|
151
|
+
promptArgs: promptHookName,
|
|
152
|
+
run: (a) => require('../commands/hooks').hooksCommand(a),
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
156
|
+
// Width of the "name [args]" column in the usage text.
|
|
157
|
+
const usageColumnWidth = 17;
|
|
158
|
+
const buildUsage = () => {
|
|
159
|
+
const commandLines = exports.cliCommands.flatMap((command) => {
|
|
160
|
+
var _a;
|
|
161
|
+
const nameAndArgs = command.usageArgs ? `${command.name} ${command.usageArgs}` : command.name;
|
|
162
|
+
const extraLines = ((_a = command.usageExtra) !== null && _a !== void 0 ? _a : []).map((line) => ` ${''.padEnd(usageColumnWidth)}${line}`);
|
|
163
|
+
return [` ${nameAndArgs.padEnd(usageColumnWidth)}${command.summary}`, ...extraLines];
|
|
164
|
+
});
|
|
165
|
+
return [
|
|
166
|
+
'qpq — build, dev and deploy orchestration for QPQ apps',
|
|
167
|
+
'',
|
|
168
|
+
'Usage: qpq <command> [--app <name>] [--deployment <name>]',
|
|
169
|
+
' qpq (no command opens an interactive menu)',
|
|
170
|
+
'',
|
|
171
|
+
'Commands:',
|
|
172
|
+
...commandLines,
|
|
173
|
+
'',
|
|
174
|
+
].join('\n');
|
|
175
|
+
};
|
|
176
|
+
exports.buildUsage = buildUsage;
|
|
177
|
+
//# sourceMappingURL=commandRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandRegistry.js","sourceRoot":"","sources":["../../../src/cli/commandRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAuE;AACvE,wEAAwE;AACxE,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,4CAA4C;AAe5C,yEAAyE;AACzE,8BAA8B;AAC9B,MAAM,cAAc,GAAG,GAA4B,EAAE;IAAC,OAAA;QACpD,MAAM,IAAA,oBAAU,EAAC,qFAAqF,CAAC;KACxG,CAAA;EAAA,CAAC;AAEF,0DAA0D;AAC7C,QAAA,WAAW,GAAiB;IACvC;QACE,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,eAAe;QAC1B,OAAO,EAAE,o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,CAAC,YAAY,CAAC,CAAC,CAAC;KACzD;CACF,CAAC;AACF,yDAAyD;AAEzD,uDAAuD;AACvD,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAErB,MAAM,UAAU,GAAG,GAAW,EAAE;IACrC,MAAM,YAAY,GAAG,mBAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;QACnD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9F,MAAM,UAAU,GAAG,CAAC,MAAA,OAAO,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QACvG,OAAO,CAAC,KAAK,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,wDAAwD;QACxD,EAAE;QACF,2DAA2D;QAC3D,8DAA8D;QAC9D,EAAE;QACF,WAAW;QACX,GAAG,YAAY;QACf,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC;AAjBW,QAAA,UAAU,cAiBrB","sourcesContent":["// Single source of truth for every qpq command: its name, the one-line\n// summary (shared by `qpq help` and the interactive menu) and a runner.\n//\n// Command modules are required lazily inside each runner so a simple\n// `qpq help` doesn't pay for the whole toolchain, and so ts-node can be\n// registered before any command module (or anything it requires) loads.\nimport { promptText } from '../lib/prompts';\n\nexport type CliCommand = {\n name: string;\n // Argument hint shown in the usage text, e.g. '[svc] [stack]'.\n usageArgs?: string;\n summary: string;\n // Extra usage-only detail lines, indented under the summary.\n usageExtra?: string[];\n // Menu-only: commands that need a positional argument (which the menu has\n // no argv to carry) gather it here before running.\n promptArgs?: () => Promise<string[]>;\n run: (commandArgv: string[]) => Promise<void>;\n};\n\n// `qpq hooks` needs a hook name; when launched from the menu there is no\n// argv to pass it in, so ask.\nconst promptHookName = async (): Promise<string[]> => [\n await promptText('Hook name (runs qpq:<name>, or plain <name>, in every app/package that defines it):'),\n];\n\n/* eslint-disable @typescript-eslint/no-require-imports */\nexport const cliCommands: CliCommand[] = [\n {\n name: 'go',\n usageArgs: '[svc] [stack]',\n summary: 'Deploy services (interactive; platform from the deployment in deploy.config.json).',\n usageExtra: [\n 'Pass positional args to skip prompts, e.g. qpq go all all — svc is',\n \"'all' | comma-list | account | domain | bootstrap; stack is all|inf|api|web|views.\",\n \"A full 'all all' (or 'all api') deploy also publishes federated backends.\",\n ],\n run: (a) => require('../commands/go').goCommand(a),\n },\n {\n name: 'setup',\n summary: 'Take a cloud environment from empty to deployed: checked steps, run in order (interactive)',\n usageExtra: [\"--check prints each step's status; --yes runs them all; --only <ids> runs a subset.\"],\n run: (a) => require('../commands/setup').setupCommand(a),\n },\n {\n name: 'go:docker',\n usageArgs: '[svc] [stack]',\n summary: 'Same as go (incl. positional args), but deploys in parallel via docker',\n usageExtra: [\n '--build-only builds and saves everything a deploy needs (no docker needed);',\n '--from-build deploys the chosen stack from that saved build without rebuilding',\n '(an api deploy also publishes the federated remote). One CI job per service and phase.',\n ],\n run: (a) => require('../commands/goDocker').goDockerCommand(a),\n },\n {\n name: 'go:dev',\n summary: 'Run the full local dev stack (api + web) in one process',\n run: (a) => require('../commands/goDev').goDevCommand(a),\n },\n {\n name: 'go:dev:api',\n summary: 'Run the local API dev server (hot reload)',\n run: (a) => require('../commands/goDevApi').goDevApiCommand(a),\n },\n {\n name: 'go:dev:web',\n summary: 'Run every views microfrontend dev server',\n run: (a) => require('../commands/goDevWeb').goDevWebCommand(a),\n },\n {\n name: 'migrate',\n usageArgs: '[app]',\n summary: 'Run pending migrations against the LOCAL dev store, once, then exit.',\n usageExtra: [\n 'Deployed, migrations run on a stack update; nothing local ever deploys, so',\n 'this is how you exercise one before shipping it. Records what it runs, so a',\n 'second call is a no-op.',\n ],\n run: (a) => require('../commands/migrate').migrateCommand(a),\n },\n {\n name: 'teardown',\n summary: 'Destroy web/api/inf stacks for selected services (interactive)',\n run: (a) => require('../commands/teardown').teardownCommand(a),\n },\n {\n name: 'clear-resources',\n summary: 'Empty selected buckets/tables (data only, stacks untouched; interactive)',\n run: (a) => require('../commands/clearResources').clearResourcesCommand(a),\n },\n {\n name: 'synth',\n usageArgs: '[service]',\n summary: 'Synth QPQ configs to dist/apps/<app>/infrastructure',\n run: (a) => require('../commands/synth').synthCommand(a),\n },\n {\n name: 'prep',\n summary: 'Regenerate apps/<app>/tsconfig.federated.json',\n run: (a) => require('../commands/prep').prepCommand(a),\n },\n {\n name: 'publish',\n summary: 'Build + upload + deploy federated remotes',\n run: (a) => require('../commands/publish').publishCommand(a),\n },\n {\n name: 'publish:build',\n summary: 'Build federated remotes locally',\n run: (a) => require('../commands/publish').publishBuildCommand(a),\n },\n {\n name: 'publish:upload',\n summary: 'Upload built version dirs (nothing goes live)',\n run: (a) => require('../commands/publish').publishUploadCommand(a),\n },\n {\n name: 'publish:deploy',\n summary: 'Flip manifests to the uploaded versions',\n run: (a) => require('../commands/publish').publishDeployCommand(a),\n },\n {\n name: 'script:new',\n usageArgs: '<dir>',\n summary: 'Write a user-script template project (src/main.ts exporting functions) into a new directory',\n run: (a) => require('../commands/scriptNew').scriptNewCommand(a),\n },\n {\n name: 'script:build',\n usageArgs: '<dir> [--out <dir>] [--source-map]',\n summary: 'Bundle a user-script project into one main.js that askUserScriptExecute loads from a drive (--source-map embeds the map in it)',\n run: (a) => require('../commands/scriptBuild').scriptBuildCommand(a),\n },\n {\n name: 'script:builder-layer',\n usageArgs: '[--arch arm64|x86_64]',\n summary: 'Install rspack for the lambda architecture (default arm64) into the user-script builder layer, for services that build user scripts',\n run: (a) => require('../commands/scriptBuilderLayer').scriptBuilderLayerCommand(a),\n },\n {\n name: 'check:circular',\n summary: 'Scan workspace sources for circular imports (fails on cycles; --warn to only report)',\n run: (a) => require('../commands/checkCircular').checkCircularCommand(a),\n },\n {\n name: 'hooks',\n usageArgs: '<name>',\n summary: 'Run qpq:<name> (or plain <name>) in every app/package that defines it (dependency ordered, parallel; --jobs=N)',\n promptArgs: promptHookName,\n run: (a) => require('../commands/hooks').hooksCommand(a),\n },\n];\n/* eslint-enable @typescript-eslint/no-require-imports */\n\n// Width of the \"name [args]\" column in the usage text.\nconst usageColumnWidth = 17;\n\nexport const buildUsage = (): string => {\n const commandLines = cliCommands.flatMap((command) => {\n const nameAndArgs = command.usageArgs ? `${command.name} ${command.usageArgs}` : command.name;\n const extraLines = (command.usageExtra ?? []).map((line) => ` ${''.padEnd(usageColumnWidth)}${line}`);\n return [` ${nameAndArgs.padEnd(usageColumnWidth)}${command.summary}`, ...extraLines];\n });\n\n return [\n 'qpq — build, dev and deploy orchestration for QPQ apps',\n '',\n 'Usage: qpq <command> [--app <name>] [--deployment <name>]',\n ' qpq (no command opens an interactive menu)',\n '',\n 'Commands:',\n ...commandLines,\n '',\n ].join('\\n');\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './runCli';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./runCli"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB","sourcesContent":["export * from './runCli';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runCli: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.runCli = void 0;
|
|
13
|
+
const commandMenu_1 = require("./commandMenu");
|
|
14
|
+
const commandRegistry_1 = require("./commandRegistry");
|
|
15
|
+
// Service infrastructure.ts files (and app config fragments) are TypeScript —
|
|
16
|
+
// register ts-node's transpile-only require hook so the CLI can require them
|
|
17
|
+
// directly, using the consumer root's tsconfig.json ts-node settings.
|
|
18
|
+
//
|
|
19
|
+
// CONTRACT: JavaScript apps (create-qpq-app --language javascript) also lean
|
|
20
|
+
// on this hook — their tsconfig.json ts-node block sets allowJs (so their
|
|
21
|
+
// ESM-syntax infrastructure.js compiles at require time) and scope/scopeDir
|
|
22
|
+
// (so the hook never touches quidproquo libs outside the app). Any
|
|
23
|
+
// replacement for ts-node here must honour those consumer tsconfig options.
|
|
24
|
+
const registerTsNode = () => {
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
26
|
+
require('ts-node').register({ transpileOnly: true });
|
|
27
|
+
};
|
|
28
|
+
// Inquirer throws ExitPromptError on ctrl-c; treat that as a quiet exit
|
|
29
|
+
// rather than a command failure.
|
|
30
|
+
const isPromptExit = (error) => error instanceof Error && error.name === 'ExitPromptError';
|
|
31
|
+
// Bare `qpq` on a terminal: drill through the command menu, gathering any
|
|
32
|
+
// arguments the picked command needs. Returns null when the user bails out.
|
|
33
|
+
const resolveCommandInteractively = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const command = yield (0, commandMenu_1.promptCommandFromMenu)(commandRegistry_1.cliCommands);
|
|
36
|
+
const commandArgv = command.promptArgs ? yield command.promptArgs() : [];
|
|
37
|
+
return { command, commandArgv };
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (isPromptExit(error)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const runCli = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
const [commandName, ...argvRest] = argv;
|
|
48
|
+
if (commandName === 'help' || commandName === '--help') {
|
|
49
|
+
console.log((0, commandRegistry_1.buildUsage)());
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let command;
|
|
53
|
+
let commandArgv = [];
|
|
54
|
+
if (!commandName) {
|
|
55
|
+
// Only prompt on a real terminal; piped/CI invocations get the usage text.
|
|
56
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
57
|
+
console.log((0, commandRegistry_1.buildUsage)());
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const resolved = yield resolveCommandInteractively();
|
|
61
|
+
if (!resolved) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
({ command, commandArgv } = resolved);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
command = commandRegistry_1.cliCommands.find((c) => c.name === commandName);
|
|
68
|
+
commandArgv = argvRest;
|
|
69
|
+
if (!command) {
|
|
70
|
+
console.error(`Unknown command: ${commandName}`);
|
|
71
|
+
console.log((0, commandRegistry_1.buildUsage)());
|
|
72
|
+
process.exitCode = 1;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
registerTsNode();
|
|
77
|
+
try {
|
|
78
|
+
yield command.run(commandArgv);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error(`qpq ${command.name} failed:`, error);
|
|
82
|
+
process.exitCode = 1;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
exports.runCli = runCli;
|
|
86
|
+
//# sourceMappingURL=runCli.js.map
|