Skip to content

Commit

Permalink
Merge pull request #10 in LFOR/lforms-updater from remove_dynamic_req…
Browse files Browse the repository at this point in the history
…uire to master

* commit 'b11542ffa35b1ee19db63bb1641cc7c93c0d114a':
  Updated source map file
  restored deleted comment
  Updated mocha per npm audit; npm audit fix again
  Set version to 29.0.2 and updated the change log; npm audit fix
  Removed dynamic export
  • Loading branch information
plynchnlm committed Nov 3, 2021
2 parents 44a7c74 + b11542f commit 971bd2a
Show file tree
Hide file tree
Showing 8 changed files with 464 additions and 368 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This project follows [Semantic Versioning](http://semver.org/).

## [29.0.2] 2021-11-03
### Fixed
- Removed the dynamicly generated require statements, which caused issues with
parceljs.

## [29.0.1] 2021-05-17
### Fixed
- Corrected the version of the lforms peer-dependency.
Expand Down
2 changes: 1 addition & 1 deletion browser/updater.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion browser/updater.js.map

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions buildVersionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
// This should be run as part of the build.
const fs=require('fs');
const semverRevSort = require('semver/functions/rsort');
const versionNums = fs.readdirSync('source/versionUpdates').map(
(f)=>f.slice(0, -3)); // remove .js exension
fs.writeFileSync('source/versionList.json',
'["'+ semverRevSort(
fs.readdirSync('source/versionUpdates').map(
(f)=>f.slice(0, -3) // remove .js exension
)).join('","')+'"]');
'["'+ semverRevSort(versionNums).join('","')+'"]');

// Also create an file that requires each of the update files, to avoid dynamic
// imports.
let updateFnCode = "module.exports = {};\n";
versionNums.forEach(num => {
updateFnCode += "module.exports['"+num+"'] = require('./versionUpdates/"+num+".js');\n";
});
fs.writeFileSync('source/updateFns.js', updateFnCode);
Loading

0 comments on commit 971bd2a

Please sign in to comment.