@akanjs/devkit 3.2.0-rc.9 → 3.2.1-rc.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 -529
- 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 +152 -6
- package/akanApp/akanApp.host.ts +187 -1220
- package/akanApp/akanApp.host.wiring.test.ts +931 -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 +394 -0
- package/akanApp/devBuildStatusBoard.ts +128 -0
- package/akanApp/devBuilder.ts +200 -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/devStartTimeline.test.ts +115 -0
- package/akanApp/devStartTimeline.ts +69 -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 +463 -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} +106 -18
- 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/buildCacheStamp.test.ts +42 -0
- package/frontendBuild/buildCacheStamp.ts +23 -0
- 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/cssCandidateCache.test.ts +70 -1
- package/frontendBuild/cssCandidateCache.ts +17 -10
- 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 +145 -4
- package/frontendBuild/fontOptimizer.ts +103 -18
- 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/ssrBaseArtifactBuilder.test.ts +30 -1
- package/frontendBuild/ssrBaseArtifactBuilder.ts +40 -12
- 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 +16 -5
- package/incrementalBuilder/buildBatchProtocol.ts +3 -0
- package/incrementalBuilder/buildBatchRunner.test.ts +122 -2
- package/incrementalBuilder/buildBatchRunner.ts +17 -4
- package/incrementalBuilder/builderBoot.ts +113 -0
- package/incrementalBuilder/builderBuildStatus.ts +23 -0
- package/incrementalBuilder/builderChannel.test.ts +1 -1
- package/incrementalBuilder/builderChannel.ts +19 -2
- 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.host.test.ts +16 -0
- package/incrementalBuilder/incrementalBuilder.host.ts +7 -1
- package/incrementalBuilder/incrementalBuilder.proc.test.ts +142 -7
- package/incrementalBuilder/incrementalBuilder.proc.ts +82 -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/nativePublicEnv.ts +2 -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/{fileSys.test.ts → util/fileSys.test.ts} +13 -0
- package/{fileSys.ts → util/fileSys.ts} +2 -2
- 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/{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
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import type { BuilderMessage, BuilderReq } from "akanjs/server";
|
|
4
|
-
import { createTempApp, tempRoots, writeText } from "../testHelpers";
|
|
4
|
+
import { createTempApp, tempRoots, writeText } from "../test/testHelpers";
|
|
5
5
|
|
|
6
6
|
const track = tempRoots();
|
|
7
7
|
|
|
8
8
|
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
9
9
|
|
|
10
|
+
const crashWindowMs = 2_000;
|
|
11
|
+
|
|
10
12
|
const until = async (proc: Bun.Subprocess, what: string, condition: () => boolean, timeoutMs = 20_000) => {
|
|
11
13
|
const deadline = Date.now() + timeoutMs;
|
|
12
14
|
while (!condition()) {
|
|
@@ -20,9 +22,11 @@ describe("incremental builder process", () => {
|
|
|
20
22
|
const { root } = track(await createTempApp("demo"));
|
|
21
23
|
const appDir = path.join(root, "apps/demo");
|
|
22
24
|
// The batch runner looks under the workspace root first: a stand-in for the boot build, which needs a whole app.
|
|
25
|
+
// Each stand-in waits for the runner's release, as the real worker does: one exiting at once can lose all it sent.
|
|
23
26
|
await writeText(
|
|
24
27
|
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
25
28
|
`const { generation } = JSON.parse(process.argv[2]);
|
|
29
|
+
process.once("disconnect", () => {});
|
|
26
30
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
27
31
|
`,
|
|
28
32
|
);
|
|
@@ -82,6 +86,47 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
82
86
|
expect(log).toContain(reason);
|
|
83
87
|
}, 30_000);
|
|
84
88
|
|
|
89
|
+
test("says its boot artifact is built, with the build's parts, before it says it is ready", async () => {
|
|
90
|
+
const { root } = track(await createTempApp("demo"));
|
|
91
|
+
const appDir = path.join(root, "apps/demo");
|
|
92
|
+
await writeText(
|
|
93
|
+
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
94
|
+
`const { generation } = JSON.parse(process.argv[2]);
|
|
95
|
+
process.once("disconnect", () => {});
|
|
96
|
+
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] }, basePhaseMs: { styles: 7, pages: 5, total: 9 } } });
|
|
97
|
+
`,
|
|
98
|
+
);
|
|
99
|
+
await writeText(path.join(appDir, "page/_index.tsx"), "export default () => null;\n");
|
|
100
|
+
const messages: { type: string; phaseMs?: Record<string, number> }[] = [];
|
|
101
|
+
const proc = Bun.spawn(["bun", path.join(import.meta.dir, "incrementalBuilder.proc.ts")], {
|
|
102
|
+
cwd: appDir,
|
|
103
|
+
env: {
|
|
104
|
+
...process.env,
|
|
105
|
+
AKAN_WORKSPACE_ROOT: root,
|
|
106
|
+
AKAN_PUBLIC_APP_NAME: "demo",
|
|
107
|
+
AKAN_PUBLIC_REPO_NAME: "repo",
|
|
108
|
+
AKAN_PUBLIC_SERVE_DOMAIN: "localhost",
|
|
109
|
+
AKAN_PUBLIC_ENV: "local",
|
|
110
|
+
AKAN_WATCH: "0",
|
|
111
|
+
},
|
|
112
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
113
|
+
serialization: "advanced",
|
|
114
|
+
ipc: (message: { type: string; phaseMs?: Record<string, number> }) => {
|
|
115
|
+
messages.push(message);
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
try {
|
|
119
|
+
await until(proc, "builder-ready", () => messages.some((message) => message.type === "builder-ready"));
|
|
120
|
+
} finally {
|
|
121
|
+
proc.kill();
|
|
122
|
+
await proc.exited;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const types = messages.map((message) => message.type);
|
|
126
|
+
expect(types.slice(0, 2)).toEqual(["base-built", "builder-ready"]);
|
|
127
|
+
expect(messages[0]).toEqual({ type: "base-built", phaseMs: { styles: 7, pages: 5, total: 9 } });
|
|
128
|
+
}, 30_000);
|
|
129
|
+
|
|
85
130
|
test("builds a view's shell once on request, answers with its failure, and reports it to no tab", async () => {
|
|
86
131
|
const { root } = track(await createTempApp("demo"));
|
|
87
132
|
const appDir = path.join(root, "apps/demo");
|
|
@@ -90,6 +135,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
90
135
|
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
91
136
|
`const { generation, needs } = JSON.parse(process.argv[2]);
|
|
92
137
|
const errors = needs.includes("base") ? {} : { shell: "handed " + needs.join(",") };
|
|
138
|
+
process.once("disconnect", () => {});
|
|
93
139
|
process.send({ type: "build-batch-result", data: { generation, errors, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
94
140
|
`,
|
|
95
141
|
);
|
|
@@ -135,6 +181,7 @@ process.send({ type: "build-batch-result", data: { generation, errors, artifact:
|
|
|
135
181
|
await writeText(
|
|
136
182
|
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
137
183
|
`const { generation } = JSON.parse(process.argv[2]);
|
|
184
|
+
process.once("disconnect", () => {});
|
|
138
185
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
139
186
|
`,
|
|
140
187
|
);
|
|
@@ -237,6 +284,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
237
284
|
await writeText(
|
|
238
285
|
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
239
286
|
`const { generation } = JSON.parse(process.argv[2]);
|
|
287
|
+
process.once("disconnect", () => {});
|
|
240
288
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
241
289
|
`,
|
|
242
290
|
);
|
|
@@ -299,6 +347,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
299
347
|
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
300
348
|
`const { generation, needs } = JSON.parse(process.argv[2]);
|
|
301
349
|
require("node:fs").appendFileSync(${JSON.stringify(ledger)}, needs.join(",") + "\\n");
|
|
350
|
+
process.once("disconnect", () => {});
|
|
302
351
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
303
352
|
`,
|
|
304
353
|
);
|
|
@@ -357,6 +406,7 @@ process.on("disconnect", orphaned);
|
|
|
357
406
|
const deadline = Date.now() + 15_000;
|
|
358
407
|
if (needs.includes("ssr")) while (!fs.existsSync(${JSON.stringify(gate)}) && Date.now() < deadline) await Bun.sleep(20);
|
|
359
408
|
const css = needs.includes("ssr") ? { cssAssets: ${JSON.stringify(landed)} } : {};
|
|
409
|
+
process.once("disconnect", () => {});
|
|
360
410
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] }, ...css } });
|
|
361
411
|
process.off("disconnect", orphaned);
|
|
362
412
|
`,
|
|
@@ -417,6 +467,7 @@ if (needs.includes("ssr")) {
|
|
|
417
467
|
fs.appendFileSync(${JSON.stringify(runs)}, Date.now() + "\\n");
|
|
418
468
|
if (fs.readFileSync(${JSON.stringify(runs)}, "utf8").trim().split("\\n").length <= 2) process.exit(1);
|
|
419
469
|
}
|
|
470
|
+
process.once("disconnect", () => {});
|
|
420
471
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
421
472
|
`,
|
|
422
473
|
);
|
|
@@ -435,6 +486,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
435
486
|
AKAN_PUBLIC_SERVE_DOMAIN: "localhost",
|
|
436
487
|
AKAN_PUBLIC_ENV: "local",
|
|
437
488
|
AKAN_WATCH: "0",
|
|
489
|
+
AKAN_DEV_SSR_CRASH_RETRY_MS: String(crashWindowMs),
|
|
438
490
|
},
|
|
439
491
|
stdio: ["ignore", "ignore", "ignore"],
|
|
440
492
|
serialization: "advanced",
|
|
@@ -445,11 +497,10 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
445
497
|
const ssrRuns = async () =>
|
|
446
498
|
(await Bun.file(runs).exists()) ? (await Bun.file(runs).text()).trim().split("\n").map(Number) : [];
|
|
447
499
|
try {
|
|
448
|
-
|
|
449
|
-
await until(proc, "boot-armed", () => messages.some((message) => message.type === "boot-armed"), 30_000);
|
|
500
|
+
await until(proc, "boot-armed", () => messages.some((message) => message.type === "boot-armed"));
|
|
450
501
|
const [first = 0, second = 0] = await ssrRuns();
|
|
451
502
|
expect(await ssrRuns()).toHaveLength(2);
|
|
452
|
-
expect(second - first).toBeGreaterThanOrEqual(
|
|
503
|
+
expect(second - first).toBeGreaterThanOrEqual(crashWindowMs - 500);
|
|
453
504
|
proc.send({
|
|
454
505
|
type: "build-route",
|
|
455
506
|
id: 1,
|
|
@@ -463,7 +514,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
463
514
|
const deadline = Date.now() + 15_000;
|
|
464
515
|
while ((await ssrRuns()).length < 3 && Date.now() < deadline) await wait(100);
|
|
465
516
|
const [, retried = 0, third = 0] = await ssrRuns();
|
|
466
|
-
expect(third - retried).toBeGreaterThanOrEqual(
|
|
517
|
+
expect(third - retried).toBeGreaterThanOrEqual(crashWindowMs - 500);
|
|
467
518
|
} finally {
|
|
468
519
|
proc.kill();
|
|
469
520
|
await proc.exited;
|
|
@@ -483,6 +534,7 @@ if (needs.includes("ssr")) {
|
|
|
483
534
|
fs.appendFileSync(${JSON.stringify(runs)}, Date.now() + "\\n");
|
|
484
535
|
if (fs.readFileSync(${JSON.stringify(runs)}, "utf8").trim().split("\\n").length === 2) process.exit(1);
|
|
485
536
|
}
|
|
537
|
+
process.once("disconnect", () => {});
|
|
486
538
|
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
487
539
|
`,
|
|
488
540
|
);
|
|
@@ -501,6 +553,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
501
553
|
AKAN_PUBLIC_SERVE_DOMAIN: "localhost",
|
|
502
554
|
AKAN_PUBLIC_ENV: "local",
|
|
503
555
|
AKAN_WATCH: "0",
|
|
556
|
+
AKAN_DEV_SSR_CRASH_RETRY_MS: String(crashWindowMs),
|
|
504
557
|
},
|
|
505
558
|
stdio: ["ignore", "ignore", "ignore"],
|
|
506
559
|
serialization: "advanced",
|
|
@@ -524,7 +577,7 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
524
577
|
const deadline = Date.now() + 20_000;
|
|
525
578
|
while ((await ssrRuns()).length < 3 && Date.now() < deadline) await wait(100);
|
|
526
579
|
const [, killed = 0, retried = 0] = await ssrRuns();
|
|
527
|
-
expect(retried - killed).toBeGreaterThanOrEqual(
|
|
580
|
+
expect(retried - killed).toBeGreaterThanOrEqual(crashWindowMs - 500);
|
|
528
581
|
} finally {
|
|
529
582
|
proc.kill();
|
|
530
583
|
await proc.exited;
|
|
@@ -539,7 +592,10 @@ process.send({ type: "build-batch-result", data: { generation, errors: {}, artif
|
|
|
539
592
|
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
540
593
|
`const { generation, needs } = JSON.parse(process.argv[2]);
|
|
541
594
|
if (needs.includes("ssr")) await import(${JSON.stringify(path.join(import.meta.dir, "buildBatch.proc.ts"))});
|
|
542
|
-
else
|
|
595
|
+
else {
|
|
596
|
+
process.once("disconnect", () => {});
|
|
597
|
+
process.send({ type: "build-batch-result", data: { generation, errors: {}, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
598
|
+
}
|
|
543
599
|
`,
|
|
544
600
|
);
|
|
545
601
|
await writeText(path.join(appDir, "env/env.client.ts"), "export const env = {} as const;\n");
|
|
@@ -588,4 +644,83 @@ else process.send({ type: "build-batch-result", data: { generation, errors: {},
|
|
|
588
644
|
await proc.exited;
|
|
589
645
|
}
|
|
590
646
|
}, 60_000);
|
|
647
|
+
|
|
648
|
+
test("a failed boot build waits for the save that fixes it, and the builder it recovers continues the generation and watches", async () => {
|
|
649
|
+
const { root } = track(await createTempApp("demo"));
|
|
650
|
+
const appDir = path.join(root, "apps/demo");
|
|
651
|
+
const ledger = path.join(root, "batches.log");
|
|
652
|
+
const fixed = path.join(root, "boot-fixed");
|
|
653
|
+
// A stand-in batch: the boot build fails until the fix lands, and every batch logs its needs and generation.
|
|
654
|
+
await writeText(
|
|
655
|
+
path.join(root, "pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts"),
|
|
656
|
+
`import fs from "node:fs";
|
|
657
|
+
const { generation, needs } = JSON.parse(process.argv[2]);
|
|
658
|
+
fs.appendFileSync(${JSON.stringify(ledger)}, needs.join(",") + " " + generation + "\\n");
|
|
659
|
+
const errors = needs.includes("base") && !fs.existsSync(${JSON.stringify(fixed)}) ? { base: "the boot is broken" } : {};
|
|
660
|
+
process.once("disconnect", () => {});
|
|
661
|
+
process.send({ type: "build-batch-result", data: { generation, errors, artifact: {}, optimizedFonts: { css: "", files: [] } } });
|
|
662
|
+
`,
|
|
663
|
+
);
|
|
664
|
+
const page = path.join(appDir, "page/_index.tsx");
|
|
665
|
+
await writeText(page, "export default () => null;\n");
|
|
666
|
+
const messages: BuilderMessage[] = [];
|
|
667
|
+
const proc = Bun.spawn(["bun", path.join(import.meta.dir, "incrementalBuilder.proc.ts")], {
|
|
668
|
+
cwd: appDir,
|
|
669
|
+
env: {
|
|
670
|
+
...process.env,
|
|
671
|
+
AKAN_WORKSPACE_ROOT: root,
|
|
672
|
+
AKAN_PUBLIC_APP_NAME: "demo",
|
|
673
|
+
AKAN_PUBLIC_REPO_NAME: "repo",
|
|
674
|
+
AKAN_PUBLIC_SERVE_DOMAIN: "localhost",
|
|
675
|
+
AKAN_PUBLIC_ENV: "local",
|
|
676
|
+
AKAN_BUILDER_INITIAL_GENERATION: "5",
|
|
677
|
+
AKAN_DEV_CSR_PATCHER: "off",
|
|
678
|
+
AKAN_LOG_STDOUT_LEVEL: "info",
|
|
679
|
+
},
|
|
680
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
681
|
+
serialization: "advanced",
|
|
682
|
+
ipc: (message: BuilderMessage) => {
|
|
683
|
+
messages.push(message);
|
|
684
|
+
},
|
|
685
|
+
});
|
|
686
|
+
let stdout = "";
|
|
687
|
+
const decoder = new TextDecoder();
|
|
688
|
+
const reading = (async () => {
|
|
689
|
+
for await (const chunk of proc.stdout) stdout += decoder.decode(chunk, { stream: true });
|
|
690
|
+
})();
|
|
691
|
+
const sent = (type: BuilderMessage["type"]) => messages.filter((message) => message.type === type);
|
|
692
|
+
try {
|
|
693
|
+
await until(proc, "boot-armed", () => sent("boot-armed").length === 1);
|
|
694
|
+
proc.send({ type: "build-graph", id: 1 } satisfies BuilderMessage);
|
|
695
|
+
await until(proc, "build-graph-res", () => sent("build-graph-res").length === 1);
|
|
696
|
+
//? Degraded mode sends boot-armed before its watcher starts, and a save made before then is never seen.
|
|
697
|
+
await until(proc, "the degraded watcher's log line", () => stdout.includes("[degraded] watching"));
|
|
698
|
+
await writeText(fixed, "");
|
|
699
|
+
await writeText(page, "export default () => 1;\n");
|
|
700
|
+
await until(proc, "the recovered builder's boot-armed", () => sent("boot-armed").length === 2);
|
|
701
|
+
await writeText(page, "export default () => 2;\n");
|
|
702
|
+
await until(proc, "the recovered builder's invalidate", () =>
|
|
703
|
+
messages.some((message) => message.type === "invalidate" && message.generation === 9),
|
|
704
|
+
);
|
|
705
|
+
} finally {
|
|
706
|
+
proc.kill();
|
|
707
|
+
await proc.exited;
|
|
708
|
+
await reading;
|
|
709
|
+
}
|
|
710
|
+
expect(sent("build-status")[0]).toMatchObject({
|
|
711
|
+
data: { generation: 6, phase: "pages", ok: false, message: "Boot build failed: the boot is broken" },
|
|
712
|
+
});
|
|
713
|
+
expect(sent("build-graph-res")[0]).toMatchObject({
|
|
714
|
+
id: 1,
|
|
715
|
+
ok: false,
|
|
716
|
+
error: expect.stringContaining("recovering from a failed boot build"),
|
|
717
|
+
});
|
|
718
|
+
expect(sent("builder-ready")).toHaveLength(2);
|
|
719
|
+
expect((await Bun.file(ledger).text()).trim().split("\n").slice(0, 4)).toEqual([
|
|
720
|
+
"base 0",
|
|
721
|
+
"base 0",
|
|
722
|
+
"pages,css 8",
|
|
723
|
+
"ssr 8",
|
|
724
|
+
]);
|
|
725
|
+
}, 60_000);
|
|
591
726
|
});
|