@akanjs/devkit 3.2.0-rc.8 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -528
- package/DEV_RUNTIME_KNOBS.md +4 -3
- package/README.ko.md +3 -2
- package/README.md +4 -2
- package/akanApp/BackendImportGraph.test.ts +1 -1
- package/akanApp/akanApp.host.test.ts +132 -3
- package/akanApp/akanApp.host.ts +146 -1216
- package/akanApp/akanApp.host.wiring.test.ts +727 -0
- package/akanApp/builderGap.ts +68 -0
- package/akanApp/builderRequestRelay.test.ts +93 -0
- package/akanApp/builderRequestRelay.ts +100 -0
- package/akanApp/builderRssRecycler.ts +182 -0
- package/akanApp/devBackend.ts +392 -0
- package/akanApp/devBuildStatusBoard.ts +128 -0
- package/akanApp/devBuilder.ts +196 -0
- package/akanApp/devIdleSuspend.test.ts +221 -0
- package/akanApp/devIdleSuspend.ts +192 -0
- package/akanApp/devIdleSuspend.watcher.test.ts +120 -0
- package/akanApp/devRecycler.test.ts +66 -0
- package/akanApp/devRecycler.ts +305 -0
- package/akanApp/processRss.ts +61 -0
- package/akanConfig/akanConfig.test.ts +45 -17
- package/akanConfig/akanConfig.ts +10 -10
- package/akanConfig/akanWorkspaceConfig.ts +1 -1
- package/akanConfig/productionLockfile.ts +1 -1
- package/apiReport/apiReport.test.ts +34 -3
- package/apiReport/apiReportDiff.ts +35 -1
- package/apiReport/apiReportPolicy.ts +3 -2
- package/{applicationBuildReporter.ts → app/applicationBuildReporter.ts} +2 -49
- package/{applicationBuildRunner.test.ts → app/applicationBuildRunner.test.ts} +71 -8
- package/{applicationBuildRunner.ts → app/applicationBuildRunner.ts} +60 -21
- package/{applicationTestPreload.ts → app/applicationTestPreload.ts} +1 -1
- package/{routeJsBudget.test.ts → app/routeJsBudget.test.ts} +17 -1
- package/{routeJsBudget.ts → app/routeJsBudget.ts} +9 -3
- package/{routeSourceValidator.test.ts → app/routeSourceValidator.test.ts} +17 -0
- package/{routeSourceValidator.ts → app/routeSourceValidator.ts} +5 -1
- package/artifact/implicitRootLayout.test.ts +71 -3
- package/artifact/implicitRootLayout.ts +9 -3
- package/artifact/implicitRootLayoutRender.test.tsx +297 -0
- package/biome.base.json +2 -1
- package/cloud/cloudApi.test.ts +1 -1
- package/cloud/configLock.test.ts +1 -1
- package/cloud/globalConfig.test.ts +1 -1
- package/cloud/globalConfig.ts +1 -1
- package/cloud/updatePackUpload.test.ts +1 -1
- package/codeAgent/agent/AkanCodeEnv.ts +1 -1
- package/codeAgent/agent/AkanCodeServices.ts +23 -0
- package/codeAgent/agent/akanCodePaths.ts +1 -1
- package/codeAgent/agent/akanCodeServices.test.ts +54 -0
- package/codeAgent/agent/akanSystemPrompt.ts +1 -1
- package/codeAgent/agent/codeAgent.test.ts +1 -1
- package/codeAgent/skills/akan-debug/SKILL.md +8 -5
- package/codeAgent/skills/akan-err/SKILL.md +7 -0
- package/codeAgent/skills/akan-mcp/SKILL.md +19 -1
- package/codeAgent/skills/akan-scaffold/SKILL.md +1 -1
- package/codeAgent/skills/akan-validate/SKILL.md +3 -3
- package/codeAgent/tools/AkanCli.ts +1 -1
- package/codeAgent/tools/AkanToolPack.ts +2 -2
- package/codeAgent/tools/akanCodePlugins.test.ts +1 -1
- package/commandDecorators/command.ts +35 -6
- package/commandDecorators/commandBuilder.ts +1 -1
- package/commandDecorators/commandDecorators.test.ts +107 -6
- package/commandDecorators/targetMeta.ts +2 -0
- package/commandDecorators/workspaceVersionCheck.test.ts +70 -1
- package/commandDecorators/workspaceVersionCheck.ts +64 -14
- package/context/akanContext.ts +576 -0
- package/context/akanContextInspection.ts +296 -0
- package/{akanMcpContract.test.ts → context/akanMcpContract.test.ts} +1 -1
- package/{akanMcpContract.ts → context/akanMcpContract.ts} +16 -256
- package/context/doctor/agentGuideCheck.ts +81 -0
- package/context/doctor/configLeftoverCheck.ts +35 -0
- package/context/doctor/doctorFindings.ts +70 -0
- package/context/doctor/generatedFreshness.ts +56 -0
- package/context/doctor/moduleShapeCheck.ts +88 -0
- package/context/doctor/recipeDuplicateCheck.ts +42 -0
- package/context/doctor/recipeIndexCheck.ts +87 -0
- package/context/doctor/rootShapeCheck.ts +55 -0
- package/context/doctor/workflowScope.ts +97 -0
- package/{recipeScanner.test.ts → context/recipeScanner.test.ts} +1 -1
- package/context/safeRead.ts +9 -0
- package/csrE2e/csrE2eHarness.fixture.ts +1 -1
- package/devkitUtils.test.ts +39 -5
- package/{apiReference.test.ts → docs/apiReference.test.ts} +4 -4
- package/{apiReference.ts → docs/apiReference.ts} +2 -2
- package/docs/errorCodeReference.test.ts +282 -0
- package/docs/errorCodeReference.ts +71 -0
- package/docs/errorCodeScan.ts +551 -0
- package/{frameworkGraph.test.ts → docs/frameworkGraph.test.ts} +1 -1
- package/executors/appExecutor.ts +448 -0
- package/executors/commandExecutionError.ts +53 -0
- package/executors/executor.ts +527 -0
- package/{executors.linkFallback.test.ts → executors/executors.linkFallback.test.ts} +1 -1
- package/{executors.test.ts → executors/executors.test.ts} +76 -15
- package/executors/index.ts +8 -0
- package/executors/libExecutor.ts +23 -0
- package/executors/moduleExecutor.ts +18 -0
- package/executors/pkgExecutor.ts +129 -0
- package/executors/sysExecutor.ts +301 -0
- package/executors/workspaceExecutor.ts +277 -0
- package/frontendBuild/allRoutesBuilder.test.ts +1 -1
- package/frontendBuild/autoImportSync.test.ts +1 -1
- package/frontendBuild/autoImportSync.ts +1 -1
- package/frontendBuild/buildRouteClient.test.ts +1 -1
- package/frontendBuild/clientEntriesBundler.test.ts +1 -1
- package/frontendBuild/csrArtifactBuilder.test.ts +1 -1
- package/frontendBuild/csrDevArtifactWriter.ts +1 -1
- package/frontendBuild/cssCompiler.test.ts +3 -2
- package/frontendBuild/devGeneratedIndexSync.test.ts +1 -1
- package/frontendBuild/devGeneratedIndexSync.ts +7 -38
- package/frontendBuild/dictionaryAssetBuilder.test.ts +1 -1
- package/frontendBuild/fontOptimizer.test.ts +1 -1
- package/frontendBuild/fontPruner.test.ts +1 -1
- package/frontendBuild/frontendBuild.test.ts +3 -3
- package/frontendBuild/hmrWatcher.stop.test.ts +63 -0
- package/frontendBuild/hmrWatcher.test.ts +1 -1
- package/frontendBuild/hmrWatcher.ts +22 -1
- package/frontendBuild/mcpAppViewBuilder.test.ts +1 -1
- package/frontendBuild/mcpAppViewBuilder.ts +1 -1
- package/frontendBuild/nativeCore.test.ts +1 -1
- package/frontendBuild/optionalPeers.test.ts +36 -8
- package/frontendBuild/pagesBundleBuilder.test.ts +2 -3
- package/frontendBuild/pagesBundleBuilder.ts +1 -1
- package/frontendBuild/precompressArtifacts.test.ts +1 -1
- package/frontendBuild/precompressArtifacts.ts +19 -6
- package/frontendBuild/serverGraphFile.ts +1 -1
- package/frontendBuild/sourceMtimeIndex.test.ts +1 -1
- package/frontendBuild/ssrDevBundler.test.ts +1 -1
- package/frontendBuild/vendorImportScanner.test.ts +1 -1
- package/frontendBuild/vendorNarrowing.test.ts +1 -1
- package/frontendBuild/watchRootResolver.test.ts +1 -1
- package/{agentAssets.test.ts → guideline/agentAssets.test.ts} +1 -1
- package/{agentAssets.ts → guideline/agentAssets.ts} +2 -2
- package/{agentsIndex.test.ts → guideline/agentsIndex.test.ts} +2 -2
- package/{agentsIndex.ts → guideline/agentsIndex.ts} +13 -10
- package/{conventionSet.test.ts → guideline/conventionSet.test.ts} +7 -4
- package/{conventionSet.ts → guideline/conventionSet.ts} +1 -1
- package/{prompter.ts → guideline/prompter.ts} +2 -3
- package/incrementalBuilder/buildBatch.proc.ts +14 -4
- package/incrementalBuilder/buildBatchProtocol.ts +2 -0
- package/incrementalBuilder/buildBatchRunner.test.ts +122 -2
- package/incrementalBuilder/buildBatchRunner.ts +17 -4
- package/incrementalBuilder/builderBoot.ts +106 -0
- package/incrementalBuilder/builderBuildStatus.ts +23 -0
- package/incrementalBuilder/builderChannel.test.ts +1 -1
- package/incrementalBuilder/builderChannel.ts +11 -0
- package/incrementalBuilder/builderGraphPayloads.ts +3 -3
- package/incrementalBuilder/builderLanes.ts +157 -0
- package/incrementalBuilder/builderWatch.ts +213 -0
- package/incrementalBuilder/csrRegistry.ts +234 -0
- package/incrementalBuilder/incrementalBuilder.proc.test.ts +101 -7
- package/incrementalBuilder/incrementalBuilder.proc.ts +81 -823
- package/incrementalBuilder/ssrRegistry.ts +282 -0
- package/index.ts +22 -22
- package/integration/devStability.integration.test.ts +62 -56
- package/integration/devStabilityHarness.test.ts +1 -1
- package/lint/__fixtures__/no-import-common-err/bad.tsx +13 -0
- package/lint/__fixtures__/no-import-common-err/good.tsx +12 -0
- package/{biomeBase.test.ts → lint/biomeBase.test.ts} +1 -1
- package/lint/gritRules.test.ts +1 -1
- package/{linter.test.ts → lint/linter.test.ts} +1 -1
- package/lint/no-import-common-err.grit +31 -0
- package/lint/no-init-fetch-in-client.grit +1 -1
- package/mobile/desktopBin.test.ts +1 -1
- package/mobile/desktopRelease.test.ts +1 -1
- package/mobile/desktopServerStage.test.ts +2 -2
- package/mobile/desktopServerStage.ts +1 -1
- package/mobile/nativeApi.test.ts +1 -1
- package/mobile/nativeApp.test.ts +1 -1
- package/mobile/nativeConfig.test.ts +1 -1
- package/mobile/nativePluginFolders.test.ts +1 -1
- package/mobile/nativePublicEnv.test.ts +1 -1
- package/mobile/nativeWebDir.test.ts +1 -1
- package/mobile/serverBundleSecrets.test.ts +1 -1
- package/mobile/tarWriter.test.ts +1 -1
- package/mobile/updatePackFolder.test.ts +1 -1
- package/package.json +173 -9
- package/packageExports.test.ts +20 -2
- package/piDependencyPins.test.ts +1 -1
- package/pipeline/PipelineDefinition.ts +1 -1
- package/platformTest/IdleWatchedProcess.test.ts +1 -1
- package/platformTest/LinuxDockerTarget.ts +1 -1
- package/platformTest/PlatformTestRun.test.ts +1 -1
- package/platformTest/TestSnapshot.test.ts +1 -1
- package/platformTest/WindowsSshTarget.ts +1 -1
- package/preview/previewView.test.ts +23 -1
- package/{abstractDoc.test.ts → quality/abstractDoc.test.ts} +2 -2
- package/{abstractDoc.ts → quality/abstractDoc.ts} +1 -1
- package/quality/bareErrorScanner.ts +126 -0
- package/{maintainabilityBaseline.test.ts → quality/maintainabilityBaseline.test.ts} +73 -0
- package/{maintainabilityBaseline.ts → quality/maintainabilityBaseline.ts} +97 -9
- package/{maintainabilityContract.test.ts → quality/maintainabilityContract.test.ts} +383 -2
- package/{maintainabilityContract.ts → quality/maintainabilityContract.ts} +151 -29
- package/{maintainabilityExceptionScanner.test.ts → quality/maintainabilityExceptionScanner.test.ts} +15 -1
- package/{maintainabilityExceptionScanner.ts → quality/maintainabilityExceptionScanner.ts} +5 -1
- package/{maintainabilityLimits.ts → quality/maintainabilityLimits.ts} +12 -0
- package/{maintainabilityReport.ts → quality/maintainabilityReport.ts} +20 -3
- package/{qualityScanner.test.ts → quality/qualityScanner.test.ts} +41 -1
- package/{qualityScanner.ts → quality/qualityScanner.ts} +25 -91
- package/{storeAccessScanner.ts → quality/storeAccessScanner.ts} +15 -2
- package/quality/workspaceSourceFiles.ts +82 -0
- package/{subspace.test.ts → subspace/subspace.test.ts} +25 -4
- package/{subspace.ts → subspace/subspace.ts} +5 -5
- package/{subspaceClone.ts → subspace/subspaceClone.ts} +8 -8
- package/{subspaceConfig.ts → subspace/subspaceConfig.ts} +5 -1
- package/{testHelpers.ts → test/testHelpers.ts} +37 -1
- package/transforms/barrelAnalyzer.ts +31 -10
- package/transforms/browserDirnamePlugin.test.ts +1 -1
- package/transforms/externalizeFrameworkPlugin.test.ts +1 -1
- package/transforms/mcpAppPageTrimmer.test.ts +1 -1
- package/transforms/pureLazyMarker.test.ts +1 -1
- package/transforms/serverEnvPlugin.test.ts +1 -1
- package/transforms/serverEnvProfile.test.ts +1 -1
- package/transforms/sideEffectImportOrder.test.ts +1 -1
- package/transforms/transforms.test.ts +52 -2
- package/transforms/tsconfigPackageResolver.test.ts +1 -1
- package/{createTunnel.test.ts → tunnel/createTunnel.test.ts} +1 -1
- package/{createTunnel.ts → tunnel/createTunnel.ts} +2 -2
- package/{sshHostKeys.ts → tunnel/sshHostKeys.ts} +2 -2
- package/typecheck/projectTypecheck.test.ts +23 -1
- package/typecheck/projectTypecheck.ts +10 -2
- package/{typeChecker.test.ts → typecheck/typeChecker.test.ts} +1 -1
- package/{typeChecker.ts → typecheck/typeChecker.ts} +5 -4
- package/typecheck/typecheck.proc.ts +6 -2
- package/typecheck/typecheckFailure.ts +1 -1
- package/util/errorReport.ts +66 -0
- package/{jsonFormatter.test.ts → util/jsonFormatter.test.ts} +1 -1
- package/workflow/constantSource.ts +187 -0
- package/workflow/dictionarySource.ts +184 -0
- package/workflow/executor.ts +6 -9
- package/workflow/fieldExpression.ts +153 -0
- package/workflow/fieldLabel.ts +61 -0
- package/workflow/fieldOrder.ts +117 -0
- package/workflow/fieldType.ts +2 -1
- package/workflow/guardCatalog.test.ts +1 -1
- package/workflow/keyRename.ts +1 -1
- package/workflow/moduleIndex.test.ts +2 -2
- package/workflow/moduleIndex.ts +2 -2
- package/workflow/modulePaths.ts +27 -0
- package/workflow/mutationScaffold.ts +7 -15
- package/workflow/mutationSource.ts +2 -1
- package/workflow/plan.ts +2 -1
- package/workflow/primitiveReport.ts +78 -0
- package/workflow/rolloutGate.test.ts +1 -1
- package/workflow/rolloutGate.ts +1 -1
- package/workflow/serviceSource.ts +33 -0
- package/workflow/signalSource.ts +96 -0
- package/workflow/source.ts +50 -1100
- package/workflow/sourceAst.ts +30 -0
- package/workflow/sourceImports.ts +105 -0
- package/workflow/sourceText.ts +13 -0
- package/workflow/templateSource.ts +30 -0
- package/workflow/testSource.ts +31 -0
- package/workflow/types.ts +1 -1
- package/workflow/uiPolicy.ts +1 -1
- package/{appSelectionMemory.ts → workspace/appSelectionMemory.ts} +1 -1
- package/{codegenLock.test.ts → workspace/codegenLock.test.ts} +1 -1
- package/{dependencyScanner.test.ts → workspace/dependencyScanner.test.ts} +1 -1
- package/{dependencyScanner.ts → workspace/dependencyScanner.ts} +2 -2
- package/{envSeed.test.ts → workspace/envSeed.test.ts} +2 -2
- package/{envSeed.ts → workspace/envSeed.ts} +1 -1
- package/{libSource.test.ts → workspace/libSource.test.ts} +2 -2
- package/{libSource.ts → workspace/libSource.ts} +1 -1
- package/{scanInfo.ts → workspace/scanInfo.ts} +21 -10
- package/{slicePlanner.test.ts → workspace/slicePlanner.test.ts} +2 -2
- package/{slicePlanner.ts → workspace/slicePlanner.ts} +1 -1
- package/{workspaceGraph.test.ts → workspace/workspaceGraph.test.ts} +1 -1
- package/{workspaceGraph.ts → workspace/workspaceGraph.ts} +1 -1
- package/{workspaceLayout.test.ts → workspace/workspaceLayout.test.ts} +1 -1
- package/{workspaceLayout.ts → workspace/workspaceLayout.ts} +3 -1
- package/akanContext.ts +0 -1083
- package/executors.ts +0 -1749
- /package/{applicationBuildReporter.test.ts → app/applicationBuildReporter.test.ts} +0 -0
- /package/{akanMcpToolError.ts → context/akanMcpToolError.ts} +0 -0
- /package/{moduleFieldNames.test.ts → context/moduleFieldNames.test.ts} +0 -0
- /package/{moduleFieldNames.ts → context/moduleFieldNames.ts} +0 -0
- /package/{recipeScanner.ts → context/recipeScanner.ts} +0 -0
- /package/{declarationReader.ts → docs/declarationReader.ts} +0 -0
- /package/{frameworkGraph.ts → docs/frameworkGraph.ts} +0 -0
- /package/{biomeBase.ts → lint/biomeBase.ts} +0 -0
- /package/{linter.ts → lint/linter.ts} +0 -0
- /package/{commentDensityScanner.test.ts → quality/commentDensityScanner.test.ts} +0 -0
- /package/{commentDensityScanner.ts → quality/commentDensityScanner.ts} +0 -0
- /package/{componentSizeScanner.test.ts → quality/componentSizeScanner.test.ts} +0 -0
- /package/{componentSizeScanner.ts → quality/componentSizeScanner.ts} +0 -0
- /package/{componentWriteChainScanner.test.ts → quality/componentWriteChainScanner.test.ts} +0 -0
- /package/{componentWriteChainScanner.ts → quality/componentWriteChainScanner.ts} +0 -0
- /package/{deprecatedCommentScanner.test.ts → quality/deprecatedCommentScanner.test.ts} +0 -0
- /package/{deprecatedCommentScanner.ts → quality/deprecatedCommentScanner.ts} +0 -0
- /package/{endpointReach.test.ts → quality/endpointReach.test.ts} +0 -0
- /package/{endpointReach.ts → quality/endpointReach.ts} +0 -0
- /package/{formSetterScanner.test.ts → quality/formSetterScanner.test.ts} +0 -0
- /package/{formSetterScanner.ts → quality/formSetterScanner.ts} +0 -0
- /package/{kindBranchScanner.test.ts → quality/kindBranchScanner.test.ts} +0 -0
- /package/{kindBranchScanner.ts → quality/kindBranchScanner.ts} +0 -0
- /package/{maintainabilityReport.test.ts → quality/maintainabilityReport.test.ts} +0 -0
- /package/{renderMutationScanner.test.ts → quality/renderMutationScanner.test.ts} +0 -0
- /package/{renderMutationScanner.ts → quality/renderMutationScanner.ts} +0 -0
- /package/{serviceLoopCallScanner.test.ts → quality/serviceLoopCallScanner.test.ts} +0 -0
- /package/{serviceLoopCallScanner.ts → quality/serviceLoopCallScanner.ts} +0 -0
- /package/{signalMutationIndex.test.ts → quality/signalMutationIndex.test.ts} +0 -0
- /package/{signalMutationIndex.ts → quality/signalMutationIndex.ts} +0 -0
- /package/{sourceComments.test.ts → quality/sourceComments.test.ts} +0 -0
- /package/{sourceComments.ts → quality/sourceComments.ts} +0 -0
- /package/{ssrScanner.test.ts → quality/ssrScanner.test.ts} +0 -0
- /package/{ssrScanner.ts → quality/ssrScanner.ts} +0 -0
- /package/{storeAccessScanner.test.ts → quality/storeAccessScanner.test.ts} +0 -0
- /package/{storeSource.ts → quality/storeSource.ts} +0 -0
- /package/{storeWriteScanner.test.ts → quality/storeWriteScanner.test.ts} +0 -0
- /package/{storeWriteScanner.ts → quality/storeWriteScanner.ts} +0 -0
- /package/{structureScanner.test.ts → quality/structureScanner.test.ts} +0 -0
- /package/{structureScanner.ts → quality/structureScanner.ts} +0 -0
- /package/{testOnlyExportScanner.test.ts → quality/testOnlyExportScanner.test.ts} +0 -0
- /package/{testOnlyExportScanner.ts → quality/testOnlyExportScanner.ts} +0 -0
- /package/{writePath.test.ts → quality/writePath.test.ts} +0 -0
- /package/{writePath.ts → quality/writePath.ts} +0 -0
- /package/{writePlacementScanner.test.ts → quality/writePlacementScanner.test.ts} +0 -0
- /package/{writePlacementScanner.ts → quality/writePlacementScanner.ts} +0 -0
- /package/{writingActionIndex.test.ts → quality/writingActionIndex.test.ts} +0 -0
- /package/{writingActionIndex.ts → quality/writingActionIndex.ts} +0 -0
- /package/{subspaceReport.ts → subspace/subspaceReport.ts} +0 -0
- /package/{sshTunnel.ts → tunnel/sshTunnel.ts} +0 -0
- /package/{fileEditor.ts → util/fileEditor.ts} +0 -0
- /package/{fileSys.test.ts → util/fileSys.test.ts} +0 -0
- /package/{fileSys.ts → util/fileSys.ts} +0 -0
- /package/{jsonFormatter.ts → util/jsonFormatter.ts} +0 -0
- /package/{selectModel.ts → util/selectModel.ts} +0 -0
- /package/{semver.test.ts → util/semver.test.ts} +0 -0
- /package/{semver.ts → util/semver.ts} +0 -0
- /package/{shellOnlyEnv.test.ts → util/shellOnlyEnv.test.ts} +0 -0
- /package/{shellOnlyEnv.ts → util/shellOnlyEnv.ts} +0 -0
- /package/{spinner.test.ts → util/spinner.test.ts} +0 -0
- /package/{spinner.ts → util/spinner.ts} +0 -0
- /package/{stripAnsi.ts → util/stripAnsi.ts} +0 -0
- /package/{codegenLock.ts → workspace/codegenLock.ts} +0 -0
- /package/{getRelatedCnsts.ts → workspace/getRelatedCnsts.ts} +0 -0
- /package/{gitRevision.test.ts → workspace/gitRevision.test.ts} +0 -0
- /package/{gitRevision.ts → workspace/gitRevision.ts} +0 -0
- /package/{manifestDependencies.ts → workspace/manifestDependencies.ts} +0 -0
- /package/{packageExportsMap.ts → workspace/packageExportsMap.ts} +0 -0
- /package/{repoIdentity.ts → workspace/repoIdentity.ts} +0 -0
- /package/{types.ts → workspace/types.ts} +0 -0
package/DEV_RUNTIME_KNOBS.md
CHANGED
|
@@ -74,9 +74,10 @@ which is the one case where replacing it again cannot help; it says that too, an
|
|
|
74
74
|
| `AKAN_BUILDER_RPC_TIMEOUT_MS` | `120000` | How long the backend waits for a builder answer. Generous on purpose: a cold CSR build of every page legitimately takes tens of seconds. |
|
|
75
75
|
| `AKAN_SERVER_PAGES_SPLITTING` | off | Emit the server pages bundle as chunks instead of one file. Experimental — the memory/latency trade has not been measured on a real app. |
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
holds the SSR registry's boot build back,
|
|
79
|
-
|
|
77
|
+
Three more are read by the dev server for its end-to-end tests only; never set them. `AKAN_DEV_SSR_ARM_DELAY_MS`
|
|
78
|
+
holds the SSR registry's boot build back, `AKAN_CSR_DEV_APP_WRITE_DELAY_MS` holds a registry's `app.js` back
|
|
79
|
+
after a patch is announced, and `AKAN_DEV_BUILDER_READY_GATE` keeps a builder whose boot build succeeded from
|
|
80
|
+
reporting ready until the file it names exists.
|
|
80
81
|
|
|
81
82
|
## Observability
|
|
82
83
|
|
package/README.ko.md
CHANGED
|
@@ -26,7 +26,7 @@ bun add -d @akanjs/devkit
|
|
|
26
26
|
## 사용 예시
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
|
-
import { ApplicationBuildRunner } from "@akanjs/devkit/applicationBuildRunner";
|
|
29
|
+
import { ApplicationBuildRunner } from "@akanjs/devkit/app/applicationBuildRunner";
|
|
30
30
|
import { AppExecutor, WorkspaceExecutor } from "@akanjs/devkit/executors";
|
|
31
31
|
|
|
32
32
|
const workspace = WorkspaceExecutor.fromRoot();
|
|
@@ -39,7 +39,8 @@ await runner.build();
|
|
|
39
39
|
|
|
40
40
|
값은 그것을 가진 facet에서 import합니다(`@akanjs/devkit/executors`, `@akanjs/devkit/akanConfig`,
|
|
41
41
|
`@akanjs/devkit/workflow` 등). 루트 `@akanjs/devkit` 진입점은 타입만 내보내므로, 도구 하나를 불러도 모든 facet이
|
|
42
|
-
프로세스에 올라오지 않습니다.
|
|
42
|
+
프로세스에 올라오지 않습니다. facet이 따로 없는 도구는 그 폴더에서 import합니다(`@akanjs/devkit/app/…`, `quality/`,
|
|
43
|
+
`workspace/`, `util/` 등). 이 도구들이 패키지 루트에 있던 시절의 경로는 다음 minor 릴리스까지 계속 동작합니다.
|
|
43
44
|
|
|
44
45
|
## 제공하는 것
|
|
45
46
|
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ bun add -d @akanjs/devkit
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
-
import { ApplicationBuildRunner } from "@akanjs/devkit/applicationBuildRunner";
|
|
28
|
+
import { ApplicationBuildRunner } from "@akanjs/devkit/app/applicationBuildRunner";
|
|
29
29
|
import { AppExecutor, WorkspaceExecutor } from "@akanjs/devkit/executors";
|
|
30
30
|
|
|
31
31
|
const workspace = WorkspaceExecutor.fromRoot();
|
|
@@ -38,7 +38,9 @@ await runner.build();
|
|
|
38
38
|
|
|
39
39
|
Import values from the facet that owns them (`@akanjs/devkit/executors`, `@akanjs/devkit/akanConfig`,
|
|
40
40
|
`@akanjs/devkit/workflow`, …). The root `@akanjs/devkit` entry exports types only, so loading a tool does not pull
|
|
41
|
-
every facet into the process.
|
|
41
|
+
every facet into the process. A tool with no facet of its own is imported from its folder (`@akanjs/devkit/app/…`,
|
|
42
|
+
`quality/`, `workspace/`, `util/`, …); the paths these tools had at the package root still resolve until the next
|
|
43
|
+
minor release.
|
|
42
44
|
|
|
43
45
|
## What It Provides
|
|
44
46
|
|
|
@@ -3,7 +3,7 @@ import { realpath, rm, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { Logger } from "akanjs/common";
|
|
5
5
|
import type { App } from "../commandDecorators";
|
|
6
|
-
import { tempDirs, writeText } from "../testHelpers";
|
|
6
|
+
import { tempDirs, writeText } from "../test/testHelpers";
|
|
7
7
|
import { BackendImportGraph } from "./BackendImportGraph";
|
|
8
8
|
import { filesChangedSince } from "./devHostPolicy";
|
|
9
9
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import type { BuilderMessage } from "akanjs/server";
|
|
3
4
|
import { IncrementalBuilderHost } from "../incrementalBuilder";
|
|
4
|
-
import { createTempApp, isolateEnv, tempRoots, writeText } from "../testHelpers";
|
|
5
|
+
import { createTempApp, isolateEnv, tempRoots, writeText } from "../test/testHelpers";
|
|
5
6
|
import { AkanAppHost } from "./akanApp.host";
|
|
6
7
|
import type { DevHostEvent } from "./devHostPolicy";
|
|
7
8
|
|
|
@@ -195,6 +196,118 @@ describe("a builder request while no builder is running", () => {
|
|
|
195
196
|
});
|
|
196
197
|
});
|
|
197
198
|
|
|
199
|
+
describe("the builder's answers and a returning builder", () => {
|
|
200
|
+
isolateEnv({ AKAN_PUBLIC_REPO_NAME: "repo", AKAN_PUBLIC_SERVE_DOMAIN: "localhost", AKAN_PUBLIC_ENV: "local" });
|
|
201
|
+
const track = tempRoots();
|
|
202
|
+
const until = async (done: () => boolean | Promise<boolean>, timeoutMs = 10_000) => {
|
|
203
|
+
const deadline = performance.now() + timeoutMs;
|
|
204
|
+
while (!(await done()) && performance.now() < deadline) await Bun.sleep(25);
|
|
205
|
+
expect(await done()).toBe(true);
|
|
206
|
+
};
|
|
207
|
+
const fakeBuilder = (sent: BuilderMessage[]) =>
|
|
208
|
+
({
|
|
209
|
+
status: "ready",
|
|
210
|
+
patcherOff: false,
|
|
211
|
+
start: ({ onReady }: { onReady?: () => void }) => onReady?.(),
|
|
212
|
+
send: (message: BuilderMessage) => {
|
|
213
|
+
sent.push(message);
|
|
214
|
+
return true;
|
|
215
|
+
},
|
|
216
|
+
stop: () => undefined,
|
|
217
|
+
}) as unknown as IncrementalBuilderHost;
|
|
218
|
+
|
|
219
|
+
test("a restarted backend never receives its predecessor's answer", async () => {
|
|
220
|
+
const { root, app } = track(await createTempApp("demo"));
|
|
221
|
+
const bootPath = path.join(root, "boot.txt");
|
|
222
|
+
const repliesPath = path.join(root, "replies.txt");
|
|
223
|
+
await writeText(
|
|
224
|
+
path.join(root, "apps/demo/main.ts"),
|
|
225
|
+
[
|
|
226
|
+
'import fs from "node:fs";',
|
|
227
|
+
`const bootPath = ${JSON.stringify(bootPath)};`,
|
|
228
|
+
`const repliesPath = ${JSON.stringify(repliesPath)};`,
|
|
229
|
+
'const boot = (fs.existsSync(bootPath) ? Number(fs.readFileSync(bootPath, "utf8")) : 0) + 1;',
|
|
230
|
+
"fs.writeFileSync(bootPath, String(boot));",
|
|
231
|
+
'process.on("message", (message) => {',
|
|
232
|
+
' if (message?.type === "build-graph-res") fs.appendFileSync(repliesPath, message.id + ":" + message.error + "\\n");',
|
|
233
|
+
"});",
|
|
234
|
+
'process.send?.({ type: "backend-ready", pid: process.pid });',
|
|
235
|
+
'process.send?.({ type: "build-graph", id: 1 });',
|
|
236
|
+
"if (boot === 1) setTimeout(() => process.exit(1), 100);",
|
|
237
|
+
"setInterval(() => undefined, 1_000);",
|
|
238
|
+
"",
|
|
239
|
+
].join("\n"),
|
|
240
|
+
);
|
|
241
|
+
const sent: BuilderMessage[] = [];
|
|
242
|
+
let toHost: (message: BuilderMessage) => void = () => undefined;
|
|
243
|
+
const create = IncrementalBuilderHost.create;
|
|
244
|
+
IncrementalBuilderHost.create = (async (_app: unknown, _env: unknown, onMessage: typeof toHost) => {
|
|
245
|
+
toHost = onMessage;
|
|
246
|
+
return fakeBuilder(sent);
|
|
247
|
+
}) as unknown as typeof IncrementalBuilderHost.create;
|
|
248
|
+
const host = new AkanAppHost(app, { env: { ...process.env } as Record<string, string> });
|
|
249
|
+
try {
|
|
250
|
+
await host.start();
|
|
251
|
+
await until(() => sent.length >= 2);
|
|
252
|
+
const [stale, live] = sent as unknown as { id: number }[];
|
|
253
|
+
toHost({
|
|
254
|
+
type: "build-graph-res",
|
|
255
|
+
id: stale.id,
|
|
256
|
+
ok: false,
|
|
257
|
+
error: "stale",
|
|
258
|
+
kind: "unavailable",
|
|
259
|
+
} as BuilderMessage);
|
|
260
|
+
toHost({ type: "build-graph-res", id: live.id, ok: false, error: "live", kind: "unavailable" } as BuilderMessage);
|
|
261
|
+
await until(() => Bun.file(repliesPath).exists());
|
|
262
|
+
expect(await Bun.file(repliesPath).text()).toBe("1:live\n");
|
|
263
|
+
} finally {
|
|
264
|
+
await host.stop();
|
|
265
|
+
IncrementalBuilderHost.create = create;
|
|
266
|
+
}
|
|
267
|
+
}, 20_000);
|
|
268
|
+
|
|
269
|
+
test("a request that wakes an idle builder reaches it once the wake ends", async () => {
|
|
270
|
+
process.env.AKAN_DEV_IDLE_SUSPEND_MS = "200";
|
|
271
|
+
const { root, app } = track(await createTempApp("demo"));
|
|
272
|
+
const triggerPath = path.join(root, "trigger.txt");
|
|
273
|
+
await writeText(
|
|
274
|
+
path.join(root, "apps/demo/main.ts"),
|
|
275
|
+
[
|
|
276
|
+
'import fs from "node:fs";',
|
|
277
|
+
`const triggerPath = ${JSON.stringify(triggerPath)};`,
|
|
278
|
+
'process.send?.({ type: "backend-ready", pid: process.pid });',
|
|
279
|
+
"const poll = setInterval(() => {",
|
|
280
|
+
" if (!fs.existsSync(triggerPath)) return;",
|
|
281
|
+
" clearInterval(poll);",
|
|
282
|
+
' process.send?.({ type: "build-graph", id: 5 });',
|
|
283
|
+
"}, 20);",
|
|
284
|
+
"setInterval(() => undefined, 1_000);",
|
|
285
|
+
"",
|
|
286
|
+
].join("\n"),
|
|
287
|
+
);
|
|
288
|
+
const sent: BuilderMessage[] = [];
|
|
289
|
+
const create = IncrementalBuilderHost.create;
|
|
290
|
+
IncrementalBuilderHost.create = async () => fakeBuilder(sent);
|
|
291
|
+
const suspended = Promise.withResolvers<void>();
|
|
292
|
+
const host = new AkanAppHost(app, {
|
|
293
|
+
env: { ...process.env } as Record<string, string>,
|
|
294
|
+
onDevEvent: (event) => {
|
|
295
|
+
if ("state" in event && event.state === "suspended") suspended.resolve();
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
try {
|
|
299
|
+
await host.start();
|
|
300
|
+
await suspended.promise;
|
|
301
|
+
expect(sent.filter((message) => message.type === "build-graph")).toEqual([]);
|
|
302
|
+
await writeText(triggerPath, "go");
|
|
303
|
+
await until(() => sent.some((message) => message.type === "build-graph"));
|
|
304
|
+
} finally {
|
|
305
|
+
await host.stop();
|
|
306
|
+
IncrementalBuilderHost.create = create;
|
|
307
|
+
}
|
|
308
|
+
}, 20_000);
|
|
309
|
+
});
|
|
310
|
+
|
|
198
311
|
describe("a stop while the builder is starting", () => {
|
|
199
312
|
isolateEnv({ AKAN_PUBLIC_REPO_NAME: "repo", AKAN_PUBLIC_SERVE_DOMAIN: "localhost", AKAN_PUBLIC_ENV: "local" });
|
|
200
313
|
const track = tempRoots();
|
|
@@ -215,6 +328,22 @@ describe("a stop while the builder is starting", () => {
|
|
|
215
328
|
};
|
|
216
329
|
return builder;
|
|
217
330
|
};
|
|
331
|
+
// Not `.rejects`: on a start that never settles it waits out three ready timeouts instead of failing the test.
|
|
332
|
+
const settled = async (starting: Promise<unknown>) => {
|
|
333
|
+
let timer: Timer | undefined;
|
|
334
|
+
const pending = new Promise<string>((resolve) => {
|
|
335
|
+
timer = setTimeout(() => resolve("still starting"), 2_000);
|
|
336
|
+
});
|
|
337
|
+
const outcome = await Promise.race([
|
|
338
|
+
starting.then(
|
|
339
|
+
() => "started",
|
|
340
|
+
(error: unknown) => (error instanceof Error ? error.message : String(error)),
|
|
341
|
+
),
|
|
342
|
+
pending,
|
|
343
|
+
]);
|
|
344
|
+
clearTimeout(timer);
|
|
345
|
+
return outcome;
|
|
346
|
+
};
|
|
218
347
|
|
|
219
348
|
test("stops a builder created after the stop, and never starts it", async () => {
|
|
220
349
|
const { app } = track(await createTempApp("demo"));
|
|
@@ -232,7 +361,7 @@ describe("a stop while the builder is starting", () => {
|
|
|
232
361
|
await Bun.sleep(50);
|
|
233
362
|
await host.stop();
|
|
234
363
|
created.resolve(builder as unknown as IncrementalBuilderHost);
|
|
235
|
-
await
|
|
364
|
+
expect(await settled(starting)).toBe("dev server stopped before the builder started");
|
|
236
365
|
expect({ creates, started: builder.started, stopped: builder.stopped }).toEqual({
|
|
237
366
|
creates: 1,
|
|
238
367
|
started: 0,
|
|
@@ -261,7 +390,7 @@ describe("a stop while the builder is starting", () => {
|
|
|
261
390
|
await Bun.sleep(50);
|
|
262
391
|
expect(builder.started).toBe(1);
|
|
263
392
|
await host.stop();
|
|
264
|
-
await
|
|
393
|
+
expect(await settled(starting)).toBe("dev server stopped before the builder was ready");
|
|
265
394
|
exitLate?.();
|
|
266
395
|
await Bun.sleep(50);
|
|
267
396
|
expect({ creates, stopped: builder.stopped }).toEqual({ creates: 1, stopped: 1 });
|