-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish .d.ts
TypeScript declaration files for plugins
#1892
Comments
This would be very useful. I wonder if it is sufficient to set diff --git a/plugins/block-shareable-procedures/package.json b/plugins/block-shareable-procedures/package.json
index 06f56f7d..02e6f13e 100644
--- a/plugins/block-shareable-procedures/package.json
+++ b/plugins/block-shareable-procedures/package.json
@@ -15,6 +15,7 @@
"main": "./dist/index.js",
"module": "./src/index.js",
"unpkg": "./dist/index.js",
+ "types": "./src/index.d.ts",
"author": "Blockly Team",
"keywords": [
"blockly",
diff --git a/plugins/block-shareable-procedures/tsconfig.json b/plugins/block-shareable-procedures/tsconfig.json
index 6e26e186..42844cb6 100644
--- a/plugins/block-shareable-procedures/tsconfig.json
+++ b/plugins/block-shareable-procedures/tsconfig.json
@@ -5,7 +5,8 @@
"allowJs": true,
"sourceMap": true,
"lib": ["es6", "dom"],
- "moduleResolution": "node"
+ "moduleResolution": "node",
+ "declaration": true,
},
"include": [
"src", "test"
|
I discussed this briefly with Maribeth last Thursday after seeing the forum post. We decided to split this into individual issues for osd, but I didn't follow up with it because I was doing docs Friday. So I'm going to close this issue and split it up by plugin. |
Added a comment to #1871 for tracking dev-create updates. |
Category
Component
All—at least all that are written in TypeScript—most probably via modifications to
dev-scripts
.Is your feature request related to a problem? Please describe.
Users in the forum report issues with their editors and/or builds complaining about missing type declarations.
Describe the solution you'd like
For the plugins that are built from TypeScript source, we should generate a
dist/index.d.ts
file and ensure it is included in the published NPM package.Describe alternatives you've considered
.d.ts
files for TS-sourced plugins and hand roll.d.ts
files or try to use tsickle to translate Closure type declarations for those that are still written in JS—but that seems like a lot of work that might better be spent on porting those plugins to TypeScript.Additional context
It's not immediately obvious whether this can be done merely by modifying
plugins/dev-scripts/config/webpack.config.js
or whether we will additionally have to update all of theplugins/*/tsconfig.json
files (plusdev-create/templates/typescript-*/template/tsconfig.json
).The text was updated successfully, but these errors were encountered: