How can I build mapbox-gl.js with Browserify? - browserify

If I git clone the repo (from mapbox-gl.js repo), how can I build my own standalone version of the files?
I just need the standalone mapbox-gl.js, like this one.
A simple browserify js/mapbox-gl.js -o dist/mapbox-gl.js does not work.

I just added a section to the mapbox-gl-js readme on this topic.
Creating a Standalone Build
A standalone build allows you to turn the contents of this repository
into mapbox-gl.js and mapbox-gl.css files that can be included on
an html page.
To create a standalone build, run bash npm run production
Once that command finishes, you will have a standalone build at
dist/mapbox-gl.js and dist/mapbox-gl.css
I hope that helps! Let me know if you have any follow-up questions.

To create standalone files, run npm run build in root of repo.

Related

Github pages deploy vue project

I am successfully done deploy to github pages and I have an Active status of deployment. But I can't see my app. And I don't understand what is the promlem:
https://hikkiyarik.github.io/
My repo:https://github.com/HikkiYarik/HikkiYarik.github.io
I solved a problem. We need SSH key for your GitHub account, deploy.sh file and two repos like my repos foodshop and HikkiYarik.github.io.
My GitHub account for example:
https://github.com/HikkiYarik
Look closely at the contents of the file deploy.sh:
<git push -f git#github.com:HikkiYarik/HikkiYarik.github.io.git master:gh-pages>
This means we push our project that was built in the foodshop repo to the HikkiYarik.github.io repo.
By the way, gh-pages branch is created automatically. Script deploy.sh starts running when we write the command:
npm run deploy
For the command to work, just write a package.json file in scripts:
"deploy": "sh deploy.sh"

AppCenter Yarn 1.19 error Incorrect integrity when fetching from the cache

I have a React Native app hosted on Microsoft App center. The builds (both iOS and android) are failing because of yarn 1.19 (error Incorrect integrity when fetching from the cache)
I tried to remove the package-lock.json but it didn't help.
I would like to downgrade yarn or execute the cache clean command but don't know where to execute it.
I have installed the appcenter cli version 2.2.1 and successfully connected to it.
Where could I execute yarn cache clean for example?
I've read I could also create a script but I have no idea where to place it and how it should look like. Should it be both in the ios and android directory? Or in the root? Thank you
I actually noticed that I had a yarn.lock back from the initial commit, even though we are using npm in the team.
In the build logs, there is this line:
/bin/sh -c if [ -f yarn.lock ]; then { yarn install && yarn list --depth=0; } else npm install; fi
So I deleted the yarn.lock file and now it builds successfully using npm!
Not sure whether you build your React app with Azure Devops pipeline. If yes, you can use Command line task to achieve the things you want to do.
If the agent you used is hosted agent during the build, since each build will use a completely new VM, you need to install the AppCenter cli once per build.
Use follow command to install the AppCenter cli:
sudo npm install -g appcenter-cli
Then logging in it:
appcenter login --token {Token}
Here, you need first generate the token with this doc described: Go and login to https://appcenter.ms/ -> Click Self Avatar -> Choose Account Settings -> Click on API Tokens -> Click New API token then select the corresponding the scope for this token.
Copy and use it in this pipeline task. Note: Recommend you store
this token with secret variable for security.
Now, you can execute the clean command: yarn cache clean.
Where to place it and how it should look like?
According to your description, you need place this command line task into the first step, then it could clean the Yarn cache firstly.
Also, because of the image configuration that the hosted agent is using, its installed node.js version is 6.7.0, this does not match the runtime environment for AppCenter cli. You need also run Node.js tool installer task to install node.js v10.0.0.
All of them should look like this:
Should it be both in the ios and android directory?
As I mentioned previously, for Hosted agent, each build will use a completely new VM. So yes, you must execute these two steps firstly in every build.
If what you used is your private agent, since you have installed the AppCenter cli locally, the agent will automatically call the local configuration when running the command line task. At this time, you just need to skip the install command in the command task:
We fixed it by adding a "yarn cache clean" in appcenter-post-clone.sh, you can add this shell script in root of project.
See this docs for details.

Gitlab CI: create dist folder inside repository?

I just recently started using gitlab CI to automate some build/deploy steps. It works perfectly to build docker images etc, but I was wondering if it's possible to create a folder in the repository during a build step? For example I'm now making an npm utility package, but I'm just importing it in my other projects via a private gitlab repo (using deploy token), but the code of the util package is written in es6 and needs to be transpiled to commonJS to be used in the other packages. Manually I can run npm run build and it will output a dist folder with the transpiled code.
I was trying (and researching) if it's possible to automate this build process using .gitlab-ci but so far I couldn't find anything.
Anyone know how I can achieve this and/or if this is possible?
Thanks in advance!
Not sure if I got your question correctly, so add more details if not.
When your CI build creates new folders or files, they are written to the task runner's file system (no surprise here, I assume).
If you want to access these files from Gitlab's web UI you can define them as artifacts in your build job (see https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html)
Your build job would look something like that (pseudo code written by memory, not tested on Gitlab):
build:
script:
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 week
UPDATE If you want to upload the build artifact to an NPM registry, you could just build and push together.
build:
script:
- npm run build
- npm publish <PARAMETERS>

How To Get Started With React Admin On Windows

It is difficult to get started or setup this entire repo in Windows?
Can you please give step by step approach to set this up in Windows or a short video tutorial?
I just ran into this issue. My fix was to:
Delete the react-admin directory if you already have a clone from the repo
Update Node and Yarn
-- After update I am currently running Node v10.13.0 && Yarn v1.12.3
Grab a fresh clone of the repo
Then from the react-admin directory run:
yarn
Once that completes:
yarn build
And finally once that completes:
yarn run-demo
lmk if this works for you :-)
There isn't much. Until we add a Windows section in the README, here's how you can get started:
run yarn to install all dependencies
run yarn run-simple to start the playground app and test your changes
There are more scripts in the root package.json file to run tests, demos, etc.
If you need help with something more specific, please precise it in your question

Vuetify Offline Docs

I have started using Vuetify to add ui-components and use pre-defined layouts. The problem is that I have to look into online-docs every now and then, and requires me to be connected to internet perpetually.
Is there a way to get offline docs for Vuetify? Like an html built with doxygen/javadocs, or a CHM? PDF? LaTEX? Anything really helps.
Update
git clone https://github.com/vuetifyjs/vuetifyjs.com.git has become a private project. The docs are now in the packages/docs/ directory. Instructions have been updated.
You can download the project from the vuetifyjs site repo, install and run locally.
git repo: https://github.com/vuetifyjs/vuetify
The instructions (for vue-cli-2 based project):
cd /tmp/
git clone https://github.com/vuetifyjs/vuetify.git
cd vuetify/packages/docs
yarn
# option 1 - build and serve
yarn build
yarn start
# option 2 - run dev instance
yarn dev
See the docs on how to run the docs.
git clone https://github.com/vuetifyjs/vuetify.git
cd vuetify
yarn
yarn build
yarn dev docs
Then head over to http://localhost:8095/en/getting-started/quick-start
git clone https://github.com/vuetifyjs/vuetify.git
yarn
yarn build
yarn start
http://localhost:8095
download zip from https://github.com/vuetifyjs/vuetify
extract it to any place like i put it in d:\xampp\htdcos\vuetify-master
than open command prompt (cmd) and type this path d:\xampp\htdcos\vuetify-master
run this command yarn here D:\xampp\htdocs\vuetify-master>yarn
than run yarn build here D:\xampp\htdocs\vuetify-master>yarn build
than yarn start here D:\xampp\htdocs\vuetify-master>yarn start
it will start vuetify local docs at 0.0.0.0:8095
now open browser and type http://localhost:8095 and enjoy
node module is required
also install yarn from https://yarnpkg.com/lang/en/docs/install/#windows-stable before running yarn commands and make sure check yarn version in cmd via yarn -v
The Vuetify website allows you to view it offline there by typing its website and pressing enter when not connected to the internet. It works and I do that all the time.