Skip to content

Remove Grunt #933

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 12 commits into from
Mar 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.baseDir.js
.baseDir.ts
yarn.lock
.nyc_output
yarn-error.log

/src/typings/typescript/typescript.js
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ before_install: >
fi

script:
- npm test
- npm run build_and_test
- npm run lint
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
{
"label": "build",
"type": "shell",
"command": "npm run grunt -- default",
"command": "npm run build",
"problemMatcher": [
"$tsc"
]
},
{
"label": "build_and_test",
"type": "shell",
"command": "npm run grunt -- build_and_test",
"command": "npm run build_and_test",
"problemMatcher": [
"$tsc"
]
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ You can automatically fix some style problems by running `npm run lint -- --fix`

#### Building

To compile the TypeDoc source, run `npm run grunt`. This will start the TypeScript compiler and output the compiled JavaScript to the `dist` folder. If you want to build and test in one step, run `npm run build`.
To compile the TypeDoc source, run `npm run build`. This will start the TypeScript compiler and output the compiled JavaScript to the `dist` folder. If you want to build and test in one step, run `npm run build_and_test`.

#### Testing

TypeDoc includes an extensive set of tests that describe its output. To validate any changes you have made, build the project and then run `npm test`. Alternatively, to rebuild with your changes and then immediately test, run `npm run build`.

If you have changed the TypeDoc output, it will cause tests to fail. Once you have validated that the introduced changes were intended, run `npm run grunt -- update-specs` to update the spec files for the new output.
If you have changed the TypeDoc output, it will cause tests to fail. Once you have validated that the introduced changes were intended, run `node scripts/rebuild_specs` to update the spec files for the new output.

## Pull Requests

Expand Down
39 changes: 11 additions & 28 deletions UPDATING.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,32 @@

## Updating
TypeDoc makes use of internal API methods from the TypeScript compiler - as such you will need
to recompile it for each and every different TypeScript compiler release. If your project doesn't
rely on features from the latest TypeScript compiler, you may be able to get away with using
version of TypeDoc which doesn't target it.
TypeDoc uses internal TypeScript compiler APIs. Since internal APIs can be changed by a minor
release, TypeDoc must target exact TypeScript compiler versions. If your project is using a newer
version of TypeScript than TypeDoc, but does not rely on features from the latest version, you
may be able to get away with using a version of TypeDoc that targets a lower TypeScript version.

If, however, you need the latest version and one hasn't yet been published then these are the steps
If you need the latest version and one hasn't yet been published then these are the steps
you should follow to build your own.

```bash
# Checkout a copy of TypeDoc if you don't have one already
git clone https://github.com/TypeStrong/typedoc typedoc
git clone https://github.com/TypeStrong/typedoc
cd typedoc

# Change the version of TypeScript used by the project
editor package.json

npm install -g grunt-cli # install grunt's CLI globally if you don't have it
npm install # install TypeDoc's dependencies

# Checkout the version of TypeScript you are targetting
git clone https://github.com/Microsoft/TypeScript typescript
cd typescript
git checkout v1.8.10 # checkout the correct version (as set in package.json)
npm install -g jake # install the jake build tool globally if you don't have it
npm install # install TypeScript's build dependencies
jake local # build TypeScript
cd ../

# Setup TypeDoc for your TypeScript version
grunt ts:typescript # compile the internal-API typescript definition files
grunt string-replace:typescript # format the internal-API typescript files

# Build and run the automated TypeDoc tests
grunt build_and_test

# Do a visual inspection to make sure that modules were generated correctly
ls test/render/specs/modules
npm run build_and_test
```

Once this has been done, you should have a functional version of TypeDoc for
your version of TypeScript. If you're so inclined, please open a Pull Request
with your updated project so that others may benefit from the update.
your version of TypeScript. Please open a Pull Request with your updated project
so that others may benefit from the update.

To make use of your version of TypeDoc in a project, point your `package.json`
To use your version of TypeDoc in a project, point your `package.json`
file at it using your GitHub project path.

```json
Expand All @@ -52,4 +35,4 @@ file at it using your GitHub project path.
"typedoc": "mygithubuser/typedoc#v1.8.10"
}
}
```
```
178 changes: 0 additions & 178 deletions gruntfile.js

This file was deleted.

Loading