abhidas17695 / dweb-ext

0 stars 0 forks source link

Simplify build process #35

Open mitra42 opened 6 years ago

mitra42 commented 6 years ago

I want to suggest that you have a think about the build process, you should be able to put a script in the repo that allows it to be updated. This could possibly be a simple package.json which specifies where the dependencies are and copies them to the dist directory. Instructions could the be as simple as:

Clone the repo
npm install
npm run build

which builds dist directories for both the combo extension and the plain extension.

If you haven't used npm scripts, you can see examples in package.json in both dweb-objects and dweb-transports. You can also use those files as templates (listing yourself as author of course). Make sure to add the License files (use the same ones as used in dweb-transports etc) .

mitra42 commented 6 years ago

Also - in this process add a line to package.json in the scripts section that makes both zips. So its easy to give this extension to someone else to test without them having to clone the repo.

Carefull - because if the zip file itself is in the repo, then it should exclude itself from the zip :-)

abhidas17695 commented 6 years ago

I didn't understand you @mitra42 . Especially your 2nd comment

mitra42 commented 6 years ago

What is unclear in first comment ? Second one was about getting something I could give someone to test, I think it can be ignored as I realized that this wouldnt be a "packed" extension, so I'll just zip up a copy of the cloned directory and send to someone.

abhidas17695 commented 6 years ago

I understood the 1st comment. I have to learn to use npm. I didn't understand

Carefull - because if the zip file itself is in the repo, then it should exclude itself from the zip

abhidas17695 commented 6 years ago

All good now. Thanks

mitra42 commented 6 years ago

Npm is easy at this level, I forget how you install it, but instructions should be widely available (for Windows 10) Basically ... npm install reads package.json, finds the dependencies, and installs them recursively in a directory node_modules. If you look at my examples its hopefully obvious. Ask questions as you need to, and npm is a useful skill to have anyway.

abhidas17695 commented 6 years ago

I get it.

abhidas17695 commented 6 years ago

Check out the latest commit @mitra42 . Please see the instructions in README.md. This process builds the extension with just dweb functionality.

mitra42 commented 6 years ago

Looks ok - but seems overly complicated ? npm update should do what download is doing, i.e. fetch any updated copies of already installed dependencies. So postinstall: cpx dweb-objects/dist/dweb-objects-bundle.js dist/scripts && cpx dweb-transports/dist/dweb-transports-bundle.js dist/scripts update: npm update; npm postinstall and adding to dependencies

dweb-transports: https://github.com/internetarchive/dweb-transports
dweb-transports: https://github.com/internetarchive/dweb-transports

Would be a more standard way to go.

Can you try that and see if it works.

THEN .... when that is working. we should merge this into the combo, add the dependencies on the wayback extension repo, but make it build two directories - dist and dist-combo or something like that.

abhidas17695 commented 6 years ago

If we add dweb-transports: https://github.com/internetarchive/dweb-transports dweb-objects: https://github.com/internetarchive/dweb-objects to dependencies then npm starts downloading the dependencies for dweb-transports and dweb-objects all in node_modules of the root folder. It seems better to install dependencies of dweb-transports and dweb-objects separately if and when required.

mitra42 commented 6 years ago

Ok Then part 2 - a combined build process, that builds both extensions....

abhidas17695 commented 6 years ago

I am working on it

abhidas17695 commented 6 years ago

See #38

mitra42 commented 6 years ago

I think this is done? If so, you can close it.