Refactor project to use ES modules and update related scripts

This commit is contained in:
Eli Kogan-Wang 2025-03-17 16:01:15 +01:00
parent 154653523c
commit 62201022ab
8 changed files with 8 additions and 7 deletions

View File

@ -62,7 +62,7 @@ export default [
} }
}, },
{ {
files: ["po/po2js", "po/xgettext-html"], files: ["po/po2js.cjs", "po/xgettext-html.cjs"],
languageOptions: { languageOptions: {
globals: { globals: {
...globals.node, ...globals.node,

View File

@ -3,6 +3,7 @@
"version": "1.6.0", "version": "1.6.0",
"description": "An HTML5 VNC client", "description": "An HTML5 VNC client",
"browser": "lib/rfb", "browser": "lib/rfb",
"type": "module",
"directories": { "directories": {
"lib": "lib", "lib": "lib",
"doc": "docs", "doc": "docs",
@ -17,9 +18,9 @@
"docs/LICENSE*" "docs/LICENSE*"
], ],
"scripts": { "scripts": {
"lint": "eslint app core po/po2js po/xgettext-html tests utils", "lint": "eslint app core po/po2js.cjs po/xgettext-html.cjs tests utils",
"test": "karma start karma.conf.js", "test": "karma start karma.conf.cjs",
"prepublish": "node ./utils/convert.js --clean" "prepare": "node ./utils/convert.cjs --clean"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -15,7 +15,7 @@ update-js: $(JSONFILES)
%.po: FORCE %.po: FORCE
msgmerge --update --lang=$* $@ noVNC.pot msgmerge --update --lang=$* $@ noVNC.pot
../app/locale/%.json: FORCE ../app/locale/%.json: FORCE
./po2js $*.po $@ ./po2js.cjs $*.po $@
update-pot: update-pot:
xgettext --output=noVNC.js.pot \ xgettext --output=noVNC.js.pot \
@ -29,7 +29,7 @@ update-pot:
../app/*.js \ ../app/*.js \
../core/*.js \ ../core/*.js \
../core/input/*.js ../core/input/*.js
./xgettext-html --output=noVNC.html.pot \ ./xgettext-html.cjs --output=noVNC.html.pot \
../vnc.html ../vnc.html
msgcat --output-file=noVNC.pot \ msgcat --output-file=noVNC.pot \
--sort-by-file noVNC.js.pot noVNC.html.pot --sort-by-file noVNC.js.pot noVNC.html.pot

View File

@ -64,7 +64,7 @@ function makeLibFiles(sourceMaps) {
plugins: [], plugins: [],
presets: [ presets: [
[ '@babel/preset-env', [ '@babel/preset-env',
{ modules: 'commonjs' } ] { modules: false } ]
], ],
ast: false, ast: false,
sourceMaps: sourceMaps, sourceMaps: sourceMaps,