garronej / ts-ci

🚀 A project starter for module publisher
MIT License
349 stars 20 forks source link

ASSETS #1

Closed garronej closed 4 years ago

garronej commented 4 years ago

ts_ci

garronej commented 4 years ago

Screenshot 2020-05-16 at 12 04 25

garronej commented 4 years ago

Watch the video

garronej commented 4 years ago

Screenshot 2020-05-16 at 12 21 04

garronej commented 4 years ago

serve php

garronej commented 4 years ago

image

garronej commented 4 years ago

image

garronej commented 4 years ago

npmjs com

garronej commented 3 years ago

image

garronej commented 3 years ago

82094662-cd17c200-96fd-11ea-8645-808344bad951

garronej commented 3 years ago

82094662-cd17c200-96fd-11ea-8645-808344bad951

garronej commented 3 years ago

82094662-cd17c200-96fd-11ea-8645-808344bad951

garronej commented 3 years ago

image

garronej commented 3 years ago

image

garronej commented 3 years ago

image

garronej commented 3 years ago

image

garronej commented 3 years ago

ts-ci

garronej commented 2 years ago

image

garronej commented 1 year ago

Use project reference to compiles your script in CJS and the rest of your lib in ESM. It's the strategy implemented by keycloakify and react-dsfr.

garronej commented 1 year ago

Confused notes about module publishing:

If you don't have any dependencies or it's not important if your dependency are duplicated or you dependencies are only released in CJS and you are not levraging import().then(..):
Release in CJS + ESModule interop.
And you don't use export default.
Example: https://github.com/garronej/evt

If your module has no scripts (you do not expose CLI tools) and you don't care about suporting node in type: module mode (MUI dosen't). It's OK for a react library for example. You can just release in ESM (just by setting target ES6)
If you opt for this option you must tell JEST to transpile your package https://react-dsfr.etalab.studio/ Example: https://github.com/InseeFrLab/onyxia-ui
(If you pulblish scripts you can have src/bin transpiled in CJS and the rest transpiled in ESM, remember that files transpiled in ESM will be able to import files transpiled in CJS but not the other way around. Example: react-dsfr, keycloakify)

You want to support every environement including node in "type: module" and you have dependencies that release both in EJS and ESM that can't be duplicated but you don't use export default.
Publish in both ESM (for bundlers) and CJS Intercompat (For node). List your exports.
Example: TSS React

If you are in the previous case AND you use export default. Then it's you must list your export like exports: { "..":{ "module" -> ESM "import": -> an .mjs file in ESM format that rexport everything from your CJS distribution, including the default. Emotion does this "default": -> CJS ESMInterop } } I don't have example because I don't have to do it.

Now if you want that, on node async import work as well then you have to publish a Real ESM distribution standard compliant. This is only possible if all your dependencies publish ESM distribution compatiblie with node and it increase the likelyood dual package hasard.

If your package need async features