Index: gc_lang/fr/build.py ================================================================== --- gc_lang/fr/build.py +++ gc_lang/fr/build.py @@ -1,8 +1,9 @@ # Builder for French language import os +import subprocess import platform import zipfile from distutils import dir_util, file_util import helpers @@ -89,8 +90,20 @@ if not os.path.isdir(spLangPack+"/"+sf): hZip.write(spLangPack+"/"+sf, sAddPath+spLangPack+"/"+sf) def createNodeJSPackage (sLang): + print("Building for NodeJS") helpers.createCleanFolder("_build/nodejs/"+sLang) dir_util.copy_tree("gc_lang/"+sLang+"/nodejs/", "_build/nodejs/"+sLang) dir_util.copy_tree("grammalecte-js", "_build/nodejs/"+sLang+"/core/grammalecte") + corePack = "" + cliPack = "" + with helpers.cd("_build/nodejs/"+sLang): + corePack = subprocess.check_output("npm pack ./core", shell=True) + with helpers.cd("_build/nodejs/"+sLang+"/cli"): + subprocess.check_output("npm --no-save install ../"+corePack.decode("utf-8").split('\n', 1)[0], shell=True) + with helpers.cd("_build/nodejs/"+sLang): + cliPack = subprocess.check_output("npm pack ./cli", shell=True) + print("Fichiers à distribuer:") + print(" pour le dev: "+corePack.decode("utf-8").split('\n', 1)[0]) + print(" pour une installation du client: "+cliPack.decode("utf-8").split('\n', 1)[0]) Index: gc_lang/fr/nodejs/cli/package.json ================================================================== --- gc_lang/fr/nodejs/cli/package.json +++ gc_lang/fr/nodejs/cli/package.json @@ -7,12 +7,16 @@ "french", "grammar", "proofreader" ], "author": "Sébastien GRAVIER, Olivier R.", - "license": "GPL-3.0-or-later", + "license": "GPL-3.0", "homepage": "https://www.dicollecte.org/", + "repository": { + "type" : "fossil", + "url" : "http://212.47.254.152:8080/index" + }, "bin": { "gramma-cli": "bin/gramma-cli.js" }, "engines": { "node": ">=9.0.0" @@ -21,12 +25,15 @@ "test": "node bin/gramma-cli.js" }, "dependencies": { "grammalecte": "~1.0.0" }, + "bundledDependencies": [ + "grammalecte" + ], "files": [ "bin", "lib", "data", "readme.md" ] } Index: gc_lang/fr/nodejs/core/package.json ================================================================== --- gc_lang/fr/nodejs/core/package.json +++ gc_lang/fr/nodejs/core/package.json @@ -6,15 +6,19 @@ "french", "grammar", "proofreader" ], "author": "Olivier R.", - "license": "GPL-3.0-or-later", + "license": "GPL-3.0", "homepage": "https://www.dicollecte.org/", + "repository": { + "type" : "fossil", + "url" : "http://212.47.254.152:8080/index" + }, "main": "api.js", "engines": { "node": ">=9.0.0" }, "scripts": { "test": "echo \"Error: no test specified\"" } }