Skip to content

Commit e5e68cd

Browse files
authored
Merge pull request #694 from system-ui/ts-presets
Convert all presets to TypeScript
2 parents 1b72aef + 7c4ccd5 commit e5e68cd

File tree

42 files changed

+183
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+183
-122
lines changed

.circleci/config.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,4 @@ jobs:
55
- image: circleci/node:lts
66
working_directory: ~/repo
77
steps:
8-
- checkout
9-
- restore_cache:
10-
keys:
11-
- v2-dependencies-{{ checksum "package.json" }}
12-
- v2-dependencies-
13-
- run: yarn install
14-
- save_cache:
15-
paths:
16-
- node_modules
17-
key: v2-dependencies-{{ checksum "package.json" }}
18-
- run: yarn test --coverage
8+
- run: echo "Nope"

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12.x
15+
- name: Get yarn cache directory path
16+
id: yarn-cache-dir
17+
run: echo "::set-output name=dir::$(yarn cache dir)"
18+
19+
- uses: actions/cache@v1
20+
with:
21+
path: ${{ steps.yarn-cache-dir.outputs.dir }}
22+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
23+
restore-keys: |
24+
${{ runner.os }}-yarn-
25+
- run: yarn
26+
- run: yarn test --coverage

packages/preset-bootstrap/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "0.3.0",
44
"main": "dist/index.js",
55
"module": "dist/index.esm.js",
6+
"types": "dist/index.d.ts",
7+
"source": "src/index.ts",
68
"author": "Brent Jackson",
79
"license": "MIT",
810
"scripts": {

packages/preset-bootstrap/src/index.js renamed to packages/preset-bootstrap/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ export const fonts = {
5353
heading: 'inherit',
5454
monospace:
5555
'SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
56+
// NOTE(@mxstbr): TypeScript does not let us do the self-references below if we don't provide "default" values
57+
sans: '',
5658
}
5759
fonts.sans = fonts.body
5860

@@ -61,11 +63,16 @@ export const fontWeights = {
6163
heading: 500,
6264
bold: 700,
6365
light: 300,
66+
// NOTE(@mxstbr): TypeScript does not let us do the self-references below if we don't provide "default" values
67+
normal: 0,
68+
display: 0,
6469
}
6570
fontWeights.normal = fontWeights.body
6671
fontWeights.display = fontWeights.light
6772

68-
export const fontSizes = [
73+
export const fontSizes: Array<string> & {
74+
lead?: string
75+
} = [
6976
'0.75rem', // '80%',
7077
'0.875rem',
7178
'1rem',
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"resolveJsonModule": true,
4+
"esModuleInterop": true,
5+
"moduleResolution": "node",
6+
"strict": true
7+
}
8+
}

packages/preset-bulma/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "0.3.0",
44
"main": "dist/index.js",
55
"module": "dist/index.esm.js",
6+
"types": "dist/index.d.ts",
7+
"source": "src/index.ts",
68
"author": "Brent Jackson",
79
"license": "MIT",
810
"scripts": {

packages/preset-bulma/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"resolveJsonModule": true,
4+
"esModuleInterop": true,
5+
"moduleResolution": "node",
6+
"strict": true
7+
}
8+
}

packages/preset-dark/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "0.3.0",
44
"main": "dist/index.js",
55
"module": "dist/index.esm.js",
6+
"types": "dist/index.d.ts",
7+
"source": "src/index.ts",
68
"author": "Brent Jackson",
79
"license": "MIT",
810
"scripts": {

packages/preset-dark/src/index.js renamed to packages/preset-dark/src/index.ts

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default {
107107
my: 4,
108108
borderCollapse: 'separate',
109109
borderSpacing: 0,
110-
[['th', 'td']]: {
110+
'th,td': {
111111
textAlign: 'left',
112112
py: '4px',
113113
pr: '4px',
@@ -134,48 +134,19 @@ export default {
134134
},
135135
},
136136
prism: {
137-
[[
138-
'.comment',
139-
'.prolog',
140-
'.doctype',
141-
'.cdata',
142-
'.punctuation',
143-
'.operator',
144-
'.entity',
145-
'.url',
146-
]]: {
137+
'.comment,.prolog,.doctype,.cdata,.punctuation,.operator,.entity,.url': {
147138
color: 'gray',
148139
},
149140
'.comment': {
150141
fontStyle: 'italic',
151142
},
152-
[[
153-
'.property',
154-
'.tag',
155-
'.boolean',
156-
'.number',
157-
'.constant',
158-
'.symbol',
159-
'.deleted',
160-
'.function',
161-
'.class-name',
162-
'.regex',
163-
'.important',
164-
'.variable',
165-
]]: {
143+
'.property,.tag,.boolean,.number,.constant,.symbol,.deleted,.function,.class-name,.regex,.important,.variable': {
166144
color: 'purple',
167145
},
168-
[['.atrule', '.attr-value', '.keyword']]: {
146+
'.atrule,.attr-value,.keyword': {
169147
color: 'primary',
170148
},
171-
[[
172-
'.selector',
173-
'.attr-name',
174-
'.string',
175-
'.char',
176-
'.builtin',
177-
'.inserted',
178-
]]: {
149+
'.selector,.attr-name,.string,.char,.builtin,.inserted': {
179150
color: 'secondary',
180151
},
181152
},

0 commit comments

Comments
 (0)