Skip to content

Files

Latest commit

author
Sacha Greif
Feb 17, 2025
4d9def2 · Feb 17, 2025

History

History

shared

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 11, 2024
Nov 30, 2024
Sep 8, 2022
Dec 17, 2024
Dec 14, 2024
Feb 17, 2025
Dec 5, 2023
May 4, 2023
Feb 17, 2025
Sep 25, 2024
Jan 25, 2023
Dec 27, 2024
Jan 16, 2025
Mar 15, 2023
Mar 15, 2023
Sep 8, 2022

Shared modules

Packages written in typescript

It's ok to use "index.ts" as the "main" of your shared code package.json.

Good news, this means you don't need a build step at package level!

But you expect the app that will consume the package to have TypeScript properly setup. This is similar to Deno setup for instance, and avoids the "double-bundle" issue: bundling code that you know will be re-bundled anyway by the application.

If you really need TypeScript, just setup your build system properly. Vulcan NPM provides good example of complex full-stack packages.

Use the package

Use PNPM workspace convention: "@devographics/encrypt-email: "workspace:*" will load this package from the shared folder.

Create a new package

Create a new folder in "shared", run "pnpm init", change the package.json as you need (namely replace "main": "index.js" by index.ts or setup typescript).