Skip to content

Commit

Permalink
Merge pull request #6 from SantaClaas/1-improve-typescript-interop-cr…
Browse files Browse the repository at this point in the history
…eate-ts-definitions-from-jsdocjavascript-files

Improve typescript support
  • Loading branch information
SantaClaas authored May 27, 2024
2 parents cc1a0d6 + 7bf2f43 commit 7f1e3c5
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
run: pnpm run build:bundle
- name: Test and ensure dependencies were built as expected
run: pnpm test
- name: Create type definitions
run: pnpm create-definitions
- name: Check if tag is release tag
id: check-tag
run: |
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@ dist-ssr
*.sw?

# Genrated custom build
@material/
@material/

# Generated TypeScript declarations
*.d.ts

# Generated TypeScript declaration maps
*.d.ts.map
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pnpm-lock.yaml
package-lock.json
jsconfig.json
tsconfig.json
example/
material-color-utilities/
# Don't include custom build of material-color-utilities as it will be bundled by "bundledDependencies" in package.json
Expand Down
1 change: 1 addition & 0 deletions default.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* @type {Partial<CustomThemeConfig & { extend: Partial<CustomThemeConfig> }>}
* @private
*/
const defaultConfiguration = {
borderRadius: {
Expand Down
6 changes: 0 additions & 6 deletions jsconfig.json

This file was deleted.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
"url": "https://github.com/SantaClaas/material-tailwind.git"
},
"private": false,
"version": "0.1.1",
"version": "0.2.0",
"type": "module",
"exports": {
".": "./index.js"
},
"scripts": {
"build:bundle": "node ./build.js",
"test": "vitest"
"test": "vitest",
"create-definitions": "tsc"
},
"dependencies": {
"@material/material-color-utilities": "./@material/material-color-utilities",
Expand All @@ -30,6 +31,8 @@
"@material/material-color-utilities"
],
"devDependencies": {
"typescript": "^5.4.5",
"vitest": "^1.5.0"
}
},
"types": "./index.d.ts"
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"exclude": [
"@material",
"example",
"node_modules",
"material-color-utilities"
],
"include": ["index.js"],
"compilerOptions": {
"checkJs": true,
"allowJs": true,
"strict": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true,
"esModuleInterop": true
}
}

0 comments on commit 7f1e3c5

Please sign in to comment.