Skip to content

Commit

Permalink
Hello, cruel world!
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnocorp committed Jun 9, 2019
0 parents commit aa4efe1
Show file tree
Hide file tree
Showing 10 changed files with 4,319 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
lib
.vscode
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"semi": false
}
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DEFAULT_GOAL := build
.PHONY: build

SHELL := /bin/bash
PATH := $(shell yarn bin):$(PATH)

test:
jest
.PHONY: test

test-watch:
jest --watch

build:
@rm -rf lib
@tsc
@prettier "**/*.[jt]s" --write --loglevel silent
@node -e "require('fs').writeFileSync('./lib/package.json', JSON.stringify(Object.assign(require('./package.json'), { main: 'index.js' }), null, 2))"

publish: build
cd lib && npm publish
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nyan CSS types

WIP
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript'
]
}
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
roots: ['<rootDir>/src/']
}
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "nyancss-types",
"version": "1.0.0",
"description": "Nyan CSS types",
"main": "lib/index.js",
"repository": "https://github.com/nyancss/nyancss-types",
"author": "Sasha Koss <[email protected]>",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@babel/preset-env": "^7.4.5",
"@babel/preset-typescript": "^7.3.3",
"@types/jest": "^24.0.13",
"@types/node": "^12.0.4",
"jest": "^24.8.0",
"prettier": "^1.17.1",
"typescript": "^3.5.1"
}
}
30 changes: 30 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export type NyanCSSBooleanProp = {
propName: string
type: 'boolean'
className: string
}

export type NyanCSSEnumProp = {
propName: string
type: 'enum'
values: (string | true)[]
classNames: { [value: string]: string } & { true?: string }
}

export type NyanCSSProp = NyanCSSBooleanProp | NyanCSSEnumProp

export type NyanCSSComponent = {
tag: string | undefined
className: string
props: {
[propName: string]: NyanCSSProp
}
}

export type NyanCSSMap = {
[componentName: string]: NyanCSSComponent
}

export type NyanCSSParseResult = {
map: NyanCSSMap
}
14 changes: 14 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"rootDirs": ["src"],
"declaration": true,
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"outDir": "lib",
"strict": true,
"noImplicitAny": true,
"allowSyntheticDefaultImports": true
},
"exclude": ["**/test.ts", "lib", "node_modules"]
}
Loading

0 comments on commit aa4efe1

Please sign in to comment.