Please check out the FAQ before creating a new issue 🌹
Before doing any meaningful work or even investigating please create an issue for discussion so we don't have duplicate work and we don't step on your toes.
This project is developed in TypeScript. TypeScript isn't directly supported by Atom, so it requires transpilation into JavaScript. Atom packages are just git tags, so transpiled sources have to be included into version control.
Consequently, please avoid editing files in dist/
directly, since
those are generated and your changes will be gone after the next build.
Also see the Atom contributing guide
Is rather simple. Here are some steps to get you running:
Hack on it using your favorite TypeScript package. There are a couple packages in Atom to select from: https://atom.io/packages/atom-typescript https://atom.io/packages/ide-typescript Prettify the code by running npm run prettier Run static checks with npm test (this will run typecheck and linter, and check if formatting is OK) Run dynamic test-suite with apm test Commit your changes. Repeat steps 4-8 until satisfied. Transpile to JavaScript & bundle by running npm run build and commit transpiled source in dist/ and client/. Create a pull request.
-
Fork the repository (the button in top right corner of GitHub page)
-
Clone your fork
- With SSH:
git clone [email protected]:yourusername/atom-typescript.git
Or
- With HTTPS:
git clone https://github.com/yourusername/atom-typescript.git
Either of these commands will create a working copy of the repository in
atom-typescript
directory.All further commands in this list are assumed to be run from root of the working copy (i.e.
atom-typescript
directory, the one containingpackage.json
) - With SSH:
-
Create a new branch!
git checkout -b my-awesome-contribution
. Please use a meaningful name for your branch. -
Install dependencies with
apm install
.Install development dependencies with
npm install --only=dev
.Run
apm link --dev
to enable your fork in Atom's dev-mode. To check your changes, run Atom in dev-mode (start withatom --dev
or runapplication:open-dev
from command palette).Be careful if you're using
atom-typescript
to hack onatom-typescript
though! You'd be hacking on the software using the same software you're currently hacking on, which sounds somewhat convoluted because it is. See section on workflow below for some tips. -
Hack on it!
-
Prettify the code by running
npm run prettier
-
Run static checks with
npm run test
(this will run typechecker and linter, and check if formatting is OK) -
Run dynamic test-suite with
apm test
(at the moment, it's rather anemic and only checks if package loads at all) -
Commit your changes. Write a meaningful description for your commit! Push often! Repeat steps 5-9 until satisfied.
-
Transpile to JavaScript & bundle by running
npm run build
and commit transpiled source indist/
. -
Create a pull request.
Note: feel free to create pull requests at any stage of the process. Earlier is usually better. For one, creating PRs early is a good way of letting people know you're working on something, which helps avoid effort duplication. Also it will allow maintainers to chime in early and help you avoid pitfalls and common mistakes.
Whenever you pull in latest changes, you should run npm install
.
Whenever we update to latest TypeScript we need to recompile all our js
to make sure everybody gets the same code.
You need to have git. Note on windows long file paths can be an issue so run:
git config --system core.longpaths true
And use Shift+Delete
to delete files if simple delete
doesn't work.
- If you have only fixed bugs in a backward-compatible way (or
consider your changes very minimal), run
apm publish patch
. - If you have implemented new functionality, run
apm publish minor
. (A TypeScript update should at least be minor). - For breaking changes run
apm publish major
. These must be justified with a reason documented inchangelog.md
Additional Notes:
- The
apm
command does a lot for you that you shouldn't do manually. It automatically updates thepackage.json
+creates a git tag
+pushes to git
+pushes to apm
. - On windows : storing your github password using
git config --global credential.helper wincred
helps smooth out theapm publish <type>
experience.
The config schema lives in package.json
. If you change it, update the typings by running npm run gen-config-types
.
We develop atom-typescript with atom-typescript
Some shortcuts:
ctrl+alt+i
orctrl+shift+i
(View → Developer → Toggle Developer Tools... menu item) will open the dev tools. These are the same Chrome dev tools you may be familiar with. Feel free to inspect elements. This will come handy when doing UI or even seeing why a particular code element is highlighted in some way.ctrl+alt+r
orctrl+shift+f5
(window:reload
command) will reload the entire atom instance.
- We open
atom-typescript
source in one Atom window - We have
atom-typescript-examples
open in another atom window as such:atom --dev <examplesFolder>
- We make changes to
atom-typescript
and save to get the JS (optionally runtypescript:build
command to rebuild everything) - We typecheck whole project with
typescript:check-all-files
command to see if our changes accidentally broke anything. - We reload the
atom-typescript-examples
(ctrl+alt+r
orctrl+shift+f5
) window to see the effects of our change. - Only reload the
atom-typescript
window once we are sure that our new code is functional.
This shouldn't happen as long as you start the atom-typescript
window
without the --dev
flag, and do testing in another atom instance. If
you reload the atom-typescript
window thinking its going to be stable
but it turns out to be unstable, discard JavaScript changes that you
think broke it and reload the atom instance.
For example, this will revert to last commit:
git checkout dist
And if you need to go back to master
branch:
git checkout origin/master -- dist
The TypeScript Language service docs: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API
The tsserver
protocol definitions
https://github.com/Microsoft/TypeScript/blob/master/lib/protocol.d.ts
Done using Linter V2 Indie API.