Giter Site home page Giter Site logo

mapstore-project's Introduction

Scripts to manage MapStore projects

The @mapstore/project packages contains all the needed files and script to create and run a MapStore project

Create a new project

npx @mapstore/project create {project-type}

Available MapStore project types:

Required tools

  • node v12.18.4
  • npm v6.14.6

mapstore-project's People

Contributors

allyoucanmap avatar davidquartz avatar mbarto avatar mv88 avatar offtherailz avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapstore-project's Issues

Issues with dev mode

Creating a project and linking MapStore (with file:<path-to-mapstore> or with npm link) I have the following error running npm start. Customized a little, but I don't think it is the problem.

I have this problem on linux.

Build Entries:
- Apps: {
    "js/mapstore": "./js/apps/mapstore.jsx"
}
- HTML: {
    "index.html": "./html/index.ejs"
}
- Themes: {
    "themes/default": "./themes/default/theme.less"
}

9% setup compilation LoaderOptionsPlugin[webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (/home/offtherailz/work/projects/MapStore2/node_modules/webpack/lib/NormalModule.js:171:10)
    at /home/offtherailz/work/projects/MapStore2/node_modules/webpack/lib/LoaderOptionsPlugin.js:43:17
    at Hook.eval [as call] (eval at create (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:198:1)
    at Hook.CALL_DELEGATE [as _call] (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Compiler.js:943:26)
    at /home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Compiler.js:984:29
    at Hook.eval [as callAsync] (eval at create (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Compiler.js:979:28)
    at /home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Watching.js:112:19
    at Hook.eval [as callAsync] (eval at create (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:34:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at run (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Watching.js:66:33)
    at Watching._go (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Watching.js:123:4)
    at /home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Watching.js:57:9
    at Compiler.readRecords (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Compiler.js:821:11)
    at new Watching (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Watching.js:54:17)
    at Compiler.watch (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack/lib/Compiler.js:362:19)
    at wdm (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack-dev-middleware/index.js:41:33)
    at Server.setupDevMiddleware (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack-dev-server/lib/Server.js:207:23)
    at new Server (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/webpack-dev-server/lib/Server.js:118:10)
    at Object.startDevServer [as default] (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/@webpack-cli/serve/lib/startDevServer.js:92:24)
child_process.js:679
    throw err;
    ^

Error: Command failed: /home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/.bin/webpack serve --progress --color --port 8081 --hot --inline --config /home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/@mapstore/project/types/standard/config/webpack.config.js
    at checkExecSyncError (child_process.js:640:11)
    at Object.execSync (child_process.js:676:15)
    at Object.<anonymous> (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/@mapstore/project/scripts/start.js:23:6)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  status: 2,
  signal: null,
  output: [ null, null, null ],
  pid: 192292,
  stdout: null,
  stderr: null
}
child_process.js:679
    throw err;
    ^

Error: Command failed: node /home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/@mapstore/project/scripts/start.js --type=standard
    at checkExecSyncError (child_process.js:640:11)
    at Object.execSync (child_process.js:676:15)
    at Object.<anonymous> (/home/offtherailz/work/projects/emsa/emsa-cgd-fe/node_modules/@mapstore/project/bin/mapstore-project.js:28:10)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 192284,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `mapstore-project start standard`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/offtherailz/.npm/_logs/2021-06-09T15_07_49_729Z-debug.log

Caused by a duplication of webpack instances, solving is not trivial.

Issue with paths training slashes

The chunks path introduces double slashes in paths (js//). This causes issues for servers that do not collapse double slashes (or not configured to do it by default, like nginx.
So on these projects you may find issues like this:

Schermata del 2023-09-15 12-23-56

Share common paths

We should centralize common paths in a single file to improve maintainability
eg: appDirectory, mapStorePath, frameworkPath, projectPath, ...

Is the `geonode` project type maintained?

Hi,

trying to set up a customized mapstore for Geonode I thought I might be able to keep it DRY by using this with the geonode type. The following tells me I might be chasing a dead end:

  • hard to figure out which version of this project (1.0.7) still provides a compatible webpack config for mapstore (v2021.01.03) - (should not specify master as a valid dependency version in package.json!)
  • imports in the theme.less files are still wrong after create
  • starting in dev mode blows up with react errors
  • only standard is listed in the README

If geonode project type is not maintained, please remove the dead code. And would be wonderful to document how to properly customize a current mapstore with current geonode. Happy to help!

Cheers,
Christian

npm 6.14.15 doesn't support branch for dependencies

c105-cgd works using 6.14.13 , doesn't work using npm 6.14.15

"dependencies": {
    "mapstore": "git+https://github.com/geosolutions-it/MapStore2.git#c105-cgd",
    "leaflet-rotatedmarker": "0.2.0",
    "react-checkbox-tree": "^1.7.1"
  },

Tested by @sycured on CI servers.
Need to check if it is a regression of npm or a change of API.

Build fails if spaces in path

notified by @sycured

Running a mapstore-project 's buid.sh in a directory with "spaces" in absolute path.

nvm install 14 && nvm use 14
cd mapstore/cgd-fe && ./build.sh

has the following error.

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module '/var/lib/jenkins/workspace/EMSA'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
child_process.js:866
    throw err;
    ^

Error: Command failed: node /var/lib/jenkins/workspace/EMSA CGD MAPSTORE WAR/mapstore/cgd-fe/node_modules/@mapstore/project/scripts/compile.js --type=standard
    at checkExecSyncError (child_process.js:790:11)
    at Object.execSync (child_process.js:863:15)
    at Object.<anonymous> (/var/lib/jenkins/workspace/EMSA CGD MAPSTORE WAR/mapstore/cgd-fe/node_modules/@mapstore/project/bin/mapstore-project.js:28:10)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 38343,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] compile: `mapstore-project compile standard`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/.npm/_logs/2021-10-08T11_53_05_459Z-debug.log
Build step 'Execute shell' marked build as failure
Archiving artifacts
Finished: FAILURE

The issue is due to whitespace in folder name

hashed names not generated for main entries - Investigate to use hashes by default

When creating entries, to avoid cache issues, by default, where not specified in a different way, we should use cache.

const apps = readEntriesPaths(appsPaths, ({ dirName, baseName, entryName }) => ({

In html template instead, we could use something like html-webpack-injector-plugin to simplify the injection of the correct entry (chunk), automatically using the correct (hashed) file-name

I should instead ask to specify the file-name in config, if one specific name is required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.