1
mirror of https://github.com/jakejarvis/stitches-normalize.git synced 2025-04-25 16:35:22 -04:00

convert to ESM module and real typescript

This commit is contained in:
Jake Jarvis 2022-03-15 13:09:03 -04:00
parent e80d7d6b7c
commit ef51f14603
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
7 changed files with 3804 additions and 21 deletions

21
.eslintrc.json Normal file
View File

@ -0,0 +1,21 @@
{
"extends": [
"@jakejarvis/eslint-config",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"env": {
"node": true,
"browser": false
},
"rules": {
"quote-props": "off",
"@typescript-eslint/ban-ts-comment": "off"
},
"ignorePatterns": [
"dist/**"
]
}

19
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn build

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
.DS_Store
node_modules/
yarn.lock
dist/
.npmrc
.vscode/

5
index.d.ts vendored
View File

@ -1,5 +0,0 @@
import * as Stitches from "@stitches/react";
declare const normalizeCss: Record<string, Stitches.CSSProperties>[];
export default normalizeCss;

View File

@ -1,8 +1,9 @@
{
"name": "stitches-normalize",
"version": "0.1.0",
"description": "@sindresorhus's modern-normalize.css as a plug-and-play JavaScript object compatible with Stitches.",
"license": "MIT",
"description": "@sindresorhus's modern-normalize.css as a plug-and-play JavaScript object compatible with Stitches.",
"repository": "jakejarvis/stitches-normalize",
"author": {
"name": "Jake Jarvis",
"email": "jake@jarv.is",
@ -15,22 +16,40 @@
"url": "https://sindresorhus.com"
}
],
"repository": {
"type": "git",
"url": "https://github.com/jakejarvis/stitches-normalize.git"
},
"type": "module",
"files": [
"index.js",
"index.d.ts"
"dist"
],
"main": "index.js",
"types": "./index.d.ts",
"source": "./src/index.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"exports": {
"require": "./dist/index.cjs",
"import": "./dist/index.js"
},
"types": "./dist/index.d.ts",
"scripts": {
"build": "microbundle --no-sourcemap --no-compress --format cjs,esm",
"test": "eslint .",
"prepublishOnly": "yarn build"
},
"devDependencies": {
"@stitches/react": "^1.2.7"
"@jakejarvis/eslint-config": "*",
"@stitches/react": "^1.2.7",
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"eslint": "^8.11.0",
"microbundle": "^0.14.2",
"typescript": "^4.6.2"
},
"peerDependencies": {
"@stitches/react": "1.x"
},
"peerDependenciesMeta": {
"@stitches/react": {
"optional": true
}
},
"keywords": [
"stitches",
"css-in-js",

View File

@ -1,9 +1,9 @@
/*! stitches-normalize | MIT License | https://github.com/jakejarvis/stitches-normalize */
/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
// ...as of this commit:
// https://github.com/sindresorhus/modern-normalize/blob/b59ec0d3d8654cbb6843bc9ea45aef5f1d680108/modern-normalize.css
/** @type {Record<string, import("@stitches/react").CSSProperties>[]} */
module.exports = [
import type * as Stitches from "@stitches/react";
const normalizeCss: Record<string, Stitches.CSSProperties>[] = [
{
"*, ::before, ::after": {
boxSizing: "border-box",
@ -11,6 +11,7 @@ module.exports = [
html: {
lineHeight: 1.15,
tabSize: 4,
// @ts-ignore
WebkitTextSizeAdjust: "100%",
},
body: {
@ -60,6 +61,7 @@ module.exports = [
textTransform: "none",
},
"button, [type='button'], [type='reset'], [type='submit']": {
// @ts-ignore
WebkitAppearance: "button",
},
"::-moz-focus-inner": {
@ -83,9 +85,11 @@ module.exports = [
},
"[type='search']": {
outlineOffset: -2,
// @ts-ignore
WebkitAppearance: "textfield",
},
"::-webkit-search-decoration": {
// @ts-ignore
WebkitAppearance: "none",
},
"::-webkit-inner-spin-button, ::-webkit-outer-spin-button": {
@ -93,7 +97,10 @@ module.exports = [
},
"::-webkit-file-upload-button": {
font: "inherit",
// @ts-ignore
WebkitAppearance: "button",
},
},
];
export default normalizeCss;

3723
yarn.lock Normal file

File diff suppressed because it is too large Load Diff