Draft
Conversation
When creating from a GitHub release URL, runCreate was not passing scaffoldDownloadDir to resolveExtensionFn, so tarball contents were extracted to the global ~/.aidd/scaffold/ instead of <folder>/.aidd/scaffold/. Template files from the release tarball were therefore inaccessible when manifest steps executed inside the project folder. Changes: - scaffold-create.js: pass scaffoldDownloadDir: path.join(folder, ".aidd", "scaffold") to resolveExtensionFn so downloaded scaffold files land inside the project directory - scaffold-cleanup.js: accept a folder parameter (defaulting to process.cwd()) and remove <folder>/.aidd/ instead of the global ~/.aidd/scaffold/ - scaffold-commands.js: add [folder] optional argument to the scaffold-cleanup command and resolve it before passing to scaffoldCleanup - Tests updated to cover the new project-scoped download directory and folder-scoped cleanup behaviour - Epic updated with the new requirement Closes #139
Contributor
|
Cursor Agent can help with this pull request. Just |
Closes #139. Scaffold files (template files, SCAFFOLD-MANIFEST.yml, README.md, etc.) were never copied into the project directory. For downloaded scaffolds they sat unused in ~/.aidd/scaffold/; for named and file:// scaffolds they remained at their on-disk source locations. Manifest steps running inside <folder> therefore had no access to any template files. Changes: - scaffold-create.js: copy all files from the scaffold source directory into <folder>/ (via injectable copyFn = fs.copy) for every scaffold type (named, file://, downloaded) - scaffold-create.js: run the manifest from <folder>/SCAFFOLD-MANIFEST.yml in all cases so there is no branching on scaffold type - scaffold-create.js: pre-flight check — throw ScaffoldValidationError if <folder> already exists before resolving or downloading anything - scaffold-cleanup.js / scaffold-commands.js: reverted the wrong download-location change from the previous commit; cleanup still targets ~/.aidd/scaffold/ - Tests: added unit tests for copy behaviour (all scaffold types), manifest path resolution, and folder-exists guard; added E2E tests verifying scaffold files land in the project directory and that an existing target folder is rejected
npm init -y in a scaffold manifest is an anti-pattern: since npx aidd create now copies scaffold source files into the project folder first, the template package.json is already in place before any steps run. Running npm init -y on top of it is redundant and misleading. Changes: - SCAFFOLD-MANIFEST.yml: remove npm init -y and npm pkg set steps; manifest is now a single npm install --save-dev step - package.json: redesign as a project template — pre-configured with type:module, test and release scripts; no scaffold-specific name or files field - README.md: update description to reflect template-first approach - docs/scaffold-authoring.md: replace npm init -y example with the template pattern; add tip explaining copy-then-install ordering - tasks epic: update scaffold-example requirements - E2E test: add assertion that manifest does not contain npm init -y, and that the generated project has type:module from the template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #139
This PR addresses an issue where
aidd createwas extracting GitHub release tarballs to a global directory (~/.aidd/scaffold/) instead of the project-specific directory (<folder>/.aidd/scaffold/). This caused template files to be inaccessible during manifest steps.Changes include:
lib/scaffold-create.js: Now passesscaffoldDownloadDirtoresolveExtensionFnto ensure release files are extracted to<folder>/.aidd/scaffold/.lib/scaffold-cleanup.js: Updated to remove the project-scoped<folder>/.aidd/directory, consistent with the new extraction behavior.lib/scaffold-commands.js: Added an optional[folder]argument toscaffold-cleanupfor explicit path specification.scaffold-cleanup.test.js,scaffold-create.test.js, andbin/create-e2e.test.jsto reflect the project-scoped behavior. All unit and E2E tests pass.