-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(js): add typescript to the js template (algolia/create-instantse…
…arch-app#464) * feat(js): add typescript to the js template based on the (for now) not exported as TS https://github.com/algolia/instantsearch.js/blob/master/src/index.ts * update import method * correct file
- Loading branch information
Showing
5 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3130,7 +3130,7 @@ exports[`Templates InstantSearch.js File content: index.html 1`] = ` | |
<div id=\\"pagination\\"></div> | ||
</div> | ||
<script src=\\"https://cdn.jsdelivr.net/algoliasearch/3.32.0/algoliasearchLite.min.js\\"></script> | ||
<script src=\\"https://cdn.jsdelivr.net/algoliasearch/4.10.4/algoliasearchLite.min.js\\"></script> | ||
<script src=\\"https://cdn.jsdelivr.net/npm/[email protected]\\"></script> | ||
<script src=\\"./src/app.js\\"></script> | ||
</body> | ||
|
@@ -3168,7 +3168,9 @@ exports[`Templates InstantSearch.js File content: package.json 1`] = ` | |
\\"lint\\": \\"eslint .\\", | ||
\\"lint:fix\\": \\"npm run lint -- --fix\\" | ||
}, | ||
\\"partialDependencies\\": {} | ||
\\"partialDependencies\\": { | ||
\\"instantsearch.js\\": \\"3.0.0\\" | ||
} | ||
}" | ||
`; | ||
|
@@ -3277,6 +3279,18 @@ search.addWidgets([ | |
search.start();" | ||
`; | ||
exports[`Templates InstantSearch.js File content: src/global.d.ts 1`] = ` | ||
"import algoliasearch from 'algoliasearch/lite'; | ||
import instantsearch from 'instantsearch.js/dist/instantsearch.production.min'; | ||
declare global { | ||
interface Window { | ||
algoliasearch: typeof algoliasearch; | ||
instantsearch: typeof instantsearch; | ||
} | ||
}" | ||
`; | ||
exports[`Templates InstantSearch.js File content: src/index.css 1`] = ` | ||
"body, | ||
h1 { | ||
|
@@ -3290,6 +3304,27 @@ body { | |
}" | ||
`; | ||
exports[`Templates InstantSearch.js File content: tsconfig.json 1`] = ` | ||
"{ | ||
\\"compilerOptions\\": { | ||
\\"module\\": \\"commonjs\\", | ||
\\"esModuleInterop\\": true, | ||
\\"sourceMap\\": true, | ||
\\"allowJs\\": true, | ||
\\"lib\\": [ | ||
\\"es6\\", | ||
\\"dom\\" | ||
], | ||
\\"rootDir\\": \\"src\\", | ||
\\"moduleResolution\\": \\"node\\" | ||
}, | ||
\\"include\\": [ | ||
\\"src\\", | ||
\\"src/global.d.ts\\" | ||
] | ||
}" | ||
`; | ||
exports[`Templates InstantSearch.js Folder structure: contains the right files 1`] = ` | ||
Array [ | ||
".editorconfig", | ||
|
@@ -3304,7 +3339,9 @@ Array [ | |
"package.json", | ||
"src/app.css", | ||
"src/app.js", | ||
"src/global.d.ts", | ||
"src/index.css", | ||
"tsconfig.json", | ||
] | ||
`; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import algoliasearch from 'algoliasearch/lite'; | ||
import instantsearch from 'instantsearch.js/dist/instantsearch.production.min'; | ||
|
||
declare global { | ||
interface Window { | ||
algoliasearch: typeof algoliasearch; | ||
instantsearch: typeof instantsearch; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"esModuleInterop": true, | ||
"sourceMap": true, | ||
"allowJs": true, | ||
"lib": [ | ||
"es6", | ||
"dom" | ||
], | ||
"rootDir": "src", | ||
"moduleResolution": "node" | ||
}, | ||
"include": [ | ||
"src", | ||
"src/global.d.ts" | ||
] | ||
} |