Skip to content

Commit

Permalink
Bump deps, add config type to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
drwpow committed Aug 7, 2022
1 parent fb9c43d commit ed21d56
Show file tree
Hide file tree
Showing 29 changed files with 337 additions and 256 deletions.
11 changes: 11 additions & 0 deletions .changeset/wet-eels-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@cobalt-ui/cli': patch
'@cobalt-ui/core': patch
'@cobalt-ui/plugin-css': patch
'@cobalt-ui/plugin-json': patch
'@cobalt-ui/plugin-sass': patch
'@cobalt-ui/plugin-ts': patch
'@cobalt-ui/utils': patch
---

Bump deps, add config type to docs
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
restore-keys: ${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 6
version: latest
- uses: actions/setup-node@v2
- run: pnpm i
- run: pnpm run lint
Expand All @@ -33,7 +33,7 @@ jobs:
restore-keys: ${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 6
version: latest
- uses: actions/setup-node@v2
- run: pnpm i
- run: pnpm run build
Expand Down
1 change: 1 addition & 0 deletions examples/adobe/tokens.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginSass from '@cobalt-ui/plugin-sass';
import pluginJSON from '@cobalt-ui/plugin-json';
import pluginTS from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [pluginCSS(), pluginSass(), pluginJSON(), pluginTS()],
};
1 change: 1 addition & 0 deletions examples/apple/tokens.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginSass from '@cobalt-ui/plugin-sass';
import pluginJSON from '@cobalt-ui/plugin-json';
import pluginTS from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [pluginCSS(), pluginSass(), pluginJSON(), pluginTS()],
};
1 change: 1 addition & 0 deletions examples/github/tokens.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginSass from '@cobalt-ui/plugin-sass';
import pluginJSON from '@cobalt-ui/plugin-json';
import pluginTS from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
pluginCSS({
Expand Down
1 change: 1 addition & 0 deletions examples/ibm/tokens.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginSass from '@cobalt-ui/plugin-sass';
import pluginJSON from '@cobalt-ui/plugin-json';
import pluginTS from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [pluginCSS(), pluginSass(), pluginJSON(), pluginTS()],
};
1 change: 1 addition & 0 deletions examples/salesforce/tokens.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginSass from '@cobalt-ui/plugin-sass';
import pluginJSON from '@cobalt-ui/plugin-json';
import pluginTS from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [pluginCSS(), pluginSass(), pluginJSON(), pluginTS()],
};
1 change: 1 addition & 0 deletions examples/shopify/tokens.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginSass from '@cobalt-ui/plugin-sass';
import pluginJSON from '@cobalt-ui/plugin-json';
import pluginTS from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [pluginCSS(), pluginSass(), pluginJSON(), pluginTS()],
};
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,17 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@changesets/cli": "^2.23.2",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"@changesets/cli": "^2.24.2",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"del-cli": "^4.0.1",
"esbuild": "^0.14.49",
"eslint": "^8.20.0",
"esbuild": "^0.14.53",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"npm-run-all": "^4.1.5",
"pnpm": "^7.5.2",
"pnpm": "^7.9.0",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
},
"volta": {
"node": "16.14.2"
}
}
1 change: 1 addition & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ And place a `tokens.config.mjs` file in the root of your project. Here are all t
```js
// tokens.config.mjs

/** @type import('@cobalt-ui/core').Config */
export default {
/** path to tokens.json */
tokens: './tokens.json',
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
"number-precision": "^1.5.2",
"piscina": "^3.2.0",
"svgo": "^2.8.0",
"undici": "^5.8.0"
"undici": "^5.8.1"
},
"devDependencies": {
"@types/svgo": "^2.6.3",
"chai": "^4.3.6",
"figma-api": "^1.10.1",
"mocha": "^10.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
},
"dependencies": {
"@cobalt-ui/utils": "^0.3.0",
"@types/svgo": "^2.6.3",
"better-color-tools": "^0.9.1"
},
"devDependencies": {
"@types/node": "^17.0.45",
"@types/svgo": "^2.6.3",
"chai": "^4.3.6",
"mocha": "^10.0.0"
}
Expand Down
9 changes: 7 additions & 2 deletions packages/plugin-css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ npm i -D @cobalt-ui/plugin-css
// tokens.config.mjs
import css from '@cobalt-ui/plugin-css';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
css({
Expand Down Expand Up @@ -101,7 +102,8 @@ For example, if your `color.base` group has `light` and `dark` modes, and you wa
// tokens.config.mjs
import css from '@cobalt-ui/plugin-css';

export default [
/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
css({
modeSelectors: {
Expand All @@ -110,7 +112,7 @@ export default [
},
}),
],
]
};
```

This will generate the following CSS:
Expand Down Expand Up @@ -147,6 +149,7 @@ But more than just classes can be used (that’s why it’s called `modeSelector
// tokens.config.mjs
import css from '@cobalt-ui/plugin-css';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
css({
Expand Down Expand Up @@ -191,6 +194,7 @@ To learn about modes, [read the documentation](https://cobalt-ui.pages.dev/docs/
Inside plugin options, you can specify transforms [per-type](https://cobalt-ui.pages.dev/reference/schema):

```js
/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
pluginCSS({
Expand Down Expand Up @@ -238,6 +242,7 @@ export default {
If you have your own custom token type, e.g. `my-custom-type`, you can add more keys to `transform` to handle it, like so:

```js
/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
pluginCSS({
Expand Down
34 changes: 17 additions & 17 deletions packages/plugin-css/test/fixtures/color/want.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,43 @@

@supports (color: color(display-p3 1 1 1)) {
:root {
--color-blue: color(display-p3 0.12941 0.5451 1);
--color-action: color(display-p3 0.12941 0.5451 1);
--gradient: color(display-p3 0.12941 0.5451 1) 0%, color(display-p3 0.9098 0.35294 0.67843) 100%;
--color-blue: color(display-p3 0.129412 0.545098 1);
--color-action: color(display-p3 0.129412 0.545098 1);
--gradient: color(display-p3 0.129412 0.545098 1) 0%, color(display-p3 0.909804 0.352941 0.678431) 100%;
}

[data-color-theme="light"] {
--color-blue: color(display-p3 0.12941 0.5451 1);
--color-action: color(display-p3 0.12941 0.5451 1);
--color-blue: color(display-p3 0.129412 0.545098 1);
--color-action: color(display-p3 0.129412 0.545098 1);
}

[data-color-theme="dark"] {
--color-blue: color(display-p3 0.21961 0.5451 0.99216);
--color-action: color(display-p3 0.21961 0.5451 0.99216);
--color-blue: color(display-p3 0.219608 0.545098 0.992157);
--color-action: color(display-p3 0.219608 0.545098 0.992157);
}

[data-color-theme="light-colorblind"] {
--color-blue: color(display-p3 0.12941 0.5451 1);
--color-action: color(display-p3 0.12941 0.5451 1);
--color-blue: color(display-p3 0.129412 0.545098 1);
--color-action: color(display-p3 0.129412 0.545098 1);
}

[data-color-theme="light-high-contrast"] {
--color-blue: color(display-p3 0.06667 0.40784 0.8902);
--color-action: color(display-p3 0.06667 0.40784 0.8902);
--color-blue: color(display-p3 0.066667 0.407843 0.890196);
--color-action: color(display-p3 0.066667 0.407843 0.890196);
}

[data-color-theme="dark-dimmed"] {
--color-blue: color(display-p3 0.2549 0.51765 0.89412);
--color-action: color(display-p3 0.2549 0.51765 0.89412);
--color-blue: color(display-p3 0.254902 0.517647 0.894118);
--color-action: color(display-p3 0.254902 0.517647 0.894118);
}

[data-color-theme="high-contrast"] {
--color-blue: color(display-p3 0.25098 0.61961 1);
--color-action: color(display-p3 0.25098 0.61961 1);
--color-blue: color(display-p3 0.25098 0.619608 1);
--color-action: color(display-p3 0.25098 0.619608 1);
}

[data-color-theme="dark-colorblind"] {
--color-blue: color(display-p3 0.21961 0.5451 0.99216);
--color-action: color(display-p3 0.21961 0.5451 0.99216);
--color-blue: color(display-p3 0.219608 0.545098 0.992157);
--color-action: color(display-p3 0.219608 0.545098 0.992157);
}
}
1 change: 1 addition & 0 deletions packages/plugin-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ npm i -D @cobalt-ui/plugin-json
// tokens.config.mjs
import json from '@cobalt-ui/plugin-json';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
json({
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-sass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ npm i -D @cobalt-ui/plugin-sass
// tokens.config.mjs
import pluginSass from '@cobalt-ui/plugin-sass';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
pluginSass({
Expand Down Expand Up @@ -151,6 +152,7 @@ In some scenarios this is preferable, but in others, this may result in too many
Inside plugin options, you can specify transforms [per-type](https://cobalt-ui.pages.dev/reference/schema):

```js
/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
pluginSass({
Expand Down Expand Up @@ -198,6 +200,7 @@ export default {
If you have your own custom token type, e.g. `my-custom-type`, you can add more keys to `transform` to handle it, like so:

```js
/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
pluginSass({
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ npm i -D @cobalt-ui/plugin-ts
// tokens.config.mjs
import ts from '@cobalt-ui/plugin-ts';

/** @type import('@cobalt-ui/core').Config */
export default {
plugins: [
ts({
Expand Down
3 changes: 3 additions & 0 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"scripts": {
"build": "tsc",
"dev": "tsc -w"
},
"devDependencies": {
"@types/node": "^17.0.45"
}
}
Loading

0 comments on commit ed21d56

Please sign in to comment.