https://teiaviewer.teia-solution.com
You can automatically load a Twin or a File from TeiaTwin when logged in by using url params.
https://teiaviewer.teia-solution.com?projectId=71&fileId=891
The code is a monorepo divided in packages, published to the npm feed, and apps using npm workspaces. Turborepo is used to manage the build dependency.
"@teiaviewer/export-condition".Warning:
Since development is using source code from packages directly, any marked @internal function or property would be accessible to packages using other packages. You should not use these internals. This behavior is not allowed in production build. Thus, result may differ from development and production builds.
package.json imports are used: subpath imports define aliases using #.
To make the development easier to use for developers, there are two custom Node.js export conditions:
@teiaviewer/export-condition — used by consumers of a package (e.g. the demo app). Instead of resolving to the package's dist, it resolves to src directly. This means in dev mode the app gets live source without needing to rebuild packages first@teiaviewer/import-condition — used internally within a package for its own subpath imports. Same idea — resolves to src instead of dist during the package's own build stepThe practical effect is:
src, hot reload works across package boundaries without intermediate buildsdist resolution applies and @internal symbols are properly encapsulatedCustom conditions are declared in tsconfig.json and activated in vite.config.ts of each package and app.
dev -- Starts the development of the demo app
build -- Build packages and apps via turbo
build:apps -- Build only apps (and dependent packages)
build:packages -- Build only packages
build:website -- Build the main page of the demo website using the apps dist
serve -- Will serve the website build
test -- Starts the test via vitest in watch mode
test:coverage -- Run the tests once and gather coverage
i18n:extract -- Extract the i18n translation keys into the locales dict
spell-- Will check source code spelling