From 1c5e1d4032009215688e31ae5a24ec3162a80a51 Mon Sep 17 00:00:00 2001 From: Samantha Nguyen Date: Sat, 16 Dec 2023 01:24:37 -0600 Subject: [PATCH] refactor: rename typed-css-utils to css-types --- .codesandbox/ci.json | 2 +- README.md | 2 +- package-lock.json | 8 +++---- package.json | 2 +- .../{typed-css-utils => css-types}/README.md | 24 +++++++++---------- .../package.json | 8 +++---- .../src/cssSupports.ts | 2 +- .../src/index.ts | 0 .../src/matchMedia.ts | 2 +- .../vite.config.ts | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) rename packages/{typed-css-utils => css-types}/README.md (78%) rename packages/{typed-css-utils => css-types}/package.json (89%) rename packages/{typed-css-utils => css-types}/src/cssSupports.ts (94%) rename packages/{typed-css-utils => css-types}/src/index.ts (100%) rename packages/{typed-css-utils => css-types}/src/matchMedia.ts (99%) rename packages/{typed-css-utils => css-types}/vite.config.ts (84%) diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index 8ae416a..b8fc869 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -3,7 +3,7 @@ "node": "18", "packages": [ "packages/types", - "packages/typed-css-utils", + "packages/css-types", "packages/typed-http" ] } diff --git a/README.md b/README.md index 7647c87..8a6fd53 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A monorepo of pure-TypeScript type packages. ## Packages - [`@neoncitylights/types`](/packages/types): small library of general-purpose utility types -- [`@neoncitylights/typed-css-utils`](/packages/typed-css-utils): utilities for writing typed CSS in TypeScript +- [`@neoncitylights/css-types`](packages/css-types): utilities for writing typed CSS in TypeScript - [`@neoncitylights/typed-http`](/packages/typed-http): strongly typed HTTP headers, methods, and status codes (supports Fetch, XHR, Node.js HTTP) ## License diff --git a/package-lock.json b/package-lock.json index 6538590..097e4e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -716,8 +716,8 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@neoncitylights/typed-css-utils": { - "resolved": "packages/typed-css-utils", + "node_modules/@neoncitylights/css-types": { + "resolved": "packages/css-types", "link": true }, "node_modules/@neoncitylights/typed-http": { @@ -6726,8 +6726,8 @@ "node": "^12.20.0 || >=14" } }, - "packages/typed-css-utils": { - "name": "@neoncitylights/typed-css-utils", + "packages/css-types": { + "name": "@neoncitylights/css-types", "version": "0.2.0", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 788d432..9934c9f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lint:md": "markdownlint-cli2 '**/*.md' \"#node_modules\"", "lint:md-fix": "npm run lint:md -- --fix", "lint:md-env": "markdownlint-cli2 --version", - "lint:pub": "publint packages/types && publint packages/typed-css-utils", + "lint:pub": "publint packages/types && publint packages/css-types", "lint:pub-env": "publint --version" }, "devDependencies": { diff --git a/packages/typed-css-utils/README.md b/packages/css-types/README.md similarity index 78% rename from packages/typed-css-utils/README.md rename to packages/css-types/README.md index 8cfca18..1465064 100644 --- a/packages/typed-css-utils/README.md +++ b/packages/css-types/README.md @@ -1,7 +1,7 @@ -# neoncitylights/typed-css-utils +# neoncitylights/css-types [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT) -[![NPM package](https://img.shields.io/npm/v/@neoncitylights/typed-css-utils?style=flat-square)](https://www.npmjs.com/package/@neoncitylights/typed-css-utils) +[![NPM package](https://img.shields.io/npm/v/@neoncitylights/css-types?style=flat-square)](https://www.npmjs.com/package/@neoncitylights/css-types) This library provides a set of utilities extending the `csstype` package to help you write typed CSS in TypeScript. @@ -13,24 +13,24 @@ Currently, there's basic support for the following W3C standards: ## Install ``` -npm install @neoncitylights/typed-css-utils +npm install @neoncitylights/css-types ``` ## Documentation -[Auto-generated API documentation is available](https://neoncitylights.github.io/typed-css-utils/). +[Auto-generated API documentation is available](https://neoncitylights.github.io/css-types/). ### API reference > > **Note**: The public API below is an excerpt and shows the *main* symbols that a developer is likely to use. - - `fn`: # **cssSupports**(*property*, *value*): *boolean* • [source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/cssSupports.html) - - `fn`: # **matchMediaFeature**(*mediaFeature*, *value*): MediaQueryList • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/matchMediaFeature.html) - - `T`: # cssSupports.**CSSProperty** • [source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/CSSProperty.html) - - `T`: # cssSupports.**CSSPropertyValue** • [source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/CSSPropertyValue.html) - - `T`: # matchMedia.**MqFeature** • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/MqFeature.html) - - `T`: # matchMedia.**MqFeatureValue** • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/MqFeatureValue.html) - - `I`: # matchMedia.**MediaQueries** • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/MediaQueries.html) + - `fn`: # **cssSupports**(*property*, *value*): *boolean* • [source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/css-types/types/cssSupports.html) + - `fn`: # **matchMediaFeature**(*mediaFeature*, *value*): MediaQueryList • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/matchMediaFeature.html) + - `T`: # cssSupports.**CSSProperty** • [source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/css-types/types/CSSProperty.html) + - `T`: # cssSupports.**CSSPropertyValue** • [source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/css-types/types/CSSPropertyValue.html) + - `T`: # matchMedia.**MqFeature** • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/MqFeature.html) + - `T`: # matchMedia.**MqFeatureValue** • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/MqFeatureValue.html) + - `I`: # matchMedia.**MediaQueries** • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/MediaQueries.html) ## Usage @@ -40,7 +40,7 @@ Using TypeScript, you can receive type intelliSense, which provides autocomplete - Media feature names (e.g `prefers-color-scheme`, `aspect-ratio`) ```ts -import { matchMediaFeature, cssSupports } from '@neoncitylights/typed-css-utils'; +import { matchMediaFeature, cssSupports } from '@neoncitylights/css-types'; // equivalent to window.matchMedia('(prefers-color-scheme: dark)'); const userPrefersDark: MediaQueryList = matchMediaFeature('prefers-color-scheme', 'dark'); diff --git a/packages/typed-css-utils/package.json b/packages/css-types/package.json similarity index 89% rename from packages/typed-css-utils/package.json rename to packages/css-types/package.json index c4a2fae..f2c6dbe 100644 --- a/packages/typed-css-utils/package.json +++ b/packages/css-types/package.json @@ -1,5 +1,5 @@ { - "name": "@neoncitylights/typed-css-utils", + "name": "@neoncitylights/css-types", "version": "0.2.0", "description": "Improved TypeScript support for CSS and relevant APIs", "license": "MIT", @@ -11,7 +11,7 @@ "css", "typescript" ], - "homepage": "https://github.com/neoncitylights/types/tree/main/packages/typed-css-utils", + "homepage": "https://github.com/neoncitylights/types/tree/main/packages/css-types", "bugs": "https://github.com/neoncitylights/types/issues", "repository": { "type": "git", @@ -22,12 +22,12 @@ "url": "https://github.com/sponsors/neoncitylights" }, "type": "module", - "module": "./dist/typed-css-utils.es.js", + "module": "./dist/css-types.es.js", "types": "./dist/index.d.ts", "exports": { "*": { "types": "./dist/index.d.ts", - "import": "./dist/typed-css-utils.es.js" + "import": "./dist/css-types.es.js" } }, "files": [ diff --git a/packages/typed-css-utils/src/cssSupports.ts b/packages/css-types/src/cssSupports.ts similarity index 94% rename from packages/typed-css-utils/src/cssSupports.ts rename to packages/css-types/src/cssSupports.ts index 44c9870..018d5a2 100644 --- a/packages/typed-css-utils/src/cssSupports.ts +++ b/packages/css-types/src/cssSupports.ts @@ -10,7 +10,7 @@ export type CSSPropertyValue = Required `typed-css-utils.${format}.js`, + fileName: (format) => `css-types.${format}.js`, }, }, define: {