Skip to content

Commit 76f8a63

Browse files
committed
outputting declaration files
1 parent c3cf0ca commit 76f8a63

File tree

8 files changed

+11
-40
lines changed

8 files changed

+11
-40
lines changed

dist/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference types="webpack-env" />
2+
import { Application } from '@hotwired/stimulus';
3+
export declare function startStimulusApp(context: __WebpackModuleApi.RequireContext): Application;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function (source: string, sourceMap: string): any;

dist/webpack/loader.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function (source: string): string;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Stimulus integration bridge for Symfony projects",
44
"version": "3.1.0",
55
"main": "dist/index.js",
6-
"types": "types/index.d.ts",
6+
"types": "dist/index.d.ts",
77
"license": "MIT",
88
"author": "Titouan Galopin <[email protected]>",
99
"engines": {
@@ -22,6 +22,7 @@
2222
},
2323
"dependencies": {
2424
"@hotwired/stimulus-webpack-helpers": "^1.0.1",
25+
"@types/webpack-env": "^1.16.4",
2526
"acorn": "^8.0.5",
2627
"loader-utils": "^2.0.0",
2728
"schema-utils": "^3.0.0"
@@ -88,7 +89,6 @@
8889
"files": [
8990
"src/",
9091
"dist/",
91-
"types/",
9292
"controllers.json",
9393
"lazy-controller-loader.js"
9494
]

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers';
1717
// @ts-ignore: Unable to find module
1818
import symfonyControllers from './webpack/loader!@symfony/stimulus-bridge/controllers.json';
1919

20-
export function startStimulusApp(context: any) {
20+
export function startStimulusApp(context: __WebpackModuleApi.RequireContext) {
2121
const application = Application.start();
2222

2323
if (process.env.NODE_ENV === 'development') {

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"outDir": "dist",
1212
"baseUrl": ".",
1313
"noEmit": false,
14-
"declaration": false,
14+
"declaration": true,
15+
"emitDeclarationOnly": true,
1516
"esModuleInterop": true,
1617
"allowSyntheticDefaultImports": true
1718
},
18-
"include": ["src/**/*", "test/**/*"]
19+
"include": ["src/**/*"]
1920
}

types/index.d.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

types/package.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)