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

tsconfig alias-support-documentation (PR from TinaCMS) #2647

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tina-cloud-app[bot]
Copy link
Contributor

@tina-cloud-app tina-cloud-app bot commented Dec 20, 2024

This documentation pr is related to new support feature

PR in tinacms
Related issue

Co-authored-by: Ben Neoh <[email protected]>
Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tina-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 4:44am

@@ -55,4 +55,39 @@ export default defineConfig({
```

In this example, the TinaCMS admin will be viewable at `<my-site-url>/admin/index.html`.
For more information [check out the content modeling section](/docs/schema/).
For more information [check out the content modeling section](/docs/schema/).\
\
Copy link
Member

Choose a reason for hiding this comment

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

question: Why are the backslashes required?


## Typescript Path Alias

TinaCMS supports typeScript path aliases in the tina.config.js file and collections, making it easier to organize and maintain your code.
Copy link
Member

@ncn-ssw ncn-ssw Dec 24, 2024

Choose a reason for hiding this comment

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

typo:

Suggested change
TinaCMS supports typeScript path aliases in the tina.config.js file and collections, making it easier to organize and maintain your code.
TinaCMS supports TypeScript path aliases in the `tina.config.js` file and collections, making it easier to organize and maintain your code.


##### Use alias in config.ts

Ensure that tsconfig.json exists at the root of your project. Define your aliases in the compilerOptions section:
Copy link
Member

Choose a reason for hiding this comment

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

consistency: The introductory paragraph has the files and in-code declaration formatted as in-line code.

Suggested change
Ensure that tsconfig.json exists at the root of your project. Define your aliases in the compilerOptions section:
Ensure that `tsconfig.json` exists at the root of your project. Define your aliases in the `compilerOptions` section:

}
```

Figure: Your defined tsconfig.json
Copy link
Member

Choose a reason for hiding this comment

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

consistency: As described above:

Suggested change
Figure: Your defined tsconfig.json
Figure: Your defined `tsconfig.json`

})
```

Figure: Using aliases in tina config.ts
Copy link
Member

Choose a reason for hiding this comment

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

consistency: As described above:

Suggested change
Figure: Using aliases in tina config.ts
Figure: Using aliases in tina `config.ts`

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.

1 participant