Code Monkey home page Code Monkey logo

color-code's Introduction

Requirements

Getting started

Clone the repository

git clone [email protected]:backtolife2021/color-code.git
# or git clone https://github.com/backtolife2021/color-code.git

Switch to the repo folder

cd color-code

Install dependencies (If you are blocked by GFW, please read the QA section)

yarn install

Runs the app in the development mode

yarn start
# or yarn serve
# or yarn dev

Use chrome broswer open the development server link

google-chrome-stable http://localhost:8124/dev.user.js # in archlinux
chrome http://localhost:8124/dev.user.js # in windows via scoop

Devlopement

how to open the setting page?

how to open the setting page

the setting page prototype

See the Pen Syntax highlighting Setting Page prototype by doublethink (@FloatingShuYin) on CodePen.

<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>

Bundle

Bundle everything from src/ into dist/bundle.user.js:

yarn build

or

npx rollup --config

Development server

yarn serve

This will automatically update dist/bundle.user.js when code changes and serve it on localhost:8124.

It also creates a second userscript dist/dev.user.js, if you install it in Tampermonkey, it will automatically fetch the latest version from http://localhost:8124/bundle.user.js once you reload a website with F5.

Bundle without source map

Bundle for publishing without sourcemapping to dist/release-3.2.1.user.js

yarn build:release

or on Windows

yarn build:release:win32

Note: If you have added these plugins to your editor, you rarely need to manually execute any of the above code specification related commands.

Enhance your development experience

The vscode editor extensions listed below can enhance your development experience, and other editors should have similar plugins.

Learn More

There are a lot of link comments in the source code, if you do not understand the code, you might as well click the link in the comments to see!

QA

Q: yarn upgrade does not update package.json

A: ref yarnpkg/yarn#2042

yarn global add npm-check-updates
ncu -u
yarn install --check-files
ncu -u

Q: What to do if the dependencies cannot be downloaded due to network problems

A: ref https://npm.taobao.org/mirrors

First execute the following command to add the mirror, and then use yarn install to download the dependencies

yarn config set registry https://registry.npm.taobao.org -g
yarn config set disturl https://npm.taobao.org/dist -g
yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -g
yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g
yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -g

if it still does not work, you can try to use yarn --ignore-optional to skip the download of optional dependencies

power by rollup-userscript-template

color-code's People

Contributors

i-want-tobelieve avatar

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.