Skip to content

Publish on NPM #5

@alshakero

Description

@alshakero

This issue applies to JSON-Patch-OT, JSON-Patch-Queue, and JSON-Patch-OT-agent.

Because many people rely on these repos and use files in src directly. And because we learned the hard way with fast-json-patch that a Node module that supports TS and ES6 imports and runs in the browser without bundling is buggy (here: Starcounter-Jack/JSON-Patch#140). My preliminary plan is to do the following:

  1. Keep the files in src untouched, logic wise. And emit a warning asking people to use the bundle in dist folder. With the option to use a minified bundle.
  2. Create a new, temporary dir, called newsrc, and put the Node friendly files there. Bundle them with webpack if needed, and put their compiled Browser + Node friendly versions in dist. And also make sure to throw a warning in these files to use dist folder in production. These files shouldn't be used at all except for development. Everything is in dist.

By the time all people start using dist folder, nobody will be using neither src or newsrc. And this will give us the freedom to remove the old files, and rename our new folder to src and live happliy ever after.

WDYT @tomalec @warpech?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions