Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Tanstack Config #41

Merged
merged 40 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b74fec5
Update package.json
asamuzaK Jan 10, 2025
0fe0645
Release test version
asamuzaK Jan 10, 2025
ce62e1b
Create package-lock.json
asamuzaK Jan 10, 2025
469f8bf
Update node.js.yml
asamuzaK Jan 10, 2025
4d96a34
Revert version
asamuzaK Jan 11, 2025
02ab0b4
chore: WIP major overhaul of config files
crutchcorn Jan 11, 2025
951aed9
chore: move JS files to TS
crutchcorn Jan 11, 2025
2139b81
chore: migrate color.test.ts to use Vitest
crutchcorn Jan 11, 2025
30abb2e
chore: migrate common.test to use Vitest
crutchcorn Jan 11, 2025
72a541c
chore: migrate constant.test to use Vitest
crutchcorn Jan 11, 2025
d7a6e3f
chore: convert convert.test to Vitest
crutchcorn Jan 11, 2025
a21caea
chore: migrate css-calc to use new tests
crutchcorn Jan 11, 2025
25ee2dd
chore: migrate css-var to new tests
crutchcorn Jan 11, 2025
7d54a87
chore: migrate index test to Vitest
crutchcorn Jan 11, 2025
f456a4c
chore: mirgate relative-color to Vitest
crutchcorn Jan 11, 2025
23ad422
chore: migrate resolve tests to Vitest
crutchcorn Jan 11, 2025
123c304
chore: migrate util tests to Vitest
crutchcorn Jan 11, 2025
c9bc243
chore: mirgate convert types to file
crutchcorn Jan 11, 2025
b4304d1
chore: migrate color.ts to add type defs
crutchcorn Jan 12, 2025
ca03ddb
chore: migrate common to ts types
crutchcorn Jan 12, 2025
61f2104
chore: migrate css-calc to TS types
crutchcorn Jan 12, 2025
eccbbd3
chore: migrate css-var to TS
crutchcorn Jan 12, 2025
b78f668
chore: migrate relative color to use TS
crutchcorn Jan 12, 2025
fac0c10
chore: migrate resolve to TS
crutchcorn Jan 12, 2025
1288517
chore: mirgate util to TS
crutchcorn Jan 12, 2025
1be5cde
chore: fix type issues
crutchcorn Jan 12, 2025
700bb5a
chore: fix build
crutchcorn Jan 12, 2025
90307df
chore: remove .js extensions
crutchcorn Jan 12, 2025
18aa75d
chore: add minified browser supported file
crutchcorn Jan 12, 2025
e792c31
chore: format via prettier
crutchcorn Jan 12, 2025
5b46077
chore: fix CI
crutchcorn Jan 12, 2025
4c942bd
chore: fix prettier and tslint
crutchcorn Jan 12, 2025
8e1e65b
chore: fix knip
crutchcorn Jan 12, 2025
c3d58cb
chore: fix test
crutchcorn Jan 12, 2025
9471aa8
chore: update ESLint to Neostandard, enable Prettier semicolons
crutchcorn Jan 13, 2025
54804a9
chore: remove trailing semi
crutchcorn Jan 13, 2025
fe37a52
chore: fix comments, README, legalComments
crutchcorn Jan 13, 2025
4bd148b
chore: fix type casts
crutchcorn Jan 13, 2025
235a1cc
chore: fix more type casting
crutchcorn Jan 13, 2025
bf20e60
chore: fix parse and resolve fn types
crutchcorn Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"semi": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
"trailingComma": "none"
}
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ npm i @asamuzakjp/css-color
## Usage

```javascript
import { convert, isColor, resolve } from '@asamuzakjp/css-color'
import { convert, isColor, resolve } from '@asamuzakjp/css-color';

const resolvedValue = resolve(
'color-mix(in oklab, lch(67.5345 42.5 258.2), color(srgb 0 0.5 0))',
)
'color-mix(in oklab, lch(67.5345 42.5 258.2), color(srgb 0 0.5 0))'
);
// 'oklab(0.620754 -0.0931934 -0.00374881)'

const convertedValue = covert.colorToHex('lab(46.2775% -47.5621 48.5837)')
const convertedValue = covert.colorToHex('lab(46.2775% -47.5621 48.5837)');
// '#008000'

const result = isColor('green')
const result = isColor('green');
// true
```

Expand Down Expand Up @@ -54,13 +54,13 @@ resolves CSS color
const opt = {
customProperty: {
'--some-color': '#008000',
'--some-length': '16px',
},
}
'--some-length': '16px'
}
};
```
- and/or `callback` function to get the value of the custom property,
e.g.
```javascript;
```javascript
const node = document.getElementById('foo');
const opt = {
customProperty: {
Expand All @@ -77,9 +77,9 @@ resolves CSS color
dimension: {
em: 12,
rem: 16,
vw: 10.24,
},
}
vw: 10.24
}
};
```
- and/or `callback` function to get the value as a number in pixels,
e.g.
Expand All @@ -89,17 +89,17 @@ resolves CSS color
callback: (unit) => {
switch (unit) {
case 'em':
return 12
return 12;
case 'rem':
return 16
return 16;
case 'vw':
return 10.24
return 10.24;
default:
return
return;
}
},
},
}
}
}
};
```
- `opt.format` **[string][133]?**
- output format, one of below
Expand Down
17 changes: 6 additions & 11 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// @ts-check
import neostandard from 'neostandard';

// @ts-ignore Needed due to moduleResolution Node vs Bundler
import { tanstackConfig } from '@tanstack/config/eslint'

export default [
...tanstackConfig,
{
name: 'tanstack/temp',
rules: {},
},
]
export default neostandard({
noStyle: true,
semi: true,
ts: true
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"esbuild": "^0.24.2",
"eslint": "^9.17.0",
"knip": "^5.39.2",
"neostandard": "^0.12.0",
"prettier": "^3.4.2",
"publint": "^0.3.1",
"rimraf": "^6.0.1",
Expand Down
Loading