Skip to content

Commit 0229b45

Browse files
committed
feat: create package
0 parents  commit 0229b45

16 files changed

+15938
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.eslintrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"jest": true
4+
},
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:compat/recommended",
8+
"plugin:jsdoc/recommended",
9+
"plugin:security/recommended",
10+
"prettier"
11+
],
12+
"parser": "babel-eslint",
13+
"plugins": ["jsdoc", "security"]
14+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated directories.
2+
lib
3+
node_modules
4+
5+
# Logs.
6+
*.log

.huskyrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
hooks: {
3+
commitmsg: 'commitlint -E HUSKY_GIT_PARAMS',
4+
'pre-commit': 'lint-staged',
5+
},
6+
}

.lintstagedrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
'*.{js,json,md,yml}': ['npm run format:precommit'],
3+
'*.js': ['npm run lint:precommit', 'npm run test'],
4+
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
13.11

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": true,
4+
"trailingComma": "es5"
5+
}

.releaserc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
plugins: [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
5+
'@semantic-release/npm',
6+
'@semantic-release/github',
7+
['@semantic-release/git', {
8+
assets: 'package.json',
9+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
10+
}],
11+
],
12+
}

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
3+
after_success: npm run build
4+
5+
deploy:
6+
provider: script
7+
script: npm run semantic-release
8+
skip_cleanup: true
9+
on:
10+
branch: master

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ISC License (ISC)
2+
3+
Copyright 2020 Simon Finney
4+
5+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<h1 align="center">parse-css-custom-property</h1>
2+
3+
<span align="center">
4+
5+
[![Licensed under the ISC License](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
6+
[![Travis CI](https://travis-ci.org/SimonFinney/parse-css-custom-property.svg?branch=master)](https://travis-ci.org/SimonFinney/parse-css-custom-property)
7+
8+
</span>
9+
10+
Parse CSS custom property strings.
11+
12+
## Installation
13+
14+
```bash
15+
npm i -S parse-css-custom-property
16+
```
17+
18+
## Usage
19+
20+
```js
21+
import ParseCSSCustomProperty, {
22+
getDeclaration,
23+
getFallback,
24+
} from 'parse-css-custom-property';
25+
26+
const cssCustomProperty = 'var(--foo, bar)';
27+
28+
// { declaration: '--foo', fallback: 'bar' }
29+
ParseCSSCustomProperty(cssCustomProperty);
30+
31+
// '--foo'
32+
getDeclaration(cssCustomProperty);
33+
34+
// 'bar'
35+
getFallback(cssCustomProperty);
36+
```

0 commit comments

Comments
 (0)