Repository navigation
Conversation
…x, and drop regex+u
…by default, and warn on $1 under n
…ped runs in the tests
…d the $1 warning, and fix [(?>]\1
…re of the CommonJS build, not the path of the build
…-js code has no $1 under n
…mment also runs the code per match
…w of --debug in line with its help
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #862
Stacked on #861.
Change
"type": "module"), and the CLI is built as one. Soregex,regex/internalsandregex-utilitiesare imported when RexReplace runs, as normal dependencies, and are no longer bundled in. Only the subroutines of Regex+ stay copied insrc/libs, as they are not exported.dist/engine.jsanddist/engine.cjs, with anexportsmap. Soimport {engine} from 'rexreplace'andrequire('rexreplace')both work. Before,mainpointed tosrc/engine.js, which does not exist.requireandr()in--jscode come fromcreateRequire()in the ES module builds, as an ES module has norequire, and fromrequirein the CommonJS build, as Bun fixesimport.meta.urlthere to the path of the build machine. They find modules as before.createRequire(), as CommonJS, as its ES module breaks the lines of the help in the middle of words, which would also reach the option table of the README.npm/sync-version.jsisnpm/sync-version.cjs, as it is CommonJS.exportsalso has./bin/*, so therexreplace-bunpackage can still load the CLI of Bun.Tests
yarn test-cipasses, with the CLI tests on Node and on Bun, which install the package. By hand: an atomic group,require("path")andr("os")in--jscode on Node and on Bun,-v,-hand an unknown flag, and the engine from an installed package withrequire('rexreplace')and withimport.After the review of 28 October
dist/engine.cjshas no path of the build machine, sorequire()in--jscode finds packages throughrequire('rexreplace')on any machine. Checked from an installed package withrequire("regex"), throughrequireandimport.From the code review of #855
At the end of the train, as #860 and #861 change the same lines:
a_, wins over the space cousin ofain any order: the cousins are set first, the groups after.nonly the--jscode has no$1, while a replacement text still reads$1as the first named group. The same line of the README is in Add the rr object, pad() and print() to --js to close #856 #861, which changes that row too.