Skip to content
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

[DOCS] Inconsistent monorepo const name #658

Closed
JoshuaToth opened this issue Nov 22, 2023 · 3 comments
Closed

[DOCS] Inconsistent monorepo const name #658

JoshuaToth opened this issue Nov 22, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation needs-triage

Comments

@JoshuaToth
Copy link
Contributor

Describe the issue

When vending a new project for typescript via:

pdk new --package-manager=pnpm monorepo-ts

You are vended the project as:

import { javascript } from "projen";
import { monorepo } from "@aws/pdk";
const project = new monorepo.MonorepoTsProject({
  devDeps: ["@aws/pdk"],
  name: "nib",
  packageManager: javascript.NodePackageManager.PNPM,
  projenrcTs: true,
});
project.synth();

With const project as the monorepo name. And monorepo being an import from the @aws/pdk project.

Discrepancy

In the documentation for many pages, the const monorepo is used as the name (or expected to be used)

i.e

const website = new CloudscapeReactTsWebsiteProject({
    parent: monorepo,
    outdir: "packages/website",
    name: "website",
    typeSafeApi: api,
});

Which may lead to some confusion. Particularly since monorepo is already imported by the generation.

This is also apparent on the Your first AWS PDK Project page where there is an example of the code generated in an IDE and then the code example further down swaps from project to monorepo :

image image

Links

https://aws.github.io/aws-pdk/getting_started/your_first_aws_pdk_project.html

https://aws.github.io/aws-pdk/developer_guides/cloudscape-react-ts-website/index.html

https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html

Pretty much wherever there is code snippets it's different to the generated code.

@JoshuaToth JoshuaToth added documentation Improvements or additions to documentation needs-triage labels Nov 22, 2023
@agdimech
Copy link
Contributor

Hi Josh,

Thanks for your feedback.

Unfortunately projen's codegen is a little primitive and doesn't allow renaming variables so it defaults to project. We rename the variable from project -> monorepo for better readability as project is a little vague. This is actually noted as an inline comment within the Type-Safe API snippet you posted above. Do you have a suggestion on how this could be made clearer?

@JoshuaToth
Copy link
Contributor Author

Ah, shame about the limitation, no particular suggestions if that can't be changed.

@agdimech
Copy link
Contributor

Happy to close this issue then @JoshuaToth ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants