Skip to content

Commit

Permalink
Replace TSDX with custom infra (#55)
Browse files Browse the repository at this point in the history
* Replace TSDX with custom infra

* fix things

* fix lint command

* fix build step
  • Loading branch information
roginfarrer committed Aug 29, 2021
1 parent ce90718 commit 8bbee31
Show file tree
Hide file tree
Showing 8 changed files with 3,064 additions and 3,471 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
@@ -0,0 +1 @@
dist
11 changes: 10 additions & 1 deletion jest.config.js
@@ -1,5 +1,14 @@
module.exports = {
transform: {
'^.+\\.tsx?$': ['esbuild-jest', { sourcemap: true }],
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'],
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
rootDir: '.',
moduleNameMapper: {
'^@/(.*)': '<rootDir>/src/$1',
'^system-props$': '<rootDir>/src',
},
testEnvironment: 'jsdom',
};
43 changes: 20 additions & 23 deletions package.json
Expand Up @@ -8,36 +8,38 @@
"url": "https://github.com/system-props/system-props/issues"
},
"repository": "github:system-props/system-props",
"module": "dist/system-props.esm.js",
"source": "src/index.ts",
"module": "dist/system-props.module.js",
"main": "dist/system-props.cjs",
"exports": "dist/system-props.modern.js",
"unpkg": "dist/system-props.umd.js",
"types": "dist/index.d.ts",
"devDependencies": {
"@rollup/plugin-alias": "^3.1.1",
"@types/jest": "^27.0.1",
"csstype": "^3.0.7",
"eslint-plugin-no-only-tests": "^2.4.0",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.3.0",
"np": "^6.5.0",
"esbuild": "^0.12.24",
"esbuild-jest": "^0.5.0",
"jest": "^27.1.0",
"microbundle": "^0.13.3",
"np": "^7.5.0",
"prettier": "^2.3.0",
"tsdx": "^0.14.1",
"tslib": "^2.0.1",
"typescript": "^4.1.0"
"ts-node": "^10.2.1",
"typescript": "^4.3.0"
},
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"engines": {
"node": ">=10"
"node": ">=12"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint src",
"prepare": "tsdx build",
"format": "yarn lint --fix",
"watch": "microbundle watch",
"build": "microbundle",
"test": "jest",
"lint": "tsc --project tsconfig.json --noEmit",
"format": "prettier --write **/*.{js,ts,tsx,json}",
"clean": "rm -rf node_modules example/node_modules dist",
"release": "np"
},
Expand All @@ -50,10 +52,5 @@
},
"publishConfig": {
"registry": "https://registry.yarnpkg.com"
},
"resolutions": {
"**/typescript": "^4.1.0",
"**/@typescript-eslint/eslint-plugin": "^4.6.1",
"**/@typescript-eslint/parser": "^4.6.1"
}
}
76 changes: 49 additions & 27 deletions src/__tests__/exports.test.ts
Expand Up @@ -2,31 +2,53 @@ import * as AllExports from '..';

test('package has expected exports', () => {
expect(Object.keys(AllExports).sort()).toMatchInlineSnapshot(`
Array [
"background",
"border",
"color",
"createCss",
"createSystem",
"css",
"flexContainer",
"flexItem",
"flexbox",
"grid",
"gridContainer",
"gridItem",
"layout",
"margin",
"padding",
"position",
"propNames",
"pseudoSelectors",
"shadow",
"shouldForwardProp",
"space",
"styledSystemLayout",
"transition",
"typography",
]
`);
Array [
"AllSystemProps",
"BorderProps",
"CSSObject",
"ColorProps",
"FlexContainerProps",
"FlexItemProps",
"FlexboxProps",
"GridContainerProps",
"GridItemProps",
"GridProps",
"LayoutProps",
"MarginProps",
"PaddingProps",
"PositionProps",
"PropConfigCollection",
"ShadowProps",
"SpaceProps",
"SystemProp",
"Theme",
"TransitionProps",
"TypographyProps",
"background",
"border",
"color",
"createCss",
"createSystem",
"css",
"default",
"flexContainer",
"flexItem",
"flexbox",
"grid",
"gridContainer",
"gridItem",
"layout",
"margin",
"padding",
"position",
"propNames",
"pseudoSelectors",
"shadow",
"shouldForwardProp",
"space",
"styledSystemLayout",
"transition",
"typography",
]
`);
});
6 changes: 4 additions & 2 deletions src/types.ts
Expand Up @@ -54,8 +54,10 @@ export type SystemProp<T> =
export type PrefixOptions = 'all' | 'prefix' | 'noprefix';
export type PrefixDefault = 'prefix';

type ScaleLookup<Token extends TokenScales, TTheme extends Theme = Theme> =
KeyOf<TTheme[Token]>;
type ScaleLookup<
Token extends TokenScales,
TTheme extends Theme = Theme
> = KeyOf<TTheme[Token]>;

export type PrefixToken<
Token extends TokenScales,
Expand Down
22 changes: 0 additions & 22 deletions tsdx.config.js

This file was deleted.

0 comments on commit 8bbee31

Please sign in to comment.