Skip to content

Commit 6654b93

Browse files
authored
Merge pull request #20 from SinusBot/refactor
Refactor and fix tsd generation
2 parents 6dbea96 + 79af2f8 commit 6654b93

27 files changed

+3007
-2805
lines changed

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# ignore built documentation files
2-
documentation/
2+
documentation
33
out
44
node_modules
5-
package-lock.json
6-
tsd/types.d.ts
5+
tsd

.npmignore

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
!tsd/types.d.ts
2-
intellisense-demo.gif
1+
# keep tsd
2+
!tsd
3+
4+
# ignore other stuff
5+
.git
6+
.gitignore
7+
.travis.yml
8+
documentation/
9+
config.json
10+
after_building.sed
11+
intellisense-demo.gif
12+
README.md

.travis.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ node_js:
33
- node
44
script:
55
- npm install -g documentation jsdoc
6-
- documentation build api.js -c documentation.yml
7-
--project-name "SinusBot Scripting Engine" --project-version " "
6+
- documentation build api/ -c documentation.yml
7+
--project-name "SinusBot Scripting Engine" --project-version " " --favicon "/favicon.ico"
88
--shallow -f html -o documentation
9-
- sed -f after_building.sed -i documentation/index.html
109
- jsdoc -c config.json || true
11-
- node generate.js
1210
- cp tsd/types.d.ts documentation
1311
deploy:
1412
- provider: pages

README.md

+4-16
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ npm install -g documentation
1919
### Generate html file
2020

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

2525
### Serve locally
2626

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

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

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

41-
After you have the typings installed, you need to create a `jsconfig.json` with the following content:
41+
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:
4242

4343
```json
4444
{
4545
"compilerOptions": {
46-
"target": "es5",
46+
"target": "es5", // or "es2018" if sinusbot version >= 1.0.0
4747
"checkJs": true
4848
}
4949
}
5050
```
5151

52-
Or alternatively if you only want to enable type checking for specific files set the config to
53-
54-
```json
55-
{
56-
"compilerOptions": {
57-
"target": "es5"
58-
}
59-
}
60-
```
61-
62-
and add `// @ts-check` as the first line of your script that should be checked.
63-
6452
For reference, you can check out [this repository](https://github.com/SinusBot/scripts).

after_building.sed

-3
This file was deleted.

0 commit comments

Comments
 (0)