@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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Single source of truth for every qpq command: its name, the one-line
|
|
2
|
+
// summary (shared by `qpq help` and the interactive menu) and a runner.
|
|
3
|
+
//
|
|
4
|
+
// Command modules are required lazily inside each runner so a simple
|
|
5
|
+
// `qpq help` doesn't pay for the whole toolchain, and so ts-node can be
|
|
6
|
+
// registered before any command module (or anything it requires) loads.
|
|
7
|
+
import { promptText } from '../lib/prompts';
|
|
8
|
+
// `qpq hooks` needs a hook name; when launched from the menu there is no
|
|
9
|
+
// argv to pass it in, so ask.
|
|
10
|
+
const promptHookName = async () => [
|
|
11
|
+
await promptText('Hook name (runs qpq:<name>, or plain <name>, in every app/package that defines it):'),
|
|
12
|
+
];
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
14
|
+
export const cliCommands = [
|
|
15
|
+
{
|
|
16
|
+
name: 'go',
|
|
17
|
+
usageArgs: '[svc] [stack]',
|
|
18
|
+
summary: 'Deploy services (interactive; platform from the deployment in deploy.config.json).',
|
|
19
|
+
usageExtra: [
|
|
20
|
+
'Pass positional args to skip prompts, e.g. qpq go all all — svc is',
|
|
21
|
+
"'all' | comma-list | account | domain | bootstrap; stack is all|inf|api|web|views.",
|
|
22
|
+
"A full 'all all' (or 'all api') deploy also publishes federated backends.",
|
|
23
|
+
],
|
|
24
|
+
run: (a) => require('../commands/go').goCommand(a),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'setup',
|
|
28
|
+
summary: 'Take a cloud environment from empty to deployed: checked steps, run in order (interactive)',
|
|
29
|
+
usageExtra: ["--check prints each step's status; --yes runs them all; --only <ids> runs a subset."],
|
|
30
|
+
run: (a) => require('../commands/setup').setupCommand(a),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'go:docker',
|
|
34
|
+
usageArgs: '[svc] [stack]',
|
|
35
|
+
summary: 'Same as go (incl. positional args), but deploys in parallel via docker',
|
|
36
|
+
usageExtra: [
|
|
37
|
+
'--build-only builds and saves everything a deploy needs (no docker needed);',
|
|
38
|
+
'--from-build deploys the chosen stack from that saved build without rebuilding',
|
|
39
|
+
'(an api deploy also publishes the federated remote). One CI job per service and phase.',
|
|
40
|
+
],
|
|
41
|
+
run: (a) => require('../commands/goDocker').goDockerCommand(a),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'go:dev',
|
|
45
|
+
summary: 'Run the full local dev stack (api + web) in one process',
|
|
46
|
+
run: (a) => require('../commands/goDev').goDevCommand(a),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'go:dev:api',
|
|
50
|
+
summary: 'Run the local API dev server (hot reload)',
|
|
51
|
+
run: (a) => require('../commands/goDevApi').goDevApiCommand(a),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'go:dev:web',
|
|
55
|
+
summary: 'Run every views microfrontend dev server',
|
|
56
|
+
run: (a) => require('../commands/goDevWeb').goDevWebCommand(a),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'migrate',
|
|
60
|
+
usageArgs: '[app]',
|
|
61
|
+
summary: 'Run pending migrations against the LOCAL dev store, once, then exit.',
|
|
62
|
+
usageExtra: [
|
|
63
|
+
'Deployed, migrations run on a stack update; nothing local ever deploys, so',
|
|
64
|
+
'this is how you exercise one before shipping it. Records what it runs, so a',
|
|
65
|
+
'second call is a no-op.',
|
|
66
|
+
],
|
|
67
|
+
run: (a) => require('../commands/migrate').migrateCommand(a),
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'teardown',
|
|
71
|
+
summary: 'Destroy web/api/inf stacks for selected services (interactive)',
|
|
72
|
+
run: (a) => require('../commands/teardown').teardownCommand(a),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'clear-resources',
|
|
76
|
+
summary: 'Empty selected buckets/tables (data only, stacks untouched; interactive)',
|
|
77
|
+
run: (a) => require('../commands/clearResources').clearResourcesCommand(a),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'synth',
|
|
81
|
+
usageArgs: '[service]',
|
|
82
|
+
summary: 'Synth QPQ configs to dist/apps/<app>/infrastructure',
|
|
83
|
+
run: (a) => require('../commands/synth').synthCommand(a),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'prep',
|
|
87
|
+
summary: 'Regenerate apps/<app>/tsconfig.federated.json',
|
|
88
|
+
run: (a) => require('../commands/prep').prepCommand(a),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'publish',
|
|
92
|
+
summary: 'Build + upload + deploy federated remotes',
|
|
93
|
+
run: (a) => require('../commands/publish').publishCommand(a),
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'publish:build',
|
|
97
|
+
summary: 'Build federated remotes locally',
|
|
98
|
+
run: (a) => require('../commands/publish').publishBuildCommand(a),
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'publish:upload',
|
|
102
|
+
summary: 'Upload built version dirs (nothing goes live)',
|
|
103
|
+
run: (a) => require('../commands/publish').publishUploadCommand(a),
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'publish:deploy',
|
|
107
|
+
summary: 'Flip manifests to the uploaded versions',
|
|
108
|
+
run: (a) => require('../commands/publish').publishDeployCommand(a),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'script:new',
|
|
112
|
+
usageArgs: '<dir>',
|
|
113
|
+
summary: 'Write a user-script template project (src/main.ts exporting functions) into a new directory',
|
|
114
|
+
run: (a) => require('../commands/scriptNew').scriptNewCommand(a),
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'script:build',
|
|
118
|
+
usageArgs: '<dir> [--out <dir>] [--source-map]',
|
|
119
|
+
summary: 'Bundle a user-script project into one main.js that askUserScriptExecute loads from a drive (--source-map embeds the map in it)',
|
|
120
|
+
run: (a) => require('../commands/scriptBuild').scriptBuildCommand(a),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'script:builder-layer',
|
|
124
|
+
usageArgs: '[--arch arm64|x86_64]',
|
|
125
|
+
summary: 'Install rspack for the lambda architecture (default arm64) into the user-script builder layer, for services that build user scripts',
|
|
126
|
+
run: (a) => require('../commands/scriptBuilderLayer').scriptBuilderLayerCommand(a),
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'check:circular',
|
|
130
|
+
summary: 'Scan workspace sources for circular imports (fails on cycles; --warn to only report)',
|
|
131
|
+
run: (a) => require('../commands/checkCircular').checkCircularCommand(a),
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'hooks',
|
|
135
|
+
usageArgs: '<name>',
|
|
136
|
+
summary: 'Run qpq:<name> (or plain <name>) in every app/package that defines it (dependency ordered, parallel; --jobs=N)',
|
|
137
|
+
promptArgs: promptHookName,
|
|
138
|
+
run: (a) => require('../commands/hooks').hooksCommand(a),
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
142
|
+
// Width of the "name [args]" column in the usage text.
|
|
143
|
+
const usageColumnWidth = 17;
|
|
144
|
+
export const buildUsage = () => {
|
|
145
|
+
const commandLines = cliCommands.flatMap((command) => {
|
|
146
|
+
const nameAndArgs = command.usageArgs ? `${command.name} ${command.usageArgs}` : command.name;
|
|
147
|
+
const extraLines = (command.usageExtra ?? []).map((line) => ` ${''.padEnd(usageColumnWidth)}${line}`);
|
|
148
|
+
return [` ${nameAndArgs.padEnd(usageColumnWidth)}${command.summary}`, ...extraLines];
|
|
149
|
+
});
|
|
150
|
+
return [
|
|
151
|
+
'qpq — build, dev and deploy orchestration for QPQ apps',
|
|
152
|
+
'',
|
|
153
|
+
'Usage: qpq <command> [--app <name>] [--deployment <name>]',
|
|
154
|
+
' qpq (no command opens an interactive menu)',
|
|
155
|
+
'',
|
|
156
|
+
'Commands:',
|
|
157
|
+
...commandLines,
|
|
158
|
+
'',
|
|
159
|
+
].join('\n');
|
|
160
|
+
};
|
|
161
|
+
//# 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,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAe5C,yEAAyE;AACzE,8BAA8B;AAC9B,MAAM,cAAc,GAAG,KAAK,IAAuB,EAAE,CAAC;IACpD,MAAM,UAAU,CAAC,qFAAqF,CAAC;CACxG,CAAC;AAEF,0DAA0D;AAC1D,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC;QACE,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,eAAe;QAC1B,OAAO,EAAE,oFAAoF;QAC7F,UAAU,EAAE;YACV,oEAAoE;YACpE,oFAAoF;YACpF,2EAA2E;SAC5E;QACD,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;KACnD;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,4FAA4F;QACrG,UAAU,EAAE,CAAC,qFAAqF,CAAC;QACnG,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;KACzD;IACD;QACE,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,e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C,UAAU,IAAI,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","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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC","sourcesContent":["export * from './runCli';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const runCli: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { promptCommandFromMenu } from './commandMenu';
|
|
2
|
+
import { buildUsage, cliCommands } from './commandRegistry';
|
|
3
|
+
// Service infrastructure.ts files (and app config fragments) are TypeScript —
|
|
4
|
+
// register ts-node's transpile-only require hook so the CLI can require them
|
|
5
|
+
// directly, using the consumer root's tsconfig.json ts-node settings.
|
|
6
|
+
//
|
|
7
|
+
// CONTRACT: JavaScript apps (create-qpq-app --language javascript) also lean
|
|
8
|
+
// on this hook — their tsconfig.json ts-node block sets allowJs (so their
|
|
9
|
+
// ESM-syntax infrastructure.js compiles at require time) and scope/scopeDir
|
|
10
|
+
// (so the hook never touches quidproquo libs outside the app). Any
|
|
11
|
+
// replacement for ts-node here must honour those consumer tsconfig options.
|
|
12
|
+
const registerTsNode = () => {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
14
|
+
require('ts-node').register({ transpileOnly: true });
|
|
15
|
+
};
|
|
16
|
+
// Inquirer throws ExitPromptError on ctrl-c; treat that as a quiet exit
|
|
17
|
+
// rather than a command failure.
|
|
18
|
+
const isPromptExit = (error) => error instanceof Error && error.name === 'ExitPromptError';
|
|
19
|
+
// Bare `qpq` on a terminal: drill through the command menu, gathering any
|
|
20
|
+
// arguments the picked command needs. Returns null when the user bails out.
|
|
21
|
+
const resolveCommandInteractively = async () => {
|
|
22
|
+
try {
|
|
23
|
+
const command = await promptCommandFromMenu(cliCommands);
|
|
24
|
+
const commandArgv = command.promptArgs ? await command.promptArgs() : [];
|
|
25
|
+
return { command, commandArgv };
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (isPromptExit(error)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const runCli = async (argv) => {
|
|
35
|
+
const [commandName, ...argvRest] = argv;
|
|
36
|
+
if (commandName === 'help' || commandName === '--help') {
|
|
37
|
+
console.log(buildUsage());
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let command;
|
|
41
|
+
let commandArgv = [];
|
|
42
|
+
if (!commandName) {
|
|
43
|
+
// Only prompt on a real terminal; piped/CI invocations get the usage text.
|
|
44
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
45
|
+
console.log(buildUsage());
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const resolved = await resolveCommandInteractively();
|
|
49
|
+
if (!resolved) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
({ command, commandArgv } = resolved);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
command = cliCommands.find((c) => c.name === commandName);
|
|
56
|
+
commandArgv = argvRest;
|
|
57
|
+
if (!command) {
|
|
58
|
+
console.error(`Unknown command: ${commandName}`);
|
|
59
|
+
console.log(buildUsage());
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
registerTsNode();
|
|
65
|
+
try {
|
|
66
|
+
await command.run(commandArgv);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error(`qpq ${command.name} failed:`, error);
|
|
70
|
+
process.exitCode = 1;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=runCli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCli.js","sourceRoot":"","sources":["../../../src/cli/runCli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAc,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExE,8EAA8E;AAC9E,6EAA6E;AAC7E,sEAAsE;AACtE,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,mEAAmE;AACnE,4EAA4E;AAC5E,MAAM,cAAc,GAAG,GAAS,EAAE;IAChC,iEAAiE;IACjE,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,wEAAwE;AACxE,iCAAiC;AACjC,MAAM,YAAY,GAAG,CAAC,KAAc,EAAW,EAAE,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAE7G,0EAA0E;AAC1E,4EAA4E;AAC5E,MAAM,2BAA2B,GAAG,KAAK,IAAoE,EAAE;IAC7G,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACzD,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,YAAY,CAAC,KAAK,CAA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T,CAAC;IACH,CAAC;IAED,cAAc,EAAE,CAAC;IAEjB,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,IAAI,UAAU,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { promptCommandFromMenu } from './commandMenu';\nimport { buildUsage, CliCommand, cliCommands } from './commandRegistry';\n\n// Service infrastructure.ts files (and app config fragments) are TypeScript —\n// register ts-node's transpile-only require hook so the CLI can require them\n// directly, using the consumer root's tsconfig.json ts-node settings.\n//\n// CONTRACT: JavaScript apps (create-qpq-app --language javascript) also lean\n// on this hook — their tsconfig.json ts-node block sets allowJs (so their\n// ESM-syntax infrastructure.js compiles at require time) and scope/scopeDir\n// (so the hook never touches quidproquo libs outside the app). Any\n// replacement for ts-node here must honour those consumer tsconfig options.\nconst registerTsNode = (): void => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('ts-node').register({ transpileOnly: true });\n};\n\n// Inquirer throws ExitPromptError on ctrl-c; treat that as a quiet exit\n// rather than a command failure.\nconst isPromptExit = (error: unknown): boolean => error instanceof Error && error.name === 'ExitPromptError';\n\n// Bare `qpq` on a terminal: drill through the command menu, gathering any\n// arguments the picked command needs. Returns null when the user bails out.\nconst resolveCommandInteractively = async (): Promise<{ command: CliCommand; commandArgv: string[] } | null> => {\n try {\n const command = await promptCommandFromMenu(cliCommands);\n const commandArgv = command.promptArgs ? await command.promptArgs() : [];\n\n return { command, commandArgv };\n } catch (error) {\n if (isPromptExit(error)) {\n return null;\n }\n\n throw error;\n }\n};\n\nexport const runCli = async (argv: string[]): Promise<void> => {\n const [commandName, ...argvRest] = argv;\n\n if (commandName === 'help' || commandName === '--help') {\n console.log(buildUsage());\n return;\n }\n\n let command: CliCommand | undefined;\n let commandArgv: string[] = [];\n\n if (!commandName) {\n // Only prompt on a real terminal; piped/CI invocations get the usage text.\n if (!process.stdin.isTTY || !process.stdout.isTTY) {\n console.log(buildUsage());\n return;\n }\n\n const resolved = await resolveCommandInteractively();\n\n if (!resolved) {\n return;\n }\n\n ({ command, commandArgv } = resolved);\n } else {\n command = cliCommands.find((c) => c.name === commandName);\n commandArgv = argvRest;\n\n if (!command) {\n console.error(`Unknown command: ${commandName}`);\n console.log(buildUsage());\n process.exitCode = 1;\n return;\n }\n }\n\n registerTsNode();\n\n try {\n await command.run(commandArgv);\n } catch (error) {\n console.error(`qpq ${command.name} failed:`, error);\n process.exitCode = 1;\n }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkCircularCommand: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// `qpq check:circular` — scan every workspace's src for circular imports (the
|
|
2
|
+
// class of bug that TDZ-crashes ESM bundles and silently drops exports under
|
|
3
|
+
// CJS). Cycles fail the command (exit 1) — they are never acceptable; --warn or
|
|
4
|
+
// QPQ_CIRCULAR_DEPS_WARN=1 is a temporary escape hatch that reports without
|
|
5
|
+
// failing while fixing.
|
|
6
|
+
import { findWorkspaceImportCycles } from '../lib/circularImports';
|
|
7
|
+
import { getRoot } from '../lib/discovery';
|
|
8
|
+
// madge reports every distinct loop path; one tangled module can produce dozens
|
|
9
|
+
// of chains through the same files. Merge chains that share any file into one
|
|
10
|
+
// group so the report shows each tangle once, with its full blast radius.
|
|
11
|
+
const groupCycles = (cycles) => {
|
|
12
|
+
const parent = new Map();
|
|
13
|
+
const find = (file) => {
|
|
14
|
+
const found = parent.get(file) ?? file;
|
|
15
|
+
if (found === file) {
|
|
16
|
+
return file;
|
|
17
|
+
}
|
|
18
|
+
const rootFile = find(found);
|
|
19
|
+
parent.set(file, rootFile);
|
|
20
|
+
return rootFile;
|
|
21
|
+
};
|
|
22
|
+
for (const cycle of cycles) {
|
|
23
|
+
for (const file of cycle) {
|
|
24
|
+
parent.set(find(file), find(cycle[0]));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const groups = new Map();
|
|
28
|
+
for (const cycle of cycles) {
|
|
29
|
+
const key = find(cycle[0]);
|
|
30
|
+
const group = groups.get(key) ?? { files: [], chainCount: 0 };
|
|
31
|
+
group.chainCount += 1;
|
|
32
|
+
group.files = [...new Set([...group.files, ...cycle])];
|
|
33
|
+
groups.set(key, group);
|
|
34
|
+
}
|
|
35
|
+
return [...groups.values()];
|
|
36
|
+
};
|
|
37
|
+
export const checkCircularCommand = async (argv) => {
|
|
38
|
+
const warnOnly = argv.includes('--warn') || !!process.env.QPQ_CIRCULAR_DEPS_WARN;
|
|
39
|
+
const cycles = await findWorkspaceImportCycles(getRoot());
|
|
40
|
+
if (cycles.length === 0) {
|
|
41
|
+
console.log('check:circular: no circular imports found');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const groups = groupCycles(cycles);
|
|
45
|
+
const colour = warnOnly ? '\x1b[33m' : '\x1b[31m';
|
|
46
|
+
for (const group of groups) {
|
|
47
|
+
const chainNote = group.chainCount > 1 ? `, ${group.chainCount} distinct loops` : '';
|
|
48
|
+
console.warn(`${colour}Circular imports (${group.files.length} files${chainNote}):\n ${group.files.join('\n ')}\x1b[0m`);
|
|
49
|
+
}
|
|
50
|
+
console.warn(`${colour}check:circular: ${groups.length} circular import group(s) found (${cycles.length} loops)\x1b[0m`);
|
|
51
|
+
if (!warnOnly) {
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=checkCircular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkCircular.js","sourceRoot":"","sources":["../../../src/commands/checkCircular.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAC5E,wBAAwB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BAAgB,CAAC,CAAC;IAEzH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC","sourcesContent":["// `qpq check:circular` — scan every workspace's src for circular imports (the\n// class of bug that TDZ-crashes ESM bundles and silently drops exports under\n// CJS). Cycles fail the command (exit 1) — they are never acceptable; --warn or\n// QPQ_CIRCULAR_DEPS_WARN=1 is a temporary escape hatch that reports without\n// failing while fixing.\nimport { findWorkspaceImportCycles, ImportCycle } from '../lib/circularImports';\nimport { getRoot } from '../lib/discovery';\n\ntype CycleGroup = { files: string[]; chainCount: number };\n\n// madge reports every distinct loop path; one tangled module can produce dozens\n// of chains through the same files. Merge chains that share any file into one\n// group so the report shows each tangle once, with its full blast radius.\nconst groupCycles = (cycles: ImportCycle[]): CycleGroup[] => {\n const parent = new Map<string, string>();\n\n const find = (file: string): string => {\n const found = parent.get(file) ?? file;\n if (found === file) {\n return file;\n }\n const rootFile = find(found);\n parent.set(file, rootFile);\n return rootFile;\n };\n\n for (const cycle of cycles) {\n for (const file of cycle) {\n parent.set(find(file), find(cycle[0]));\n }\n }\n\n const groups = new Map<string, CycleGroup>();\n for (const cycle of cycles) {\n const key = find(cycle[0]);\n const group = groups.get(key) ?? { files: [], chainCount: 0 };\n group.chainCount += 1;\n group.files = [...new Set([...group.files, ...cycle])];\n groups.set(key, group);\n }\n\n return [...groups.values()];\n};\n\nexport const checkCircularCommand = async (argv: string[]): Promise<void> => {\n const warnOnly = argv.includes('--warn') || !!process.env.QPQ_CIRCULAR_DEPS_WARN;\n\n const cycles = await findWorkspaceImportCycles(getRoot());\n\n if (cycles.length === 0) {\n console.log('check:circular: no circular imports found');\n return;\n }\n\n const groups = groupCycles(cycles);\n\n const colour = warnOnly ? '\\x1b[33m' : '\\x1b[31m';\n for (const group of groups) {\n const chainNote = group.chainCount > 1 ? `, ${group.chainCount} distinct loops` : '';\n console.warn(`${colour}Circular imports (${group.files.length} files${chainNote}):\\n ${group.files.join('\\n ')}\\x1b[0m`);\n }\n console.warn(`${colour}check:circular: ${groups.length} circular import group(s) found (${cycles.length} loops)\\x1b[0m`);\n\n if (!warnOnly) {\n process.exitCode = 1;\n }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clearResourcesCommand: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// `qpq clear-resources` — interactively EMPTY selected data resources (storage
|
|
2
|
+
// drive buckets, key value store tables) without touching the stacks: the
|
|
3
|
+
// "reset my data" counterpart to `qpq teardown`. Resolves the app +
|
|
4
|
+
// deployment the same way as go/teardown, enumerates the app's owned
|
|
5
|
+
// resources from its live qpq configs, multi-selects what to empty (with a
|
|
6
|
+
// typed confirmation — this deletes stored data), then hands off to the
|
|
7
|
+
// platform driver.
|
|
8
|
+
import { promptClearResourcesPlan } from '../lib/clearResourcesPlan';
|
|
9
|
+
import { resolveAppSelection } from '../lib/resolveAppSelection';
|
|
10
|
+
import { resolveDeployment } from '../lib/resolveDeployment';
|
|
11
|
+
import { getPlatformDriver } from '../platforms';
|
|
12
|
+
export const clearResourcesCommand = async (argv) => {
|
|
13
|
+
const appName = await resolveAppSelection({ argv, envVar: 'DEPLOY_APP_NAME' });
|
|
14
|
+
const { deployment } = await resolveDeployment(argv, appName);
|
|
15
|
+
const driver = getPlatformDriver(deployment.platform);
|
|
16
|
+
if (!driver.clearResources) {
|
|
17
|
+
console.error(`The '${deployment.platform}' platform has no clear-resources strategy.`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
const plan = await promptClearResourcesPlan(appName);
|
|
21
|
+
await driver.clearResources(appName, plan);
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=clearResources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearResources.js","sourceRoot":"","sources":["../../../src/commands/clearResources.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,0EAA0E;AAC1E,oEAAoE;AACpE,qEAAqE;AACrE,2EAA2E;AAC3E,wEAAwE;AACxE,mBAAmB;AACnB,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EAAE,IAAc,EAAiB,EAAE;IAC3E,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC/E,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEtD,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,QAAQ,UAAU,CAAC,QAAQ,6CAA6C,CAAC,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAErD,MAAM,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["// `qpq clear-resources` — interactively EMPTY selected data resources (storage\n// drive buckets, key value store tables) without touching the stacks: the\n// \"reset my data\" counterpart to `qpq teardown`. Resolves the app +\n// deployment the same way as go/teardown, enumerates the app's owned\n// resources from its live qpq configs, multi-selects what to empty (with a\n// typed confirmation — this deletes stored data), then hands off to the\n// platform driver.\nimport { promptClearResourcesPlan } from '../lib/clearResourcesPlan';\nimport { resolveAppSelection } from '../lib/resolveAppSelection';\nimport { resolveDeployment } from '../lib/resolveDeployment';\nimport { getPlatformDriver } from '../platforms';\n\nexport const clearResourcesCommand = async (argv: string[]): Promise<void> => {\n const appName = await resolveAppSelection({ argv, envVar: 'DEPLOY_APP_NAME' });\n const { deployment } = await resolveDeployment(argv, appName);\n const driver = getPlatformDriver(deployment.platform);\n\n if (!driver.clearResources) {\n console.error(`The '${deployment.platform}' platform has no clear-resources strategy.`);\n process.exit(1);\n }\n\n const plan = await promptClearResourcesPlan(appName);\n\n await driver.clearResources(appName, plan);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const goCommand: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// `qpq go` — interactive deploy. Resolves the app + deployment (whose entry in
|
|
2
|
+
// apps/<app>/deploy.config.json names the platform), asks the deploy plan, then
|
|
3
|
+
// hands off to the platform driver.
|
|
4
|
+
import { buildDeployPlanFromArgs, promptDeployPlan } from '../lib/deployPrompts';
|
|
5
|
+
import { resolveAppSelection } from '../lib/resolveAppSelection';
|
|
6
|
+
import { resolveDeployment } from '../lib/resolveDeployment';
|
|
7
|
+
import { getPlatformDriver } from '../platforms';
|
|
8
|
+
export const goCommand = async (argv) => {
|
|
9
|
+
const appName = await resolveAppSelection({ argv, envVar: 'DEPLOY_APP_NAME' });
|
|
10
|
+
const { deployment } = await resolveDeployment(argv, appName);
|
|
11
|
+
const driver = getPlatformDriver(deployment.platform);
|
|
12
|
+
// Positional args (`qpq go all all`) run prompt-free; otherwise ask.
|
|
13
|
+
const plan = buildDeployPlanFromArgs(appName, argv) ?? (await promptDeployPlan(appName));
|
|
14
|
+
await driver.go(appName, plan);
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=go.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../src/commands/go.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,oCAAoC;AACpC,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,IAAc,EAAiB,EAAE;IAC/D,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC/E,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEtD,qEAAqE;IACrE,MAAM,IAAI,GAAG,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzF,MAAM,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC,CAAC","sourcesContent":["// `qpq go` — interactive deploy. Resolves the app + deployment (whose entry in\n// apps/<app>/deploy.config.json names the platform), asks the deploy plan, then\n// hands off to the platform driver.\nimport { buildDeployPlanFromArgs, promptDeployPlan } from '../lib/deployPrompts';\nimport { resolveAppSelection } from '../lib/resolveAppSelection';\nimport { resolveDeployment } from '../lib/resolveDeployment';\nimport { getPlatformDriver } from '../platforms';\n\nexport const goCommand = async (argv: string[]): Promise<void> => {\n const appName = await resolveAppSelection({ argv, envVar: 'DEPLOY_APP_NAME' });\n const { deployment } = await resolveDeployment(argv, appName);\n const driver = getPlatformDriver(deployment.platform);\n\n // Positional args (`qpq go all all`) run prompt-free; otherwise ask.\n const plan = buildDeployPlanFromArgs(appName, argv) ?? (await promptDeployPlan(appName));\n\n await driver.go(appName, plan);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const goDevCommand: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// `qpq go:dev` — the whole local dev stack in one process: the API dev server
|
|
2
|
+
// (go:dev:api) plus every views dev server (go:dev:web), so a single ctrl+c
|
|
3
|
+
// tears it all down. A background tsc watcher keeps workspace declaration
|
|
4
|
+
// output fresh for the editor (--no-types to skip it). The app is resolved
|
|
5
|
+
// once here and handed to both sub-commands via QPQ_DEV_APP, the deployment
|
|
6
|
+
// likewise via DEPLOY_NAME, so neither asks again; their output shares the terminal.
|
|
7
|
+
import { getAllViews } from '@qpqjs/deploy-rspack';
|
|
8
|
+
import { getRoot } from '../lib/discovery';
|
|
9
|
+
import { resolveAppSelection } from '../lib/resolveAppSelection';
|
|
10
|
+
import { resolveDeployment } from '../lib/resolveDeployment';
|
|
11
|
+
import { startTypeWatcher } from '../lib/typeWatcher';
|
|
12
|
+
import { goDevApiCommand } from './goDevApi';
|
|
13
|
+
import { goDevWebCommand } from './goDevWeb';
|
|
14
|
+
export const goDevCommand = async (argv) => {
|
|
15
|
+
const appName = await resolveAppSelection({ argv, envVar: 'QPQ_DEV_APP' });
|
|
16
|
+
process.env.QPQ_DEV_APP = appName;
|
|
17
|
+
await resolveDeployment(argv, appName);
|
|
18
|
+
// Editor/type freshness only: the rspack builds below bundle workspace
|
|
19
|
+
// source directly, so the dev loop itself never waits on tsc.
|
|
20
|
+
const typeWatcher = argv.includes('--no-types') ? null : startTypeWatcher(getRoot());
|
|
21
|
+
if (typeWatcher) {
|
|
22
|
+
process.on('exit', () => typeWatcher.kill());
|
|
23
|
+
}
|
|
24
|
+
// Kicks off the rspack watch and returns; the API server keeps running in
|
|
25
|
+
// the background of this process.
|
|
26
|
+
await goDevApiCommand(argv);
|
|
27
|
+
if (getAllViews(getRoot(), appName).length === 0) {
|
|
28
|
+
console.log('No views projects found. Running the API dev server only.');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
await goDevWebCommand(argv, { hideStartedStatus: true });
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=goDev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goDev.js","sourceRoot":"","sources":["../../../src/commands/goDev.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,qFAAqF;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,IAAc,EAAiB,EAAE;IAClE,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC;IAClC,MAAM,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEvC,uEAAuE;IACvE,8DAA8D;IAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,0EAA0E;IAC1E,kCAAkC;IAClC,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAE5B,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;QACzE,OAAO;IACT,CAAC;IAED,MAAM,eAAe,CAAC,IAAI,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["// `qpq go:dev` — the whole local dev stack in one process: the API dev server\n// (go:dev:api) plus every views dev server (go:dev:web), so a single ctrl+c\n// tears it all down. A background tsc watcher keeps workspace declaration\n// output fresh for the editor (--no-types to skip it). The app is resolved\n// once here and handed to both sub-commands via QPQ_DEV_APP, the deployment\n// likewise via DEPLOY_NAME, so neither asks again; their output shares the terminal.\nimport { getAllViews } from '@qpqjs/deploy-rspack';\n\nimport { getRoot } from '../lib/discovery';\nimport { resolveAppSelection } from '../lib/resolveAppSelection';\nimport { resolveDeployment } from '../lib/resolveDeployment';\nimport { startTypeWatcher } from '../lib/typeWatcher';\nimport { goDevApiCommand } from './goDevApi';\nimport { goDevWebCommand } from './goDevWeb';\n\nexport const goDevCommand = async (argv: string[]): Promise<void> => {\n const appName = await resolveAppSelection({ argv, envVar: 'QPQ_DEV_APP' });\n process.env.QPQ_DEV_APP = appName;\n await resolveDeployment(argv, appName);\n\n // Editor/type freshness only: the rspack builds below bundle workspace\n // source directly, so the dev loop itself never waits on tsc.\n const typeWatcher = argv.includes('--no-types') ? null : startTypeWatcher(getRoot());\n if (typeWatcher) {\n process.on('exit', () => typeWatcher.kill());\n }\n\n // Kicks off the rspack watch and returns; the API server keeps running in\n // the background of this process.\n await goDevApiCommand(argv);\n\n if (getAllViews(getRoot(), appName).length === 0) {\n console.log('No views projects found. Running the API dev server only.');\n return;\n }\n\n await goDevWebCommand(argv, { hideStartedStatus: true });\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const goDevApiCommand: (argv: string[]) => Promise<void>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// `qpq go:dev:api` — boots the QPQ local dev server. Resolves the app,
|
|
2
|
+
// generates the dev-server entry, builds the rspack config, then runs rspack
|
|
3
|
+
// in watch mode, restarting the server process on every successful rebuild.
|
|
4
|
+
//
|
|
5
|
+
// A restart is not instant: the server drains in-flight work and checkpoints
|
|
6
|
+
// its stores on the way out (typically tens of ms, 5s worst case), and this
|
|
7
|
+
// command waits for that before starting the replacement.
|
|
8
|
+
//
|
|
9
|
+
// The one thing NOT hot-reloaded is the qpq configs themselves: each service's
|
|
10
|
+
// infrastructure.ts is evaluated once at launch and baked into the
|
|
11
|
+
// `quidproquo-dynamic-loader` virtual module — config changes need a full
|
|
12
|
+
// `go:dev:api` restart.
|
|
13
|
+
import { getAppServiceQpqConfigs, getDevServerRspackConfig } from '@qpqjs/deploy-rspack';
|
|
14
|
+
import { spawn } from 'child_process';
|
|
15
|
+
import path from 'path';
|
|
16
|
+
import { rspack } from '@rspack/core';
|
|
17
|
+
import { hasArgFlag } from '../lib/args';
|
|
18
|
+
import { writeDevServerEntry, writeUserScriptChildEntry } from '../lib/devServerEntry';
|
|
19
|
+
import { readDevServerPorts } from '../lib/devServerPorts';
|
|
20
|
+
import { getRoot } from '../lib/discovery';
|
|
21
|
+
import { KEEP_OTHER_DEV_SERVERS_FLAG } from '../lib/keepOtherDevServersFlag';
|
|
22
|
+
import { killChildWithEscalation } from '../lib/killChildWithEscalation';
|
|
23
|
+
import { killOtherQpqDevProcesses, killStaleListeners, reportPortHolders } from '../lib/killStaleListeners';
|
|
24
|
+
import { resolveAppSelection } from '../lib/resolveAppSelection';
|
|
25
|
+
import { resolveDeployment } from '../lib/resolveDeployment';
|
|
26
|
+
// 8080/8888 are set in the generated entry; 3001 is the @qpqjs/dev-server
|
|
27
|
+
// file-storage (secure URL) default port.
|
|
28
|
+
const getDevServerPortList = (appName) => Object.values(readDevServerPorts(appName));
|
|
29
|
+
const DEV_SERVER_BUNDLE_PATH = path.join('dist', 'qpq', 'dev-server', 'main.js');
|
|
30
|
+
export const goDevApiCommand = async (argv) => {
|
|
31
|
+
const root = getRoot();
|
|
32
|
+
const appName = await resolveAppSelection({ argv, envVar: 'QPQ_DEV_APP' });
|
|
33
|
+
process.env.QPQ_DEV_APP = appName;
|
|
34
|
+
await resolveDeployment(argv, appName);
|
|
35
|
+
console.log(`Dev server for app [${appName}]`);
|
|
36
|
+
// The sweep matches on a RELATIVE bundle path, so every checkout's dev
|
|
37
|
+
// server looks like ours and a sibling worktree gets taken down with it.
|
|
38
|
+
// Opting out spares it, at the cost of this one not starting: the ports are
|
|
39
|
+
// the same either way, so what you get instead is EADDRINUSE. Report who
|
|
40
|
+
// holds them, or that failure says nothing about the cause.
|
|
41
|
+
if (hasArgFlag(argv, KEEP_OTHER_DEV_SERVERS_FLAG)) {
|
|
42
|
+
console.log(`${KEEP_OTHER_DEV_SERVERS_FLAG}: leaving other dev servers alone.`);
|
|
43
|
+
reportPortHolders(getDevServerPortList(appName));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// Catches a lingering watcher from a previous run even if its spawned
|
|
47
|
+
// child already exited (see killOtherQpqDevProcesses) — then the usual
|
|
48
|
+
// port-based sweep for anything else still bound to our ports.
|
|
49
|
+
killOtherQpqDevProcesses(root);
|
|
50
|
+
killStaleListeners(getDevServerPortList(appName), (command) => command.includes(DEV_SERVER_BUNDLE_PATH));
|
|
51
|
+
}
|
|
52
|
+
const qpqConfigs = getAppServiceQpqConfigs(root, appName);
|
|
53
|
+
const entry = writeDevServerEntry(root, appName);
|
|
54
|
+
const userScriptChildEntry = writeUserScriptChildEntry(root);
|
|
55
|
+
const rspackConfig = getDevServerRspackConfig({ root, entry, userScriptChildEntry, qpqConfigs });
|
|
56
|
+
const bundlePath = path.join(root, DEV_SERVER_BUNDLE_PATH);
|
|
57
|
+
const env = { ...process.env, QPQ_DEV_APP: appName };
|
|
58
|
+
// The long-lived server process (HTTP 8080 / WS 8888), restarted per rebuild.
|
|
59
|
+
let child = null;
|
|
60
|
+
let restartQueued = false;
|
|
61
|
+
const startServer = () => {
|
|
62
|
+
child = spawn('node', [bundlePath], { stdio: 'inherit', env });
|
|
63
|
+
child.on('exit', (code) => {
|
|
64
|
+
child = null;
|
|
65
|
+
if (!restartQueued) {
|
|
66
|
+
// Crashed (or exited) on its own — leave it down; the next successful
|
|
67
|
+
// rebuild (i.e. the next file save) brings it back up.
|
|
68
|
+
console.log(`Dev server exited with code ${code}. Save a file to restart it.`);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const restartServer = () => {
|
|
73
|
+
if (restartQueued)
|
|
74
|
+
return;
|
|
75
|
+
if (!child) {
|
|
76
|
+
startServer();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
restartQueued = true;
|
|
80
|
+
child.once('exit', () => {
|
|
81
|
+
restartQueued = false;
|
|
82
|
+
startServer();
|
|
83
|
+
});
|
|
84
|
+
// Not a bare kill: the server drains in-flight work before it exits, so it
|
|
85
|
+
// needs asking properly and then a hard backstop if it wedges. Waiting for
|
|
86
|
+
// the exit is what keeps the ports free for the replacement.
|
|
87
|
+
void killChildWithEscalation(child);
|
|
88
|
+
};
|
|
89
|
+
console.log('Bundling dev server (watch mode)...');
|
|
90
|
+
let lastHash;
|
|
91
|
+
const compiler = rspack(rspackConfig);
|
|
92
|
+
compiler.watch({ aggregateTimeout: 200 }, (err, stats) => {
|
|
93
|
+
if (err) {
|
|
94
|
+
console.error(err);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (stats?.hasErrors()) {
|
|
98
|
+
console.error(stats.toString({ colors: true, chunks: false, modules: false }));
|
|
99
|
+
console.log('Build failed — dev server not restarted. Fix the error and save again.');
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Skip no-op rebuilds (e.g. the virtual-module-triggered second compile at
|
|
103
|
+
// startup): only restart when the output actually changed.
|
|
104
|
+
if (stats?.hash === lastHash && child) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
lastHash = stats?.hash;
|
|
108
|
+
console.log(child ? 'Rebuilt. Restarting dev server...' : 'Dev server bundled. Starting...');
|
|
109
|
+
restartServer();
|
|
110
|
+
});
|
|
111
|
+
// Wait for the server to finish draining before tearing the watcher down and
|
|
112
|
+
// exiting: closing the compiler first would exit the parent while the child
|
|
113
|
+
// is still writing, which is the race this whole path exists to close.
|
|
114
|
+
//
|
|
115
|
+
// SIGTERM as well as SIGINT, and it is load-bearing rather than symmetry for
|
|
116
|
+
// its own sake. This process is a WRAPPER: the dev server that handles
|
|
117
|
+
// signals and drains its work is the child it spawned. Without a handler
|
|
118
|
+
// here, SIGTERM (what `docker stop` sends, and what any script stopping this
|
|
119
|
+
// programmatically sends) kills the wrapper outright on the default
|
|
120
|
+
// disposition, the child never gets asked to stop, and every guarantee the
|
|
121
|
+
// dev server's shutdown sequence makes is bypassed. go:dev:web already
|
|
122
|
+
// handles both.
|
|
123
|
+
let shuttingDown = false;
|
|
124
|
+
const handleShutdownSignal = async () => {
|
|
125
|
+
if (shuttingDown) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
shuttingDown = true;
|
|
129
|
+
restartQueued = true; // suppress the crash log / rebuild-restart on our own kill
|
|
130
|
+
if (child) {
|
|
131
|
+
await killChildWithEscalation(child);
|
|
132
|
+
}
|
|
133
|
+
compiler.close(() => process.exit(0));
|
|
134
|
+
};
|
|
135
|
+
process.on('SIGINT', () => {
|
|
136
|
+
void handleShutdownSignal();
|
|
137
|
+
});
|
|
138
|
+
process.on('SIGTERM', () => {
|
|
139
|
+
void handleShutdownSignal();
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
//# sourceMappingURL=goDevApi.js.map
|