This repository has been archived by the owner on Jan 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start refactor core functions to typescript
- Loading branch information
Showing
20 changed files
with
414 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,28 @@ | |
"author": "Apostolos Christodoulou <[email protected]>", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.es.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "dist/index.d.ts", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"tdd": "jest --watchAll --watchman --forceExit --detectOpenHandles --notify --notifyMode=failure", | ||
"start": "node ../../scripts/parcel-start.js", | ||
"build": "node ../../scripts/parcel-build.js" | ||
"build": "rollup -c", | ||
"develop": "rollup -cw" | ||
}, | ||
"devDependencies": { | ||
"parcel": "^1.12.4", | ||
"parcel-bundler": "^1.12.4" | ||
"@babel/core": "^7.6.0", | ||
"@types/node": "^12.0.10", | ||
"babel-loader": "8.0.6", | ||
"rollup": "^1.19.4", | ||
"rollup-plugin-typescript2": "^0.24.0", | ||
"rollup-plugin-url": "^2.2.2", | ||
"typescript": "3.6.2" | ||
}, | ||
"dependencies": { | ||
"csstype": "^2.6.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createRollupConfig } from '../rollup.base'; | ||
import pkg from './package.json'; | ||
|
||
export default createRollupConfig(pkg); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as CSS from 'csstype'; | ||
|
||
interface Style extends CSS.Properties { | ||
[key: string]: any; | ||
} | ||
export const columns = ({ count }: { count: Number }): Style => { | ||
return { | ||
display: 'grid', | ||
gridTemplateColumns: `repeat(${count}, minmax(0,1fr))`, | ||
[`& > * `]: { | ||
gridColumn: 'span 1', | ||
}, | ||
}; | ||
}; | ||
|
||
export const column = ({ start, span }: { start: Number; span: Number }): Style => { | ||
return { | ||
gridColumn: `${start} / span ${span}`, | ||
}; | ||
}; | ||
|
||
export const gap = ({ space }: { space: string }): Style => { | ||
return { | ||
gridRowGap: space, | ||
gridColumnGap: space, | ||
}; | ||
}; | ||
|
||
export const gapX = ({ space }: { space: string }): Style => { | ||
return { | ||
gridColumnGap: space, | ||
}; | ||
}; | ||
|
||
export const gapY = ({ space }: { space: string }): Style => { | ||
return { | ||
gridRowGap: space, | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './measure'; | ||
export * from './rhythm'; | ||
export * from './columns'; | ||
|
||
export * from './style-baseline-rel'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Properties } from 'csstype'; | ||
|
||
export const measure = ({ length }: { length: Number }): Properties => { | ||
return { | ||
maxWidth: `${length}ch`, | ||
}; | ||
}; | ||
|
||
export const measureMin = ({ length }: { length: Number }): Properties => { | ||
return { | ||
minWidth: `${length}ch`, | ||
}; | ||
}; | ||
|
||
export const measureMax = ({ length }: { length: Number }): Properties => { | ||
return { | ||
maxWidth: `${length}ch`, | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as CSS from 'csstype'; | ||
|
||
interface Style extends CSS.Properties { | ||
[key: string]: any; | ||
} | ||
|
||
export const rhythm = ({ space }: { space: string }): Style => { | ||
return { | ||
[`& > * + * `]: { | ||
marginTop: space, | ||
}, | ||
}; | ||
}; | ||
|
||
export const rhythmY = ({ space }: { space: string }): Style => { | ||
return { | ||
[`& > * + * `]: { | ||
marginTop: space, | ||
}, | ||
}; | ||
}; | ||
|
||
export const rhythmX = ({ space }: { space: string }): Style => { | ||
return { | ||
[`& > * + * `]: { | ||
marginLeft: space, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.settings.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"baseUrl": "./" | ||
}, | ||
"include": ["src/**/*"] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import url from 'rollup-plugin-url'; | ||
|
||
export const createRollupConfig = pkg => ({ | ||
input: ['src/index.ts'], | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
exports: 'named', | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
exports: 'named', | ||
}, | ||
], | ||
external: [...Object.keys(pkg.peerDependencies || {})], | ||
plugins: [ | ||
typescript({ | ||
clean: true, | ||
typescript: require('typescript'), | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare const __DEV__: boolean; | ||
declare const __PROD__: boolean; | ||
declare const __BROWSER__: boolean; | ||
declare const __SERVER__: boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"files": [], // do not remove! | ||
"extends": "./tsconfig.settings.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"noImplicitAny": false, | ||
"allowSyntheticDefaultImports": true, | ||
"declaration": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"jsx": "react", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"noEmit": true, | ||
"outDir": "./dist", | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": false, | ||
"target": "es5", | ||
"baseUrl": "./", | ||
"noErrorTruncation": true, | ||
"lib": ["es6", "dom"] | ||
}, | ||
"module": "commonjs", | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": ["tslint:latest", "tslint-react"], | ||
"rules": { | ||
"quotemark": [true, "single"], | ||
"no-submodule-imports": false, | ||
"object-literal-sort-keys": false, | ||
"jsx-no-multiline-js": false | ||
} | ||
} |
Oops, something went wrong.