Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructures src directory and implements RollUpJS #128

Merged
merged 57 commits into from
Aug 12, 2020

Conversation

ahmadayubi
Copy link
Member

Closes #120

Splits the mapml.js file into several files in the following heirarchy:
src
├── mapml
│ ├── handlers
│ │ ├── ContextMenu.js
│ │ └── QueryHandler.js
│ ├── layers
│ │ ├── ControlLayer.js
│ │ ├── FeatureLayer.js
│ │ ├── ImageLayer.js
│ │ ├── MapLayer.js
│ │ ├── StaticTileLayer.js
│ │ ├── TemplatedFeaturesLayer.js
│ │ ├── TemplatedImageLayer.js
│ │ ├── TemplatedLayer.js
│ │ └── TemplatedTileLayer.js
│ ├── utils
│ │ ├── Constants.js
│ │ └── Util.js
│ └── index.js
├── layer.js
├── map-area.js
├── mapml.css
├── mm-mapp.js
└── web-map.js

To build the entire project including mapml.js inside /dist, run the same grunt task as before (grunt / default).

To generate mapml.js only inside of /dist, run grunt / build.
The PR contains 50+ commits that were necessary according to the following link:
Splitting a file while preserving line history

@prushforth
Copy link
Member

Looks pretty good @ahmadayubi ! I noticed a bunch of errors related to playwrite when running npm install. Are you aware of that?

I'll keep playing with it, will let you know if I see anything else.

@prushforth
Copy link
Member

Copyright and license notices be embedded in the output *.js files?? Or perhaps in the LICENSE.md or what. Your thoughts on this.

@ahmadayubi
Copy link
Member Author

@prushforth

I noticed a bunch of errors related to playwrite when running npm install. Are you aware of that?

These are the messages I get:
message

Are they the same as yours?

@prushforth
Copy link
Member

prushforth commented Aug 12, 2020

Are they the same as yours?

Sorry I ran something else and lost them. No they aren't the same. I'll re run and see if it happens again.

@prushforth
Copy link
Member

The same errors didn't happen again, but I get these, which are pretty close. It was related to a zip file of a browser...

npm WARN jest-playwright-preset@0.1.3 requires a peer of jest-environment-node@^25.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

@prushforth
Copy link
Member

I'm deleting my node_modules and starting over.

@ahmadayubi
Copy link
Member Author

Copyright and license notices be embedded in the output *.js files?? Or perhaps in the LICENSE.md or what. Your thoughts on this.

Maybe having it inside of LICENSE.md might be a good option, not sure.

@prushforth
Copy link
Member

Here's what I get on a clean install (no node_modules):

"C:\Program Files\nodejs\npm.cmd" "install"

playwright-core@1.2.1 install C:\Users\prushfor\Documents\GitHub\Web-Map-Custom-Element\node_modules\playwright-core
node install.js

playwright@1.2.1 install C:\Users\prushfor\Documents\GitHub\Web-Map-Custom-Element\node_modules\playwright
node install.js

(node:6984) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, unlink 'C:\Users\prushfor\AppData\Local\Temp\playwright-download-webkit-win64-1301.zip'
(node:6984) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6984) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

more non-critical stuff here.

@prushforth
Copy link
Member

I'll get rid of that file and run it again.

@prushforth
Copy link
Member

All clear, must be an issue with re-installing playwright.

@prushforth prushforth merged commit 749173c into Maps4HTML:master Aug 12, 2020
ahmadayubi added a commit that referenced this pull request Aug 12, 2020
prushforth pushed a commit that referenced this pull request Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate different MapML components to separate files
2 participants