Giter Club home page Giter Club logo

apcach's People

Contributors

ai avatar antiflasher avatar eugeno avatar ins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

apcach's Issues

Add ESM to package.json

You are using import. But by default Node.js is using old require(). To switch the mode to ESM you need to add "type": "module" to package.json.

Also, we can explicitly mark what library exports by adding:

  "exports": {
    ".": "./index.js",
    "./package.json": "./package.json"
  },

It tells to Node.js that if user write import * from 'apcach', this 'apcach' should be replaced to ./node_modules/apcach/index.js.

Add `clean-publish` for npm release

It is opinionated, but I prefer to clean dev configs from package.json before releasing to npm.

This is why I release with clean-publish.

pnpm add --save-dev clean-publish

And for release I write:

pnpm clean-publish

Rename main file from `apcach.js` to `index.js`

In npm, there is a conversion of calling the main file as index.js. For instance, culori use it.

You can key apcach.js name as well, but in this case you need to set main field to package.json to explain to npm where is your main file.

  "main": "./apcach.js",

Move dependencies from CDN to npm

Since we are planning to release it to npm we need to move the dependencies (culori) to npm as well.

  1. Call pnpm add culori https://cdn.skypack.dev/apca-w3
  2. Replace imports from import { calcAPCA } from "https://cdn.skypack.dev/apca-w3" to import { calcAPCA } from "apca-w3"

Add basic docs

We need README.md with just basis information:

  1. Title
  2. A small code example
  3. A few sentences about the project
  4. Links to OKLCH and APCA

Add Size Limit

Your tool can be used for dynamic theme on client-side. It will be nice to keep track the size of the tool inside JS bundle.

There is a tool for that called Size Limit.

There are two ways of using it:

  1. Just add it to pnpm test and call it on every commit on CI (so you will be able to track size by reading CI log)
  2. Or set a limit (current size) to fail CI every time when the size increases

Anyway, the first steps are equal:

  1. Fix #2 and #3
  2. pnpm add --save-dev size-limit @size-limit/preset-small-lib
  3. Add "test:size": "size-limit" to package.json→scripts (pnpm test automatically runs all scripts with test: prefix)

If you want to set limit:

  1. Run pnpm size-limit locally to get the current size

  2. Add to package.json:

      "size-limit": [
        {
          "limit": "100 B"
        }
      ],

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.