Skip to content

Commit

Permalink
init project.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 10, 2022
0 parents commit c64c79e
Show file tree
Hide file tree
Showing 13 changed files with 551 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.husky/* linguist-detectable=false
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI
on:
push:
branches:
- main

jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- run: npm install
- run: npm run build
- run: npm run type-check
- run: npm run coverage

- name: Converts Markdown to HTML
uses: jaywcjlove/markdown-to-html-cli@main
with:
output: coverage/index.html
github-corners: https://github.com/jaywcjlove/colors-named
favicon: data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎨</text></svg>

- name: Create Coverage Badges
uses: jaywcjlove/coverage-badges-cli@main
with:
source: coverage/coverage-summary.json
output: coverage/badges.svg

- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
output: coverage/CONTRIBUTORS.svg
avatarSize: 42
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build
dist
lib
cjs
esm
node_modules
coverage
npm-debug.log*
package-lock.json

.eslintcache
.DS_Store
.cache
.rdoc-dist

*.log
*.bak
*.tem
*.temp
#.swp
*.*~
~*.*
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/*.md
package.json
package-lock.json
node_modules
dist
build
coverage
lib
test
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Kenny Wang<[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
colors-named
===

[![Build & Deploy](https://github.com/jaywcjlove/colors-named/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/colors-named/actions/workflows/ci.yml)
[![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/colors-named/file/README.md)
[![npm version](https://img.shields.io/npm/v/colors-named.svg)](https://www.npmjs.com/package/colors-named)
[![Coverage Status](https://jaywcjlove.github.io/colors-named/badges.svg)](https://jaywcjlove.github.io/colors-named/lcov-report/)

A array with color names. Based on https://www.w3.org/TR/css-color-4/#named-colors

## Installation

This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c): Node 12+ is needed to use it and it must be import instead of require.

```bash
npm install colors-named
```

If you still want to use in CommonJS, you can use dynamic `import()` to load.

```js
const named = await import('colors-named');

// Fix compiling in typescript.
// https://github.com/microsoft/TypeScript/issues/43329#issuecomment-922544562
const named = await (Function('return import("colors-named")')()) as Promise<typeof import("colors-named")>;
```

## Usage

```js
import named from "colors-named";

console.log(named) // => ['aliceblue', 'antiquewhite', 'aqua', ... ]
console.log(named.includes('red')) // => true
console.log(named.length) // => 148
```

## API

```ts
/**
* A array with color names. Based on https://www.w3.org/TR/css-color-4/#named-colors
*/
declare const names: readonly ["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"];
export default names;
```

## Contributors

As always, thanks to our amazing contributors!

<a href="https://github.com/jaywcjlove/colors-named/graphs/contributors">
<img src="https://jaywcjlove.github.io/colors-named/CONTRIBUTORS.svg" />
</a>

Made with [action-contributors](https://github.com/jaywcjlove/github-action-contributors).

## License

Licensed under the MIT License.
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "colors-named",
"version": "0.0.1",
"description": "A array with color names.",
"type": "module",
"types": "./lib/index.d.ts",
"exports": "./lib/index.js",
"homepage": "https://jaywcjlove.github.io/colors-named/",
"repository": {
"type": "git",
"url": "https://github.com/jaywcjlove/colors-named"
},
"scripts": {
"prepack": "husky install && npm run build",
"start": "tsbb watch --disable-babel",
"build": "tsbb build --disable-babel",
"type-check": "tsc --noEmit",
"test": "tsbb test",
"coverage": "tsbb test --coverage",
"prettier": "prettier --write \"**/*.{js,ts,json}\""
},
"keywords": [
"color",
"colors",
"colors-named",
"named-colors",
"named"
],
"author": "Kenny Wang<[email protected]>",
"license": "MIT",
"files": [
"src/index.ts",
"lib"
],
"engines": {
"node": ">=14.16"
},
"lint-staged": {
"*.{js,ts,json}": "prettier --write"
},
"devDependencies": {
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"tsbb": "~3.7.6"
}
}
10 changes: 10 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"packageRules": [
{
"matchPackagePatterns": ["*"],
"rangeStrategy": "replace"
}
]
}
Loading

0 comments on commit c64c79e

Please sign in to comment.