Example repository about how to set up yarn monorepo with application and packages using typescript.
To start lets install all the dependencies and build the source
yarn
yarn buildYou are now good to go
When accessing .ts or .svelte files VS code asks you to allow typescript version from workspace.
You need to set VScode setting:
{
"svelte.language-server.ls-path": ".yarn/sdks/svelte-language-server/bin/server.js"
}Initialize yarn project
yarn init -2Setting up workspaces by adding following to package.json
{
"private": true,
"workspaces": [
"applications/*",
"packages/*"
]
}Create an application my-api and package logger
mkdir applications/my-api
mkdir packages/logger
cd applications/my-api
yarn init
cd ..
cd packages/logger
yarn initConfiguring typescript for the project for VScode editor. https://yarnpkg.com/getting-started/editor-sdks#vscode
yarn add -D typescript
yarn dlx @yarnpkg/sdks vscode
yarn plugin import typescriptCannot use eslint 8 until this issue is fixed yarnpkg/berry#3578
IMPORTANT After you add library to root that is used by VScode editor you need to execute yarn dlx @yarnpkg/sdks vscode command
https://yarnpkg.com/getting-started/editor-sdks#editor-setup
Implementing constraints.
yarn plugin import constraints
Constraints can be found from constraints.pro