-
Notifications
You must be signed in to change notification settings - Fork 0
Add workspace resolver support and update create-gen-app tests for new boilerplates #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add workspace.name, workspace.organization.name, and workspace.license resolvers using repo URL/pkg license fallback ensure workspace name prefers repo slug with package name fallback expand resolver and setFrom tests to cover new workspace keys document workspace resolver list in README
point tests, CLI defaults, and dev script to constructive-io/pgpm-boilerplates on main with default/ base path adjust integration helpers to use the new template path and branch; update snapshots for new boilerplate contents refresh docs to reflect the new repo URL and template directory defaults
| - `--repo` (`-r`): repository URL to clone (default: `https://github.com/constructive-io/pgpm-boilerplates/`) | ||
| - `--branch` (`-b`): branch or tag to checkout | ||
| - `--path` (`-p`): directory within the repo to scan for templates (default: `.`) | ||
| - `--path` (`-p`): directory within the repo to scan for templates (default: `default`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't default be ., and in our repo, we're setting it to default because we have the folder there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We originally hardcoded default to stop CI failures after the boilerplate repo moved templates under default/ and the dev harness didn’t read .boilerplates.json. Now the CLI auto-detects the base dir from that file (fallback .), so CI stays green without the hardcoded path
| const DEFAULT_REPO = "https://github.com/launchql/pgpm-boilerplates/"; | ||
| const DEFAULT_DIRECTORY = "."; | ||
| const DEFAULT_REPO = "https://github.com/constructive-io/pgpm-boilerplates/"; | ||
| const DEFAULT_DIRECTORY = "default"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the default, . makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as above reply
| const DEFAULT_REPO = "https://github.com/launchql/pgpm-boilerplates.git"; | ||
| const DEFAULT_PATH = "."; | ||
| const DEFAULT_REPO = "https://github.com/constructive-io/pgpm-boilerplates.git"; | ||
| const DEFAULT_PATH = "default"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again this should be .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as above reply
| // Import package.json for version | ||
| import * as createGenPackageJson from "create-gen-app/package.json"; | ||
| const PACKAGE_NAME = createGenPackageJson.name ?? "@launchql/cli"; | ||
| const PACKAGE_NAME = createGenPackageJson.name ?? "@constructive/cli"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this cli doesn't exist, we currenlty have pgpm or @launchql/cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved
| process.env.CREATE_GEN_TEST_BRANCH ?? "license"; | ||
| process.env.CREATE_GEN_TEST_BRANCH ?? "main"; | ||
| export const TEST_TEMPLATE_DIR = | ||
| process.env.CREATE_GEN_TEST_BASE_PATH ?? "default"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the hardcoded default here as well. The test helper now mirrors the CLI behavior: it prefers CREATE_GEN_TEST_BASE_PATH, otherwise reads .boilerplates.json to determine the base dir and falls back to .. The earlier default was to keep tests working after templates moved under that folder without reading the config file; auto-detection makes this robust without assumptions.
packages/inquirerer/README.md
Outdated
| | `workspace.license` | License field from `package.json` | `"MIT"` | | ||
| | `workspace.author` | Author name from `package.json` | `"Constructive"` | | ||
| | `workspace.author.name` | Author name from `package.json` | `"Constructive"` | | ||
| | `workspace.author.email` | Author email from `package.json` | `"[email protected]"` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use this as an example:
([email protected])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
Body read .boilerplates.json to pick the default template path (fallback to .) instead of hardcoding default update dev CLI/help text and docs to reflect auto-detected template directory keep repo default pointing at constructive-io/pgpm-boilerplates; tests verified passing after changes
| console.warn( | ||
| `⚠️ Cached template expired (last updated: ${new Date(expiredMetadata.lastUpdated).toLocaleString()})` | ||
| ); | ||
| console.log('Updating cache...'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sdqede please use ' not " — you're changing things that make PRs hard to read, and also it's not our preferred style, please use '' (single quotes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and @sdqede while you're working on this repo, can you also fix all the [email protected] and please change it to [email protected] thanks
…honors CREATE_GEN_TEST_BASE_PATH first, otherwise reads .boilerplates.json for dir, falling back to .
…pp tests add helper to clone/cached repos and read .boilerplates.json for the template base dir, with env override and fallback update CLI and cached-template integration tests to compute fromPath from the resolved base dir instead of hardcoded defaults keeps tests aligned with repo layout changes and avoids path assumptions
Add missing workspace resolvers (workspace.name, workspace.organization.name, workspace.license) and tests; prefer repo slug fallback, document in README.
Update create-gen-app-test to use constructive-io/pgpm-boilerplates on main with default/ base path; refresh integration helpers, CLI/dev defaults, and snapshots for the new template layout.
files/lines that address #380 (workspace resolvers + setFrom defaults): in the packages/inquirerer