Commit Graph
22 Commits
Author SHA1 Message Date
Robert KiefferandGitHub ac73780f12 docs: update runmd version (#940) 2026-04-26 10:51:56 -10:00
Robert KiefferandGitHub 563f835b7d fix!: make browser exports the default (#901)
Restore browser build as the default in `package.json#exports`
2025-09-08 08:39:50 -10:00
Robert KiefferandGitHub 70d5e0f169 feat!: drop node@16 support (#883) 2025-06-28 10:37:33 -10:00
Robert KiefferandGitHub ef437cb4a8 fix: add TS unit test, pin to [email protected] (#860) 2025-01-09 12:36:11 -10:00
Robert KiefferandGitHub cd2a532539 build: use npm pack tarball for local examples and testing instead of .local (#859) 2025-01-09 11:31:51 -10:00
Robert KiefferandGitHub 4dec60c06e chore: replace optional-dev-dependencies with iodd (#836) 2024-11-04 10:52:05 -10:00
Robert KiefferandGitHub 84a8145fa7 chore: fix remaining issues for v11 release (#789) 2024-09-05 10:41:51 -10:00
Robert KiefferandGitHub ab18c643bd chore: build script updates (#782) 2024-07-24 10:07:16 -10:00
Robert KiefferandGitHub dfc0647660 chore: misc updates to dev and build setup (#781) 2024-07-21 03:54:13 -10:00
Robert KiefferandGitHub c244b0da28 feat!: Port to TypeScript, closes #762 (#763)
Ports all code to Typescript.  TS users should no longer need to install `@types/uuid`.
2024-07-16 07:55:56 -10:00
1e7c9e04e9 Replace broken image in README file (#695)
chore: fix broken readme and npm@9 build process

* Fix broken image for RunMD
* Update runmd package (fixes logo link)
* Fix build script (npm bin -> npx)

Co-authored-by: Robert Kieffer <[email protected]>
2023-03-14 00:32:52 +01:00
Christoph TavanandGitHub b2b4d3be2b feat: remove UMD build (#645)
BREAKING CHANGE: Remove the minified UMD build from the package.

Minified code is hard to audit and since this is a widely used library
it seems more appropriate nowadays to optimize for auditability than to
ship a legacy module format that, at best, serves educational purposes
nowadays.

For production browser use cases, users should be using a bundler. For
educational purposes, today's online sandboxes like replit.com offer
convenient ways to load npm modules, so the use case for UMD through
repos like UNPKG or jsDelivr has largely vanished.

Fixes #620
2022-08-04 07:37:51 +02:00
087c3dd217 fix: add Jest/jsdom compatibility (#642)
Jest runs browser tests in a jsdom environment which now also supports
web crypto polyfills.

Since ESM support in Jest is currently still limited, it requires a
commonJS build for browser environments, see the discussion in
https://github.com/uuidjs/uuid/pull/616 for all the details.

Co-authored-by: Christoph Tavan <[email protected]>
Co-authored-by: Simen Bekkhus <[email protected]>
2022-08-03 11:45:27 +02:00
35b5deccfb chore: run node-esmodule package.json test only in latest node LTS (#621)
While ESM support has been stable in current versions of Node.js 14.x and 16.x, support for importing JSON files is still experimental and evolving.

Since we still want to cover the fact that the package is exporting it's package.json file, this test is now extracted to only run with the updated JSON import syntax which requires import assertions and which was introduced in Node.js 16.14.0.

Fixes #619

Co-authored-by: Robert Kieffer <[email protected]>
2022-03-17 08:42:49 +01:00
Christoph TavanandGitHub 087900678c fix: export package.json required by react-native and bundlers (#449)
It appears that react-native and some bundlers rely on being able to
introspect the package.json file of a npm module. After adding the
`exports` field to package.json, only the paths defined in that field
are accessible to Node.js. In order to support introspection of the
package.json file itself it has to be listed as an export as well (see:
https://github.com/ai/nanoevents/issues/44#issuecomment-602010343).

It is currently being discussed to change Node.js' behavior again, see:
https://github.com/nodejs/node/issues/33460
Until then, adding package.json to the exports field should result in
minimum breakage.

Fixes #444
2020-05-20 09:08:50 +02:00
Christoph TavanandGitHub b4038586b6 test: test imports with npm package contents (#425)
* test: test imports with npm package contents

Especially for publishing CommonJS/ESM/Browser dual packages a lot can
go wrong in the actual build and release step, see:
https://medium.com/javascript-in-plain-english/is-promise-post-mortem-cab807f18dcc

In order to catch regressions with respect to the supported ways of
importing this library it makes sense to test this using `npm pack`.

Fixes #424

* chore: ignore *.tgz files

* build: run build as prepack command

This simplifies using npm pack in CI tests.
2020-04-29 14:35:23 +02:00
Christoph TavanandGitHub cdccadbbd0 fix: clean up esm builds for node and browser (#383)
- add example for usage with node and webpack
- add specific babel config for node esm build
- fix path in native browser esmodule example
2020-02-25 21:16:12 +01:00
Bogdan ChadkinandGitHub db456aa874 fix: provide browser versions independent from module system (#380)
Fixes #378

Currently main field is used for node and module for browser build. This
is not entierly correct. Webpack can be used to build node apps. Though
module is always preferred over main. For browser versions there is a
special field.

In this diff I added esm support for both node and browser.
rollup-plugin-node-resolve look at browser field as well and prefer it
to bundle umd.

https://webpack.js.org/configuration/resolve/#resolvemainfields
https://github.com/rollup/plugins/tree/master/packages/node-resolve#browser
https://github.com/defunctzombie/package-browser-field-spec
2020-02-25 20:57:18 +01:00
Christoph TavanandGitHub 02aa9f4a92 feat: add UMD build to npm package (#357)
Fixes #345.
2020-01-27 23:20:24 +01:00
Christoph Tavan 4a3621e712 build: set up and document build and release scripts
Since we have a build step now we must point the package.json file
reference to the dist folder and must explicitly list all files that we
want to be included in the npm tarball.

The initial idea was to prepare the contents of the final npm tarball
all in the dist directory (including a copy of the package.json) but
that turns out not to work particularly well with standard-version which
is used to manage the version numbers and changelog.

Unfortunately this change also required a small workaround to allow
local installation of the uuid module in the examples (see .local/).

Also instructions for relasing a new version have not yet been
documented which is finally done here.

Since we now explicitly list all files to be included in the tarball
through the files property of package.json we no longer need the
.npmignore file.
2020-01-21 13:29:10 +01:00
Christoph Tavan 8682fba2b4 chore: rename package script to build
"build" seems to be the more appropriate term for what we're doing here.

Part of #343.
2020-01-20 14:31:20 +01:00
Robert KiefferandChristoph Tavan a445895043 feat: hybrid CommonJS & ECMAScript modules build
BREAKING CHANGE: Convert code base to ECMAScript Modules (ESM) and
release CommonJS build for node and ESM build for browser bundlers.
2019-10-25 21:58:26 +02:00