Skip to content

Move "types" into the package #55

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

Merged
merged 1 commit into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="webpack-env" />
import { Application } from '@hotwired/stimulus';
export declare function startStimulusApp(context: __WebpackModuleApi.RequireContext): Application;
4 changes: 4 additions & 0 deletions dist/util/get-stimulus-comment-options.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default function (source: string): {
options: {};
errors: any[];
};
4 changes: 4 additions & 0 deletions dist/webpack/create-controllers-module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default function createControllersModule(config: any): {
finalSource: string;
deprecations: string[];
};
1 change: 1 addition & 0 deletions dist/webpack/generate-lazy-controller.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function (controllerPath: string, indentationSpaces: number, exportName?: string): string;
1 change: 1 addition & 0 deletions dist/webpack/lazy-controller-loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function (source: string, sourceMap: string): any;
1 change: 1 addition & 0 deletions dist/webpack/loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function (source: string): string;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"description": "Stimulus integration bridge for Symfony projects",
"version": "3.1.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"author": "Titouan Galopin <[email protected]>",
"engines": {
"node": "^10.13.0 || >=12.0.0"
},
"scripts": {
"build": "yarn rollup -c",
"build-types": "yarn tsc",
"test": "yarn run webpack --config test/webpack.config.js && yarn run jest",
"lint": "yarn run eslint src test",
"format": "prettier src/*.ts test/*.js --write",
Expand All @@ -21,6 +23,7 @@
},
"dependencies": {
"@hotwired/stimulus-webpack-helpers": "^1.0.1",
"@types/webpack-env": "^1.16.4",
"acorn": "^8.0.5",
"loader-utils": "^2.0.0",
"schema-utils": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers';
// @ts-ignore: Unable to find module
import symfonyControllers from './webpack/loader!@symfony/stimulus-bridge/controllers.json';

export function startStimulusApp(context: any) {
export function startStimulusApp(context: __WebpackModuleApi.RequireContext) {
const application = Application.start();

if (process.env.NODE_ENV === 'development') {
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"outDir": "dist",
"baseUrl": ".",
"noEmit": false,
"declaration": false,
"declaration": true,
"emitDeclarationOnly": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*", "test/**/*"]
"include": ["src/**/*"]
}
16 changes: 0 additions & 16 deletions types/index.d.ts

This file was deleted.

19 changes: 0 additions & 19 deletions types/package.json

This file was deleted.