diff --git a/README.md b/README.md new file mode 100644 index 00000000..b330cb8b --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# eCorpus + +## Description + +This is the code repository for **eCorpus**, a content management system by the [eThesaurus](https://ethesaurus.holusion.com) consortium. + +## Repository structure + +The repository uses recursive [submodules](https://git-scm.com/docs/gitsubmodules), because the upstream [DPO-Voyager](https://github.com/) uses them. + +It means some commands will need to be run with the `--recurse-submodules` flag, or you will need to run `git submodule update --init --recursive` after cloning the repository. + +eg: `git clone --recurse-submodules git@github.com:Holusion/eCorpus` + +Day-to-day operations can be simplified by configuring git (globally or for thsi repository) to always recurse by default : `git config submodule.recurse true`. + diff --git a/package.json b/package.json index 2542e067..f15f79bd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "test": "echo \"Error: no test specified\" && exit 1", "build-ui": "cd source/ui && webpack --mode=production", "build-server": "tsc -b source/server", - "build-voyager": "cd source/voyager/source/client; webpack --mode=production --env=app=all", "watch": "cd source/server && HOT_RELOAD=1 NODE_ENV=development ROOT_DIR=\"../../\" nodemon -e ts,js -w . -w ../ui/webpack.config.js -x ts-node index.ts" }, "author": "Holusion ", diff --git a/source/server/templates/explorer.hbs b/source/server/templates/explorer.hbs index 8455e2e1..c9d588bd 100644 --- a/source/server/templates/explorer.hbs +++ b/source/server/templates/explorer.hbs @@ -1,3 +1,3 @@ - + diff --git a/source/server/templates/story.hbs b/source/server/templates/story.hbs index 0368a21b..bca3d94c 100644 --- a/source/server/templates/story.hbs +++ b/source/server/templates/story.hbs @@ -1,4 +1,4 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/source/ui/corpus.hbs b/source/ui/corpus.hbs deleted file mode 100644 index 9458c48b..00000000 --- a/source/ui/corpus.hbs +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - {{title}} - - - - - - - {{{element}}} - - \ No newline at end of file diff --git a/source/ui/story.hbs b/source/ui/story.hbs deleted file mode 100644 index 69ba1634..00000000 --- a/source/ui/story.hbs +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - {{title}} - - - - - - - {{#if isDevelopment}} - - {{else}} - - {{/if}} - - - - - - {{{element}}} - - \ No newline at end of file diff --git a/source/ui/webpack.config.js b/source/ui/webpack.config.js index e1a38d82..6194f5b5 100644 --- a/source/ui/webpack.config.js +++ b/source/ui/webpack.config.js @@ -42,16 +42,16 @@ const dirs = { assets: path.resolve( project, "source/ui/assets"), }; +const createVoyagerConfig = require(path.join(project, "source/voyager/source/client/webpack.config.js")); //////////////////////////////////////////////////////////////////////////////// -module.exports = function createAppConfig(env, argv) +module.exports = function createAppConfig(env, argv={}) { const isDevMode = (typeof argv?.mode !== "undefined") ? argv.mode !== "production" : process.env["NODE_ENV"] !== "production"; const devMode = isDevMode ? "development" : "production"; - const config = { mode: devMode, cache: {type: "filesystem"}, @@ -64,7 +64,7 @@ module.exports = function createAppConfig(env, argv) filename: "js/[name].js", publicPath: '/', - clean: true, + clean: false, }, resolve: { @@ -161,5 +161,28 @@ module.exports = function createAppConfig(env, argv) config.devtool = "source-map"; } - return config; + const voyagerConfig = createVoyagerConfig({app: "all"}, argv); + /******************************** + * Override voyagerConfig's options + ********************************/ + + //Always use the same file name + Object.assign(voyagerConfig.output, { + clean: false, + filename: "js/[name].js", + }); + + //Remove HTML exports + voyagerConfig.plugins = voyagerConfig.plugins.filter(p=>p.constructor?.name !="HtmlWebpackPlugin"); + //Remove Copy Plugin + voyagerConfig.plugins = voyagerConfig.plugins.filter(p=>p.constructor?.name !="CopyPlugin"); + + const cssPlugin = voyagerConfig.plugins.find(p=>p.constructor?.name =="MiniCssExtractPlugin"); + if(!cssPlugin) throw new Error("MiniCssExtractPlugin not found in voyagerConfig.plugins"); + Object.assign(cssPlugin.options, { + filename: "css/[name].css", + chunkFilename: "css/[name].css", + }); + + return [config, voyagerConfig]; }