Skip to content

Conversation

@sdqede
Copy link
Contributor

@sdqede sdqede commented Dec 16, 2025

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

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
@sdqede sdqede self-assigned this Dec 16, 2025
- `--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`)
Copy link
Contributor

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?

Copy link
Contributor Author

@sdqede sdqede Dec 16, 2025

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";
Copy link
Contributor

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.

Copy link
Contributor Author

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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again this should be .

Copy link
Contributor Author

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";
Copy link
Contributor

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

Copy link
Contributor Author

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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Contributor Author

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.

| `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]"` |
Copy link
Contributor

@pyramation pyramation Dec 16, 2025

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])

Copy link
Contributor Author

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...');
Copy link
Contributor

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)

Copy link
Contributor

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
@pyramation pyramation merged commit 0084b61 into main Dec 17, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants