Documentation - v19.5.0-dev
    Preparing search index...

    Documentation - v19.5.0-dev

    TeiaViewer

    Lines of Code Duplicated Lines (%) Coverage Code Smells Vulnerabilities Bugs

    https://teiaviewer.teia-solution.com

    You can automatically load a Twin or a File from TeiaTwin when logged in by using url params.

    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.

    • For production builds, packages are built in dependency order and their dist is used in further build steps
    • For development, the demo app directly use the source code from packages using the custom export condition "@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 step

    The practical effect is:

    • In dev: everything resolves to src, hot reload works across package boundaries without intermediate builds
    • In production: the conditions aren't active, so normal dist resolution applies and @internal symbols are properly encapsulated

    Custom 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