Skip to content

Refactor and fix tsd generation #20

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 11 commits into from
Feb 22, 2019
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
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ignore built documentation files
documentation/
documentation
out
node_modules
package-lock.json
tsd/types.d.ts
tsd
14 changes: 12 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
!tsd/types.d.ts
intellisense-demo.gif
# keep tsd
!tsd

# ignore other stuff
.git
.gitignore
.travis.yml
documentation/
config.json
after_building.sed
intellisense-demo.gif
README.md
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ node_js:
- node
script:
- npm install -g documentation jsdoc
- documentation build api.js -c documentation.yml
--project-name "SinusBot Scripting Engine" --project-version " "
- documentation build api/ -c documentation.yml
--project-name "SinusBot Scripting Engine" --project-version " " --favicon "/favicon.ico"
--shallow -f html -o documentation
- sed -f after_building.sed -i documentation/index.html
- jsdoc -c config.json || true
- node generate.js
- cp tsd/types.d.ts documentation
deploy:
- provider: pages
Expand Down
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ npm install -g documentation
### Generate html file

```bash
documentation build api.js -c documentation.yml --project-name "SinusBot Scripting Engine" --project-version " " --shallow -f html -o documentation
documentation build api/ -c documentation.yml --project-name "SinusBot Scripting Engine" --project-version " " --shallow -f html -o documentation
```

### Serve locally

```bash
documentation serve api.js -c documentation.yml --project-name "SinusBot Scripting Engine" --project-version " " --shallow -w
documentation serve api/ -c documentation.yml --project-name "SinusBot Scripting Engine" --project-version " " --shallow -w
```

## IntelliSense
Expand All @@ -38,27 +38,15 @@ There are TypeScript typings available which are generated out of the documentat

First of all you need to install the typings by executing: `npm i sinusbot-scripting-engine` or `yarn add sinusbot-scripting-engine`.

After you have the typings installed, you need to create a `jsconfig.json` with the following content:
After you have the typings installed, you need to create a `jsconfig.json` in the folder where you develop your scripts with the following content:

```json
{
"compilerOptions": {
"target": "es5",
"target": "es5", // or "es2018" if sinusbot version >= 1.0.0
"checkJs": true
}
}
```

Or alternatively if you only want to enable type checking for specific files set the config to

```json
{
"compilerOptions": {
"target": "es5"
}
}
```

and add `// @ts-check` as the first line of your script that should be checked.

For reference, you can check out [this repository](https://github.com/SinusBot/scripts).
3 changes: 0 additions & 3 deletions after_building.sed

This file was deleted.

Loading