Skip to content

Commit

Permalink
Generate TypeScript Definitions (#5)
Browse files Browse the repository at this point in the history
* Update workshops submodule

* Upgrade dependencies

* add typescript config + theme files

* Update microbundle + use microbundle for TS compilation

* Use compact selector

* Delete docs submodule
  • Loading branch information
cravend authored Jul 4, 2020
1 parent 22cafcc commit 3937459
Show file tree
Hide file tree
Showing 7 changed files with 2,626 additions and 3,340 deletions.
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"version": "0.1.0-alpha.0",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
]
"packages": ["packages/*"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"prepare": "lerna run prepare",
"clean": "lerna run clean",
"test": "jest",
"fmt": "npx prettier --write \"**/*.js{,on}\" \"**/*.md{,x}\""
"fmt": "npx prettier --write \"**/*.js{,on}\" \"**/*.md{,x}\" \"**/*.ts{,x}\""
},
"workspaces": {
"packages": [
Expand All @@ -20,7 +20,7 @@
"babel-jest": "^25.1.0",
"jest": "^25.1.0",
"lerna": "^3.20.2",
"microbundle": "^0.11.0"
"microbundle": "^0.12.0"
},
"jest": {
"testMatch": [
Expand Down
3 changes: 2 additions & 1 deletion packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"description": "Hack Club’s theme for Theme UI websites",
"version": "0.1.1",
"author": "Lachlan Campbell <lachlan@hackclub.com> (https://lachlanjc.me)",
"source": "src/index.js",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"unpkg": "dist/index.umd.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"scripts": {
"prepare": "rm -rf ./dist && microbundle",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const theme = {
my: 4,
borderCollapse: 'separate',
borderSpacing: 0,
[['th', 'td']]: {
'th,td': {
textAlign: 'left',
py: '4px',
pr: '4px',
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions packages/theme/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
/* Basic Options */
"target": "ES3" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"declaration": true /* Generates corresponding '.d.ts' file. */,
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
"outDir": "./dist" /* Redirect output structure to the directory. */,
"removeComments": true /* Do not emit comments to output. */,

/* Module Resolution Options */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,

/* Advanced Options */
"skipLibCheck": true /* Skip type checking of declaration files. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
}
5,934 changes: 2,601 additions & 3,333 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 3937459

Please sign in to comment.