├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── ROADMAP.md ├── gulpfile.js ├── keymaps └── cr.json ├── lib ├── editor │ ├── actions │ │ ├── console.js │ │ ├── console.js.map │ │ ├── editor.js │ │ ├── editor.js.map │ │ ├── file.js │ │ ├── file.js.map │ │ ├── index.js │ │ ├── index.js.map │ │ ├── quit.js │ │ ├── quit.js.map │ │ ├── tabs.js │ │ ├── tabs.js.map │ │ ├── terminal.js │ │ ├── terminal.js.map │ │ ├── write.js │ │ ├── write.js.map │ │ ├── writeFile.js │ │ └── writeFile.js.map │ ├── compareVersions.js │ ├── compareVersions.js.map │ ├── directory.js │ ├── directory.js.map │ ├── grammar.js │ ├── grammar.js.map │ ├── index.js │ ├── index.js.map │ ├── setup.js │ ├── setup.js.map │ ├── subscriptions.js │ ├── subscriptions.js.map │ ├── ui.js │ ├── ui.js.map │ └── utils │ │ ├── compareVersions.js │ │ ├── compareVersions.js.map │ │ ├── directory.js │ │ ├── directory.js.map │ │ ├── grammar.js │ │ ├── grammar.js.map │ │ ├── setup.js │ │ ├── setup.js.map │ │ ├── subscriptions.js │ │ ├── subscriptions.js.map │ │ ├── ui.js │ │ └── ui.js.map ├── index.js └── index.js.map ├── menus └── cr.json ├── package.json ├── src ├── editor │ ├── actions │ │ ├── console.ts │ │ ├── editor.ts │ │ ├── file.ts │ │ ├── index.ts │ │ ├── quit.ts │ │ ├── tabs.ts │ │ ├── terminal.ts │ │ ├── write.ts │ │ └── writeFile.ts │ ├── index.ts │ └── utils │ │ ├── compareVersions.ts │ │ ├── directory.ts │ │ ├── grammar.ts │ │ ├── setup.tsx │ │ ├── subscriptions.ts │ │ └── ui.ts ├── index.ts ├── typings.json └── typings │ ├── coderoad │ └── core.d.ts │ ├── editor │ └── index.d.ts │ ├── globals │ ├── assertion-error │ │ ├── index.d.ts │ │ └── typings.json │ ├── atom-plugin-command-line │ │ └── index.d.ts │ ├── atom │ │ ├── custom.d.ts │ │ ├── index.d.ts │ │ └── typings.json │ ├── core-js │ │ ├── index.d.ts │ │ └── typings.json │ ├── electron │ │ ├── index.d.ts │ │ └── typings.json │ ├── emissary │ │ ├── index.d.ts │ │ └── typings.json │ ├── jest │ │ ├── index.d.ts │ │ └── typings.json │ ├── jquery │ │ ├── index.d.ts │ │ └── typings.json │ ├── mixto │ │ ├── index.d.ts │ │ └── typings.json │ ├── node-file-exists │ │ └── index.d.ts │ ├── node │ │ ├── index.d.ts │ │ └── typings.json │ ├── pathwatcher │ │ ├── index.d.ts │ │ └── typings.json │ ├── q │ │ ├── index.d.ts │ │ └── typings.json │ ├── redux │ │ ├── index.d.ts │ │ └── typings.json │ ├── rx │ │ ├── index.d.ts │ │ └── typings.json │ ├── sort-package-json │ │ └── index.d.ts │ ├── space-pen │ │ ├── index.d.ts │ │ └── typings.json │ ├── status-bar │ │ ├── index.d.ts │ │ └── typings.json │ └── text-buffer │ │ ├── index.d.ts │ │ └── typings.json │ └── index.d.ts ├── styles └── styles.less ├── tsconfig.json └── tslint.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "extends": "eslint:recommended", 9 | "installedESLint": true, 10 | "parserOptions": { 11 | "ecmaFeatures": { 12 | "experimentalObjectRestSpread": true, 13 | "jsx": true 14 | }, 15 | "sourceType": "module" 16 | }, 17 | "plugins": [ 18 | "react" 19 | ], 20 | "rules": { 21 | "linebreak-style": [ 22 | "error", 23 | "unix" 24 | ], 25 | "quotes": [ 26 | "warning", 27 | "single" 28 | ], 29 | "semi": [ 30 | "warning", 31 | "always" 32 | ] 33 | } 34 | }; -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.html text diff=html 5 | *.css text 6 | *.less text 7 | *.js text 8 | *.ts text 9 | *.json text 10 | 11 | # Denote all files that are truly binary and should not be modified. 12 | *.png binary 13 | *.jpg binary 14 | 15 | # absolute paths are ok, as are globs 16 | /**/postinst* text eol=lf 17 | 18 | # paths that don't start with / are treated relative to the .gitattributes folder 19 | relative/path/*.txt text eol=lf 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Common 2 | .DS_Store 3 | node_modules 4 | npm-debug.log 5 | .vscode 6 | 7 | # Testing 8 | e2e 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Common 2 | .DS_Store 3 | node_modules 4 | npm-debug.log 5 | .gitattributes 6 | .vscode 7 | 8 | # Project 9 | src 10 | .eslintrc 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## [0.14.0] - 2016-09-25 6 | - extract core-coderoad 7 | - minimized atom-coderoad to only Atom specific code 8 | 9 | ## [0.13.3] - 2016-09-16 10 | - display editable Final page 11 | 12 | ## [0.13.2] - 2016-09-15 13 | - tutorial list shows latest tutorial version 14 | - fix empty directory issue 15 | 16 | ## [0.13.0] - 2016-09-14 17 | - improved page open. uses `onDidOpen` callback 18 | - progress reset button 19 | - improved documentation, tests 20 | 21 | ## [0.12.2] - 2016-08-25 22 | - drop "core-coderoad" dependency 23 | - remove additional dependencies for a smaller footprint 24 | 25 | ## [0.12.1] - 2016-08-18 26 | - remove devDependencies, as Atom installs them and slows the install time significantly 27 | - create folders if they do not already exist when writing files 28 | 29 | # [0.12.0] - 2016-08-16 30 | - add 'write' & 'writeFileFrom' actions 31 | 32 | # [0.11.0] - 2016-08-09 33 | - break runner calls into two steps: 34 | - load 35 | - run 36 | - require Atom 1.8+, Node 4+ 37 | 38 | # [0.10.10] - 2016-07-30 39 | - performance increase 40 | - fix test run on page load 41 | 42 | ## [0.10.9] - 2016-07-24 43 | - improved error handling 44 | 45 | ## [0.10.2] - 2016-06-28 46 | - rely on core-coderoad@0.5 47 | - require newer version of test runners 48 | - update to material-ui@0.15.1 49 | 50 | ## [0.10.1] - 2016-06-18 51 | - style fix for Atom 1.9 52 | - rely on core-coderoad@0.4 53 | - drops node-gyp dependency from syntax-highlighter 54 | 55 | ## [0.10.0] - 2016-06-12 56 | - throttle saves at 800ms 57 | - extract common modules into [core-coderoad](https://github.com/coderoad/core-coderoad) to share with the new [tutorial builder](https://github.com/coderoad/builder-coderoad) 58 | 59 | ## [0.9.0] - 2016-05-02 60 | - remove chapters, now only pages 61 | - performance fixes 62 | 63 | ## [0.8.0] - 2016-04-27 64 | - save tutorial progress to localStorage 65 | - check for tutorial package updates 66 | - style fixes 67 | 68 | ## [0.7.0] - 2016-04-23 69 | 70 | #### Features 71 | - much improved setup ui & checks 72 | - check Node, NPM versions 73 | - Stepper UI 74 | - loading tutorials 75 | - attach hints to toolbar 76 | - style fixes for Atom v1.8 77 | 78 | #### Code Base 79 | - follow AirBnB Javascript & React style guides 80 | - update to 'react@15' 81 | - move to 'material-ui@0.15' 82 | - remove 'lodash' dependency 83 | - remove all globals in favor of reducers 84 | 85 | #### Small Breaking Changes 86 | - 'project' renamed 'info' 87 | 88 | ## [0.6.0] - 2016-04-01 89 | - fixes 90 | - loaders now built into atom-coderoad 91 | `// load('file.js')` - loads from workspace directory 92 | `// load('data.js', true)` - loads from tutorial directory 93 | - now allows for easy configuration of different language test runners 94 | 95 | ## [0.5.7] - 2016-03-17 96 | - @action(openConsole) 97 | - style improvements 98 | - bug fixes for Atom 1.6+ 99 | 100 | ## [0.5.6] - 2016-03-12 101 | - fixes for Windows 102 | - no need to pass `handleLog` to test runner 103 | 104 | ## [0.5.4] - 2016-03-09 105 | - fix bug that prevented scroll in Atom 1.6+ 106 | - `< >` button to open console 107 | - match colors to theme 108 | 109 | ## [0.5.3] - 2016-03-07 110 | - fix tutorial progress issues 111 | - use `::>` to set cursor position 112 | 113 | ## [0.5.2] - 2016-03-06 114 | - smoother setup process 115 | - style, ui improvements 116 | 117 | ## [0.5.1] - 2016-03-04 118 | - ui changes 119 | - basic animations 120 | - bug fixes 121 | - @onPageComplete message 122 | 123 | ## [0.4.18] - 2016-02-26 124 | - hints 125 | - improved alerts 126 | - file paths that map to older versions of NPM 127 | - modular/replaceable test runner 128 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to CodeRoad 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | The following is a set of guidelines for contributing to CodeRoad, which is hosted in the [CodeRoad Organization](https://github.com/coderoad) on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request. 6 | 7 | 8 | #### Table Of Contents 9 | 10 | [Code of Conduct](#code-of-conduct) 11 | |* [Tutorials](#tutorials) 12 | |* [Contact](#contact) 13 | 14 | [Contributing](#contributing) 15 | |* [Reporting Bugs](#reporting-bugs) 16 | |* [Suggesting Enhancements](#suggesting-enhancements) 17 | |* [Pull Requests](#pull-requests) 18 | 19 | 20 | ## Code of Conduct 21 | 22 | ### Tutorials 23 | 24 | Tutorial content is owned by the creator. Please take responsibility not to violate any copyright with your contents. 25 | 26 | ### Contact 27 | 28 | Please report any code of conduct issues to [coderoadapp@gmail.com](mailto:coderoadapp@gmail.com). 29 | 30 | 31 | # Contributing 32 | 33 | ### Reporting Bugs 34 | 35 | This section guides you through submitting a bug report for Atom-CodeRoad. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:. 36 | 37 | Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). If you'd like, you can use [this template](#template-for-submitting-bug-reports) to structure the information. 38 | 39 | #### Before Submitting A Bug Report 40 | 41 | * Check if you can reproduce the problem [in the latest version of Atom](https://atom.io/docs/latest/hacking-atom-debugging#update-to-the-latest-version), if the problem happens when you run Atom in [safe mode](https://atom.io/docs/latest/hacking-atom-debugging#check-if-the-problem-shows-up-in-safe-mode), and if you can get the desired behavior by changing [Atom's or packages' config settings](https://atom.io/docs/latest/hacking-atom-debugging#check-atom-and-package-settings). 42 | * **Perform a [cursory search](https://github.com/coderoad/atom-coderoad/issues)** to see if the problem has already been reported. If it has, add a comment to the existing issue instead of opening a new one. 43 | 44 | #### How Do I Submit A (Good) Bug Report? 45 | 46 | Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create [an issue](https://github.com/coderoad/atom-coderoad/issues) at Atom-CodeRoad and provide the following information. 47 | 48 | Explain the problem and include additional details to help maintainers reproduce the problem: 49 | 50 | * **Use a clear and descriptive title** for the issue to identify the problem. 51 | * **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started Atom, e.g. which command exactly you used in the terminal, or how you started Atom otherwise. When listing steps, **don't just say what you did, but explain how you did it**. For example, if you moved the cursor to the end of a line, explain if you used the mouse, or a keyboard shortcut or an Atom command, and if so which one? 52 | * **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). 53 | * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. 54 | * **Explain which behavior you expected to see instead and why.** 55 | * **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. If you use the keyboard while following the steps, **record the GIF with the [Keybinding Resolver](https://github.com/atom/keybinding-resolver) shown**. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on OSX and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. 56 | * **If you're reporting that Atom crashed**, include a crash report with a stack trace from the operating system. On OSX, the crash report will be available in `Console.app` under "Diagnostic and usage information" > "User diagnostic reports". Include the crash report in the issue in a [code block](https://help.github.com/articles/markdown-basics/#multiple-lines), a [file attachment](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/), or put it in a [gist](https://gist.github.com/) and provide link to that gist. 57 | * **If the problem is related to performance**, include a [CPU profile capture and a screenshot](https://atom.io/docs/latest/hacking-atom-debugging#diagnose-performance-problems-with-the-dev-tools-cpu-profiler) with your report. 58 | * **If the Chrome's developer tools pane is shown without you triggering it**, that normally means that an exception was thrown. The Console tab will include an entry for the exception. Expand the exception so that the stack trace is visible, and provide the full exception and stack trace in a [code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines) and as a screenshot. 59 | * **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below. 60 | 61 | Provide more context by answering these questions: 62 | 63 | * **Can you reproduce the problem in [safe mode](https://atom.io/docs/latest/hacking-atom-debugging#check-if-the-problem-shows-up-in-safe-mode)?** 64 | * **Did the problem start happening recently** (e.g. after updating to a new version of Atom) or was this always a problem? 65 | * If the problem started happening recently, **can you reproduce the problem in an older version of Atom-CodeRoad?** What's the most recent version in which the problem doesn't happen? You can download older versions of Atom-CodeRoad from [the releases page](https://github.com/coderoad/atom-coderoad/releases). 66 | * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. 67 | * If the problem is related to working with files (e.g. opening and editing files), **does the problem happen for all files and projects or only some?** Does the problem happen only when working with local or remote files (e.g. on network drives), with files of a specific type (e.g. only JavaScript or Python files), with large files or files with very long lines, or with files in a specific encoding? Is there anything else special about the files you are using? 68 | 69 | Include details about your configuration and environment: 70 | 71 | * **Which version of Atom are you using?** You can get the exact version by running `atom -v` in your terminal, or by starting Atom and running the `Application: About` command from the [Command Palette](https://github.com/atom/command-palette). 72 | * **Which version of Node are you using?** Run `node -v` in your terminal. 73 | * **Which version of NPM are you using?** Run `npm -v` in your terminal. 74 | * **What's the name and version of the OS you're using**? 75 | * **Are you running Atom in a virtual machine?** If so, which VM software are you using and which operating systems and versions are used for the host and the guest? 76 | * **Which [packages](#atom-and-packages) do you have installed?** You can get that list by running `apm list --installed`. 77 | * **Are you using [local configuration files](https://atom.io/docs/latest/using-atom-basic-customization)** `config.cson`, `keymap.cson`, `snippets.cson`, `styles.less` and `init.coffee` to customize Atom? If so, provide the contents of those files, preferably in a [code block](https://help.github.com/articles/markdown-basics/#multiple-lines) or with a link to a [gist](https://gist.github.com/). 78 | * **Are you using Atom with multiple monitors?** If so, can you reproduce the problem when you use a single monitor? 79 | * **Which keyboard layout are you using?** Are you using a US layout or some other layout? 80 | 81 | #### Template For Submitting Bug Reports 82 | 83 | [Short description of problem here] 84 | 85 | **Reproduction Steps:** 86 | 87 | 1. [First Step] 88 | 2. [Second Step] 89 | 3. [Other Steps...] 90 | 91 | **Expected behavior:** 92 | 93 | [Describe expected behavior here] 94 | 95 | **Observed behavior:** 96 | 97 | [Describe observed behavior here] 98 | 99 | **Screenshots and GIFs** 100 | 101 | ![Screenshots and GIFs which follow reproduction steps to demonstrate the problem](url) 102 | 103 | **Atom version:** [Enter Atom version here] 104 | **OS and version:** [Enter OS name and version here] 105 | **NodeJS Version:** [Enter NodeJS name and version here] 106 | **NPM Version:** [Enter NPM name and version here] 107 | 108 | **Installed packages:** 109 | 110 | [List of installed packages here] 111 | 112 | **Additional information:** 113 | 114 | * Problem can be reproduced in safe mode: [Yes/No] 115 | * Problem started happening recently, didn't happen in an older version of Atom: [Yes/No] 116 | * Problem can be reliably reproduced, doesn't happen randomly: [Yes/No] 117 | * Problem happens with all files and projects, not only some files or projects: [Yes/No] 118 | 119 | ### Suggesting Enhancements 120 | 121 | This section guides you through submitting an enhancement suggestion for Atom-CodeRoad, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:. 122 | 123 | Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). If you'd like, you can use [this template](#template-for-submitting-enhancement-suggestions) to structure the information. 124 | 125 | #### Before Submitting An Enhancement Suggestion 126 | 127 | * **Are you using the latest version?** Check if you're using the latest version of Atom-Coderoad. Go to *Atom* -> *preferences* -> *packages* -> search for "atom-coderoad" to find the version. Compare this to the [latest version](https://github.com/coderoad/atom-coderoad/releases). 128 | * **Check if there's already [a package](https://atom.io/packages) which provides that enhancement.** 129 | * **Perform a [cursory search](https://github.com/coderoad/atom-coderoad/issues)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. 130 | 131 | #### How Do I Submit A (Good) Enhancement Suggestion? 132 | 133 | Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). 134 | 135 | * **Use a clear and descriptive title** for the issue to identify the suggestion. 136 | * **Provide a step-by-step description of the suggested enhancement** in as many details as possible. 137 | * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). 138 | * **Describe the current behavior** and **explain which behavior you expected to see instead** and why. 139 | * **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Atom which the suggestion is related to. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on OSX and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. 140 | * **Explain why this enhancement would be useful** to most Atom users and isn't something that can or should be implemented as a [community package](#atom-and-packages). 141 | * **List some other text editors or applications where this enhancement exists.** 142 | * **Specify which version of Atom you're using.** You can get the exact version by running `atom -v` in your terminal, or by starting Atom and running the `Application: About` command from the [Command Palette](https://github.com/atom/command-palette). 143 | * **Specify the name and version of the OS you're using.** 144 | * **Specify the version of NodeJS & NPM you are using.** Run `node -v` & `npm -v` 145 | 146 | #### Template For Submitting Enhancement Suggestions 147 | 148 | [Short description of suggestion] 149 | 150 | **Steps which explain the enhancement** 151 | 152 | 1. [First Step] 153 | 2. [Second Step] 154 | 3. [Other Steps...] 155 | 156 | **Current and suggested behavior** 157 | 158 | [Describe current and suggested behavior here] 159 | 160 | **Why would the enhancement be useful to most users** 161 | 162 | [Explain why the enhancement would be useful to most users] 163 | 164 | [List some other text editors or applications where this enhancement exists] 165 | 166 | **Screenshots and GIFs** 167 | 168 | ![Screenshots and GIFs which demonstrate the steps or part of Atom the enhancement suggestion is related to](url) 169 | 170 | **Atom Version:** [Enter Atom version here] 171 | **OS and Version:** [Enter OS name and version here] 172 | **NodeJS Version:** [Enter NodeJS name and version here] 173 | **NPM Version:** [Enter NPM name and version here] 174 | 175 | ### Pull Requests 176 | 177 | * Include screenshots and animated GIFs in your pull request whenever possible. 178 | * End files with a newline. 179 | 180 | #### Git Commit Messages 181 | 182 | * Use the present tense ("Add feature" not "Added feature") 183 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") 184 | * Limit the first line to 72 characters or less 185 | * Reference issues and pull requests liberally 186 | * When only changing documentation, include `[ci skip]` in the commit description 187 | * Consider starting the commit message with an applicable emoji: 188 | * :art: `:art:` when improving the format/structure of the code 189 | * :racehorse: `:racehorse:` when improving performance 190 | * :non-potable_water: `:non-potable_water:` when plugging memory leaks 191 | * :memo: `:memo:` when writing docs 192 | * :penguin: `:penguin:` when fixing something on Linux 193 | * :apple: `:apple:` when fixing something on Mac OS 194 | * :checkered_flag: `:checkered_flag:` when fixing something on Windows 195 | * :bug: `:bug:` when fixing a bug 196 | * :fire: `:fire:` when removing code or files 197 | * :green_heart: `:green_heart:` when fixing the CI build 198 | * :white_check_mark: `:white_check_mark:` when adding tests 199 | * :lock: `:lock:` when dealing with security 200 | * :arrow_up: `:arrow_up:` when upgrading dependencies 201 | * :arrow_down: `:arrow_down:` when downgrading dependencies 202 | * :shirt: `:shirt:` when removing linter warnings 203 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016 Shawn McKay 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Atom CodeRoad plugin 2 | 3 | Interactive coding tutorials inside of the Atom editor. 4 | 5 | - [Learn more](https://coderoad.github.io) 6 | - [Setup](https://coderoad.github.io/atom-coderoad.html) 7 | - [How CodeRoad Works](https://coderoad.github.io/overview.html) 8 | - [Docs](https://coderoad.github.io/tutorial-docs.html) 9 | - [Tutorials](https://coderoad.github.io/tutorials.html) 10 | - [Project Board](https://github.com/coderoad/atom-coderoad/projects/1) 11 | 12 | 13 | ![Atom-CodeRoad](https://coderoad.github.io/images/demos/atom-coderoad.gif) 14 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Atom CodeRoad Roadmap 2 | 3 | 1. Improved Unit Test Coverage 4 | 1. Improved parsing of markdown -> `coderoad.json` 5 | 1. Coderoad-language packages 6 | 1. Native import/exports 7 | 1. UI Improvements 8 | 1. Modular interfaces 9 | 1. Video Player 10 | 1. Visualize html 11 | 1. More test runners 12 | 1. Elixir 13 | 1. Fix Python 14 | 1. Java 15 | 1. User Accounts 16 | 1. Sync Progress 17 | 1. Basic Analytics 18 | 1. Central DB 19 | 1. Users 20 | 1. Analytics 21 | 1. Tutorial ratings/feedback 22 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const tsConfig = require('tsconfig-glob'); 3 | 4 | gulp.task('tsconfig', () => { 5 | return tsConfig({ 6 | configPath: ".", 7 | cwd: process.cwd(), 8 | indent: 2 9 | }); 10 | }); 11 | 12 | gulp.task('watch', function () { 13 | const tsConfigFile = require('./tsconfig.json'); 14 | gulp.watch(tsConfigFile.filesGlob, ['tsconfig']) 15 | .on('change', reportChange); 16 | }); 17 | 18 | function reportChange(event) { 19 | console.log(`File ${event.path} was ${event.type}, running tasks...`); 20 | } -------------------------------------------------------------------------------- /keymaps/cr.json: -------------------------------------------------------------------------------- 1 | { 2 | "atom-workspace": { 3 | "ctrl-alt-0": "cr-viewer:toggle" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /lib/editor/actions/console.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function toggleDevTools() { 3 | atom.toggleDevTools(); 4 | } 5 | exports.toggleDevTools = toggleDevTools; 6 | function clearConsole() { 7 | atom.executeJavaScriptInDevTools(console.clear()); 8 | } 9 | exports.clearConsole = clearConsole; 10 | function openDevTools() { 11 | atom.openDevTools(); 12 | } 13 | exports.openDevTools = openDevTools; 14 | //# sourceMappingURL=console.js.map -------------------------------------------------------------------------------- /lib/editor/actions/console.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"console.js","sourceRoot":"","sources":["../../../src/editor/actions/console.ts"],"names":[],"mappings":";AAIA;IACE,IAAI,CAAC,cAAc,EAAE,CAAC;AACxB,CAAC;AAFD,wCAEC;AAMD;IACE,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AACpD,CAAC;AAFD,oCAEC;AAMD;IACE,IAAI,CAAC,YAAY,EAAE,CAAC;AACtB,CAAC;AAFD,oCAEC"} -------------------------------------------------------------------------------- /lib/editor/actions/editor.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function getEditor() { 3 | return new Promise(function (resolve, reject) { 4 | var editor = atom.workspace.getActiveTextEditor(); 5 | var checkForEditor = setInterval(function () { 6 | if (editor) { 7 | clearInterval(checkForEditor); 8 | resolve(editor); 9 | } 10 | }, 50); 11 | }); 12 | } 13 | exports.getEditor = getEditor; 14 | //# sourceMappingURL=editor.js.map -------------------------------------------------------------------------------- /lib/editor/actions/editor.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/editor/actions/editor.ts"],"names":[],"mappings":";AAIA;IACE,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;QACpD,IAAI,cAAc,GAAG,WAAW,CAAC;YAC/B,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACX,aAAa,CAAC,cAAc,CAAC,CAAC;gBAC9B,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,8BAUC"} -------------------------------------------------------------------------------- /lib/editor/actions/file.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var editor_1 = require("./editor"); 3 | function openFolder() { 4 | atom.open(); 5 | } 6 | exports.openFolder = openFolder; 7 | function save() { 8 | editor_1.getEditor().then(function (editor) { return editor.save(); }); 9 | } 10 | exports.save = save; 11 | function open(file, options) { 12 | if (options === void 0) { options = {}; } 13 | return new Promise(function (resolve, reject) { 14 | atom.workspace.open(file, options); 15 | atom.workspace.onDidOpen(function () { return resolve(); }); 16 | }); 17 | } 18 | exports.open = open; 19 | function scroll(content) { 20 | return editor_1.getEditor().then(function (editor) { 21 | var regex = new RegExp(content.replace(/[\\\.\+\*\?\^\$\[\]\(\)\{\}\/\'\#\:\!\=\|]/ig, '\\$&'), 'gm'); 22 | return editor.scan(regex, function (scanned) { 23 | var _a = scanned.range.start, row = _a.row, column = _a.column; 24 | editor.setCursorScreenPosition([row + 1, column]); 25 | scanned.stop(); 26 | }); 27 | }); 28 | } 29 | exports.scroll = scroll; 30 | //# sourceMappingURL=file.js.map -------------------------------------------------------------------------------- /lib/editor/actions/file.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/editor/actions/file.ts"],"names":[],"mappings":";AAEA,mCAAmC;AAOnC;IACE,IAAI,CAAC,IAAI,EAAE,CAAC;AACd,CAAC;AAFD,gCAEC;AAMD;IACE,kBAAS,EAAE,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,IAAI,EAAE,EAAb,CAAa,CAAC,CAAC;AAC5C,CAAC;AAFD,oBAEC;AASD,cAAqB,IAAY,EAAE,OAAY;IAAZ,wBAAA,EAAA,YAAY;IAC7C,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAGnC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,cAAM,OAAA,OAAO,EAAE,EAAT,CAAS,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AAPD,oBAOC;AAOD,gBAAuB,OAAe;IACpC,MAAM,CAAC,kBAAS,EAAE,CAAC,IAAI,CAAC,UAAC,MAAwB;QAC/C,IAAM,KAAK,GAAG,IAAI,MAAM,CACtB,OAAO,CAAC,OAAO,CAAC,8CAA8C,EAAE,MAAM,CAAC,EAAE,IAAI,CAC9E,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,UAAC,OAAO;YAC1B,IAAA,wBAAmC,EAAlC,YAAG,EAAE,kBAAM,CAAwB;YAC1C,MAAM,CAAC,uBAAuB,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,wBAWC"} -------------------------------------------------------------------------------- /lib/editor/actions/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var console_1 = require("./console"); 3 | exports.toggleDevTools = console_1.toggleDevTools; 4 | exports.clearConsole = console_1.clearConsole; 5 | exports.openDevTools = console_1.openDevTools; 6 | var editor_1 = require("./editor"); 7 | exports.getEditor = editor_1.getEditor; 8 | var file_1 = require("./file"); 9 | exports.openFolder = file_1.openFolder; 10 | exports.open = file_1.open; 11 | exports.save = file_1.save; 12 | exports.scroll = file_1.scroll; 13 | var write_1 = require("./write"); 14 | exports.set = write_1.set; 15 | exports.insert = write_1.insert; 16 | var writeFile_1 = require("./writeFile"); 17 | exports.writeFileFromContent = writeFile_1.writeFileFromContent; 18 | exports.writeFileFromFile = writeFile_1.writeFileFromFile; 19 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/editor/actions/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/editor/actions/index.ts"],"names":[],"mappings":";AAAA,qCAAqE;AAA7D,mCAAA,cAAc,CAAA;AAAE,iCAAA,YAAY,CAAA;AAAE,iCAAA,YAAY,CAAA;AAClD,mCAAmC;AAA3B,6BAAA,SAAS,CAAA;AACjB,+BAAsD;AAA9C,4BAAA,UAAU,CAAA;AAAE,sBAAA,IAAI,CAAA;AAAE,sBAAA,IAAI,CAAA;AAAE,wBAAA,MAAM,CAAA;AAItC,iCAAoC;AAA5B,sBAAA,GAAG,CAAA;AAAE,yBAAA,MAAM,CAAA;AACnB,yCAAoE;AAA5D,2CAAA,oBAAoB,CAAA;AAAE,wCAAA,iBAAiB,CAAA"} -------------------------------------------------------------------------------- /lib/editor/actions/quit.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function quit() { 3 | } 4 | exports.quit = quit; 5 | //# sourceMappingURL=quit.js.map -------------------------------------------------------------------------------- /lib/editor/actions/quit.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"quit.js","sourceRoot":"","sources":["../../../src/editor/actions/quit.ts"],"names":[],"mappings":";AAAA;AAEA,CAAC;AAFD,oBAEC"} -------------------------------------------------------------------------------- /lib/editor/actions/tabs.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function closeAllPanels() { 3 | var editors = atom.workspace.getTextEditors(); 4 | editors.forEach(function (editor) { 5 | editor.destroy(); 6 | }); 7 | } 8 | exports.closeAllPanels = closeAllPanels; 9 | //# sourceMappingURL=tabs.js.map -------------------------------------------------------------------------------- /lib/editor/actions/tabs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../src/editor/actions/tabs.ts"],"names":[],"mappings":";AAIA;IACE,IAAI,OAAO,GAAuB,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;IAClE,OAAO,CAAC,OAAO,CAAC,UAAC,MAAwB;QAEvC,MAAM,CAAC,OAAO,EAAE,CAAC;IAEnB,CAAC,CAAC,CAAC;AACL,CAAC;AAPD,wCAOC"} -------------------------------------------------------------------------------- /lib/editor/actions/terminal.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function openTerminal() { 3 | return false; 4 | } 5 | exports.openTerminal = openTerminal; 6 | //# sourceMappingURL=terminal.js.map -------------------------------------------------------------------------------- /lib/editor/actions/terminal.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../../src/editor/actions/terminal.ts"],"names":[],"mappings":";AAAA;IAUE,MAAM,CAAC,KAAK,CAAC;AACf,CAAC;AAXD,oCAWC"} -------------------------------------------------------------------------------- /lib/editor/actions/write.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var editor_1 = require("./editor"); 3 | function write(action, text, options) { 4 | if (options === void 0) { options = {}; } 5 | return editor_1.getEditor().then(function (editor) { 6 | editor.moveToBottom(); 7 | editor[action + "Text"](text, options); 8 | editor.insertNewline(); 9 | editor.moveToBottom(); 10 | setCursorPosition(editor); 11 | editor.save(); 12 | }); 13 | } 14 | function set(text) { 15 | return write('set', text); 16 | } 17 | exports.set = set; 18 | function insert(text, options) { 19 | if (options === void 0) { options = {}; } 20 | return write('insert', text, options); 21 | } 22 | exports.insert = insert; 23 | var cursor = /::>/g; 24 | function setCursorPosition(editor) { 25 | return editor.scan(cursor, function (scanned) { 26 | editor.setCursorScreenPosition(scanned.range.start); 27 | scanned.replace(''); 28 | scanned.stop(); 29 | }); 30 | } 31 | //# sourceMappingURL=write.js.map -------------------------------------------------------------------------------- /lib/editor/actions/write.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/editor/actions/write.ts"],"names":[],"mappings":";AAAA,mCAAmC;AASnC,eAAe,MAAwB,EAAE,IAAY,EAAE,OAAY;IAAZ,wBAAA,EAAA,YAAY;IACjE,MAAM,CAAC,kBAAS,EAAE,CAAC,IAAI,CAAC,UAAC,MAAwB;QAC/C,MAAM,CAAC,YAAY,EAAE,CAAC;QACtB,MAAM,CAAI,MAAM,SAAM,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,aAAa,EAAE,CAAC;QACvB,MAAM,CAAC,YAAY,EAAE,CAAC;QACtB,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC1B,MAAM,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAOD,aAAoB,IAAY;IAC9B,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC;AAFD,kBAEC;AAQD,gBAAuB,IAAY,EAAE,OAAY;IAAZ,wBAAA,EAAA,YAAY;IAC/C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAFD,wBAEC;AAED,IAAM,MAAM,GAAW,MAAM,CAAC;AAM9B,2BAA2B,MAAwB;IACjD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAC,OAAO;QACjC,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC"} -------------------------------------------------------------------------------- /lib/editor/actions/writeFile.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var fs_1 = require("fs"); 3 | var node_file_exists_1 = require("node-file-exists"); 4 | var path_1 = require("path"); 5 | function writeFileFromContent(_a) { 6 | var to = _a.to, content = _a.content, dir = _a.dir; 7 | var toAbs = path_1.join(dir, to); 8 | createFolder({ dir: dir, to: to }).then(function () { 9 | fs_1.writeFile(toAbs, content, function (writeErr) { 10 | if (writeErr) { 11 | console.log("Error: tried but failed to write to " + toAbs + " with: " + content, writeErr); 12 | } 13 | console.log('wrote file: ', toAbs); 14 | }); 15 | }); 16 | } 17 | exports.writeFileFromContent = writeFileFromContent; 18 | function writeFileFromFile(_a) { 19 | var to = _a.to, from = _a.from, dir = _a.dir, tutorialDir = _a.tutorialDir; 20 | var toAbs = path_1.join(dir, to); 21 | var fromAbs = path_1.join(tutorialDir, from); 22 | createFolder({ dir: dir, to: to }).then(function () { 23 | fs_1.readFile(fromAbs, 'utf8', function (readErr, data) { 24 | var err = "Error: tried to write '" + fromAbs + "' to '" + toAbs + "' but failed."; 25 | if (readErr) { 26 | console.log(err, readErr); 27 | } 28 | fs_1.writeFile(toAbs, data, function (writeErr) { 29 | if (writeErr) { 30 | console.log(writeErr); 31 | } 32 | console.log("wrote file contents of " + to + " to " + from); 33 | }); 34 | }); 35 | }); 36 | } 37 | exports.writeFileFromFile = writeFileFromFile; 38 | function createFolder(_a) { 39 | var dir = _a.dir, to = _a.to; 40 | return new Promise(function (resolve, reject) { 41 | var folders = to.split('/').slice(0, -1); 42 | if (folders.length === 0) { 43 | resolve(); 44 | } 45 | else { 46 | var current_1 = []; 47 | folders.forEach(function (x) { 48 | current_1.push(x); 49 | var folderPath = path_1.join(dir, current_1.join('/')); 50 | if (!node_file_exists_1.default(folderPath)) { 51 | fs_1.mkdirSync(folderPath); 52 | } 53 | }); 54 | resolve(); 55 | } 56 | }); 57 | } 58 | //# sourceMappingURL=writeFile.js.map -------------------------------------------------------------------------------- /lib/editor/actions/writeFile.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"writeFile.js","sourceRoot":"","sources":["../../../src/editor/actions/writeFile.ts"],"names":[],"mappings":";AAAA,yBAAoD;AACpD,qDAA0C;AAC1C,6BAA4B;AAQ5B,8BAAqC,EAAkB;QAAjB,UAAE,EAAE,oBAAO,EAAE,YAAG;IACpD,IAAM,KAAK,GAAG,WAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAC,GAAG,KAAA,EAAE,EAAE,IAAA,EAAC,CAAC,CAAC,IAAI,CAAC;QAC3B,cAAS,CAAC,KAAK,EAAE,OAAO,EAAE,UAAC,QAAQ;YACjC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,yCAAuC,KAAK,eAAU,OAAS,EAAE,QAAQ,CAAC,CAAC;YACzF,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,oDAUC;AAUD,2BAAkC,EAA4B;QAA3B,UAAE,EAAE,cAAI,EAAE,YAAG,EAAE,4BAAW;IAC3D,IAAM,KAAK,GAAG,WAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAM,OAAO,GAAG,WAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAExC,YAAY,CAAC,EAAC,GAAG,KAAA,EAAE,EAAE,IAAA,EAAC,CAAC,CAAC,IAAI,CAAC;QAE3B,aAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,UAAC,OAAO,EAAE,IAAI;YACtC,IAAM,GAAG,GAAG,4BAA0B,OAAO,cAAS,KAAK,kBAAe,CAAC;YAC3E,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAAC,CAAC;YAC3C,cAAS,CAAC,KAAK,EAAE,IAAI,EAAE,UAAC,QAAQ;gBAC9B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAAC,CAAC;gBACxC,OAAO,CAAC,GAAG,CAAC,4BAA0B,EAAE,YAAO,IAAM,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAfD,8CAeC;AAOD,sBAAsB,EAAS;QAAR,YAAG,EAAE,UAAE;IAC5B,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAEjC,IAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3C,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,OAAO,EAAE,CAAC;QACZ,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,IAAI,SAAO,GAAa,EAAE,CAAC;YAE3B,OAAO,CAAC,OAAO,CAAC,UAAC,CAAS;gBACxB,SAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChB,IAAM,UAAU,GAAG,WAAI,CAAC,GAAG,EAAE,SAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChD,EAAE,CAAC,CAAC,CAAC,0BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;oBAC5B,cAAS,CAAC,UAAU,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"} -------------------------------------------------------------------------------- /lib/editor/compareVersions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function matchVersions(v) { 3 | return v.match(/([0-9]+)\.([0-9]+)/); 4 | } 5 | function isAboveVersion(a, b) { 6 | if (a === b) { 7 | return true; 8 | } 9 | var a_components = a.split('.'); 10 | var b_components = b.split('.'); 11 | var len = Math.min(a_components.length, b_components.length); 12 | for (var i = 0; i < len; i++) { 13 | var first = parseInt(a_components[i], 10); 14 | var second = parseInt(b_components[i], 10); 15 | if (first > second) { 16 | return true; 17 | } 18 | if (first < second) { 19 | return false; 20 | } 21 | } 22 | if (a_components.length > b_components.length) { 23 | return true; 24 | } 25 | if (a_components.length < b_components.length) { 26 | return false; 27 | } 28 | return true; 29 | } 30 | exports.isAboveVersion = isAboveVersion; 31 | //# sourceMappingURL=compareVersions.js.map -------------------------------------------------------------------------------- /lib/editor/compareVersions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"compareVersions.js","sourceRoot":"","sources":["../../src/editor/compareVersions.ts"],"names":[],"mappings":";AAMA,uBAAuB,CAAS;IAC9B,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvC,CAAC;AAQD,wBAA+B,CAAS,EAAE,CAAS;IACjD,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,IAAI,CAAC;IAAC,CAAC;IAC7B,IAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/D,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7C,EAAE,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QAAC,CAAC;QACpC,EAAE,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;YAAC,MAAM,CAAC,KAAK,CAAC;QAAC,CAAC;IACvC,CAAC;IACD,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,IAAI,CAAC;IAAC,CAAC;IAC/D,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,KAAK,CAAC;IAAC,CAAC;IAChE,MAAM,CAAC,IAAI,CAAC;AACd,CAAC;AAde,sBAAc,iBAc7B,CAAA"} -------------------------------------------------------------------------------- /lib/editor/directory.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.directory = function () { 3 | if (atom && atom.project.rootDirectories.length > 0) { 4 | return atom.project.rootDirectories[0].path; 5 | } 6 | return ''; 7 | }; 8 | //# sourceMappingURL=directory.js.map -------------------------------------------------------------------------------- /lib/editor/directory.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"directory.js","sourceRoot":"","sources":["../../src/editor/directory.ts"],"names":[],"mappings":";AAAa,iBAAS,GAAG;IACvB,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,CAAC;IACD,MAAM,CAAC,EAAE,CAAC;AACZ,CAAC,CAAA"} -------------------------------------------------------------------------------- /lib/editor/grammar.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.getFromScope = function (scopeName) { 3 | return atom.grammars.grammarForScopeName(scopeName); 4 | }; 5 | exports.tokenizeLines = function (grammar, text) { return grammar.tokenizeLines(text); }; 6 | ; 7 | //# sourceMappingURL=grammar.js.map -------------------------------------------------------------------------------- /lib/editor/grammar.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"grammar.js","sourceRoot":"","sources":["../../src/editor/grammar.ts"],"names":[],"mappings":";AAAa,oBAAY,GAAG,UAAC,SAAiB;IAC5C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC,CAAA;AAEY,qBAAa,GAAG,UAAC,OAAO,EAAE,IAAY,IAAK,OAAA,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,EAA3B,CAA2B,CAAC;AAAA,CAAC"} -------------------------------------------------------------------------------- /lib/editor/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var action = require("./actions"); 3 | var directory_1 = require("./utils/directory"); 4 | var grammar_1 = require("./utils/grammar"); 5 | var setup_1 = require("./utils/setup"); 6 | var subscriptions_1 = require("./utils/subscriptions"); 7 | var ui_1 = require("./utils/ui"); 8 | var editor = { 9 | action: action, 10 | directory: directory_1.directory, 11 | name: setup_1.name, 12 | grammar: { 13 | getFromScope: grammar_1.getFromScope, 14 | tokenizeLines: grammar_1.tokenizeLines, 15 | }, 16 | version: { 17 | minVersion: setup_1.minVersion, 18 | label: setup_1.versionLabel, 19 | failMessage: setup_1.versionFailMessage, 20 | isAboveMinVersion: setup_1.isAboveMinVersion, 21 | }, 22 | issuesPath: setup_1.issuesPath, 23 | Subscriptions: subscriptions_1.default, 24 | addRightPanel: ui_1.addRightPanel, 25 | }; 26 | Object.defineProperty(exports, "__esModule", { value: true }); 27 | exports.default = editor; 28 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/editor/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":";AAAA,kCAAoC;AACpC,+CAA8C;AAC9C,2CAA8D;AAC9D,uCAGuB;AACvB,uDAAkD;AAClD,iCAAyC;AAEzC,IAAM,MAAM,GAAG;IACb,MAAM,QAAA;IACN,SAAS,uBAAA;IACT,IAAI,cAAA;IACJ,OAAO,EAAE;QACP,YAAY,wBAAA;QACZ,aAAa,yBAAA;KACd;IACD,OAAO,EAAE;QACP,UAAU,oBAAA;QACV,KAAK,EAAE,oBAAY;QACnB,WAAW,EAAE,0BAAkB;QAC/B,iBAAiB,2BAAA;KAClB;IACD,UAAU,oBAAA;IACV,aAAa,yBAAA;IACb,aAAa,oBAAA;CACd,CAAC;;AAEF,kBAAe,MAAM,CAAC"} -------------------------------------------------------------------------------- /lib/editor/setup.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var compareVersions_1 = require('./compareVersions'); 3 | var atom_plugin_command_line_1 = require('atom-plugin-command-line'); 4 | exports.name = 'Atom'; 5 | exports.minVersion = '1.8'; 6 | exports.versionLabel = exports.name + " >= " + exports.minVersion; 7 | exports.versionFailMessage = "\nFirst make sure you have atom shell commands installed.\nClick the atom menu and select \"Install Shell Commands\".\n\nOtherwise, update your version of Atom.\nClick on the blue \"update\" squirrel in the bottom right corner of your editor."; 8 | function isAboveMinVersion() { 9 | return new Promise(function (resolve, reject) { 10 | var minOrLater = atom_plugin_command_line_1.default('atom', '-v').then(function (res) { 11 | var match = res.match(/Atom\s+:\s+([0-9]\.[0-9]\.[0-9])/); 12 | if (match && match[1] && compareVersions_1.isAboveVersion(match[1], exports.minVersion)) { 13 | resolve(true); 14 | } 15 | else { 16 | resolve(false); 17 | } 18 | }); 19 | }); 20 | } 21 | exports.isAboveMinVersion = isAboveMinVersion; 22 | exports.issuesPath = 'https://github.com/coderoad/atom-coderoad/issues'; 23 | //# sourceMappingURL=setup.js.map -------------------------------------------------------------------------------- /lib/editor/setup.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/editor/setup.tsx"],"names":[],"mappings":";AAAA,gCAA6B,mBAAmB,CAAC,CAAA;AACjD,yCAAwB,0BAA0B,CAAC,CAAA;AAEtC,YAAI,GAAG,MAAM,CAAC;AACd,kBAAU,GAAG,KAAK,CAAC;AAEnB,oBAAY,GAAM,YAAI,YAAO,kBAAY,CAAC;AAE1C,0BAAkB,GAAG,oPAK6C,CAAC;AAMhF;IACE,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAI,UAAU,GAAG,kCAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAC,GAAW;YAC1D,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAC1D,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,gCAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,kBAAU,CAAC,CAAC,CAAC,CAAC;gBAC9D,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAXe,yBAAiB,oBAWhC,CAAA;AAEY,kBAAU,GAAG,kDAAkD,CAAC"} -------------------------------------------------------------------------------- /lib/editor/subscriptions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var atom_1 = require('atom'); 3 | var Subscriptions = (function () { 4 | function Subscriptions() { 5 | this.subscriptions = new atom_1.CompositeDisposable(); 6 | } 7 | Subscriptions.prototype.onActivate = function (store, actions) { 8 | var _this = this; 9 | this.subscriptions.add(atom.commands.add('atom-workspace', { 10 | 'cr-viewer:toggle': function () { return store.dispatch(actions.windowToggle()); } 11 | })); 12 | atom.workspace.observeTextEditors(function (editor) { 13 | _this.subscriptions.add(editor.onDidSave(function () { return store.dispatch(actions.testRun()); })); 14 | }); 15 | return this.subscriptions; 16 | }; 17 | Subscriptions.prototype.onDeactivate = function (store) { 18 | store.subscribe(function () { return null; }); 19 | this.subscriptions.dispose(); 20 | }; 21 | return Subscriptions; 22 | }()); 23 | Object.defineProperty(exports, "__esModule", { value: true }); 24 | exports.default = Subscriptions; 25 | //# sourceMappingURL=subscriptions.js.map -------------------------------------------------------------------------------- /lib/editor/subscriptions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/editor/subscriptions.ts"],"names":[],"mappings":";AAAA,qBAAkC,MAAM,CAAC,CAAA;AAEzC;IAAA;QACU,kBAAa,GAAG,IAAI,0BAAmB,EAAE,CAAC;IAsBpD,CAAC;IApBQ,kCAAU,GAAjB,UAAkB,KAAuB,EAAE,OAAO;QAAlD,iBAYC;QAXC,IAAI,CAAC,aAAa,CAAC,GAAG,CACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAClC,kBAAkB,EAAE,cAAM,OAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,EAAtC,CAAsC;SACjE,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,UAAC,MAAwB;YACzD,KAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,cAAM,OAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAjC,CAAiC,CAAC,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEM,oCAAY,GAAnB,UAAoB,KAAuB;QAEzC,KAAK,CAAC,SAAS,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC,CAAC;QAE5B,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IACH,oBAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBD;+BAuBC,CAAA"} -------------------------------------------------------------------------------- /lib/editor/ui.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.addRightPanel = function (panel) { 3 | return atom.workspace.addRightPanel({ 4 | item: panel, 5 | priority: 0, 6 | }); 7 | }; 8 | //# sourceMappingURL=ui.js.map -------------------------------------------------------------------------------- /lib/editor/ui.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/editor/ui.ts"],"names":[],"mappings":";AAAa,qBAAa,GAAG,UAAC,KAAK;IACjC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;QAChC,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,CAAC;KACZ,CAAC,CAAC;AACP,CAAC,CAAC"} -------------------------------------------------------------------------------- /lib/editor/utils/compareVersions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function matchVersions(v) { 3 | return v.match(/([0-9]+)\.([0-9]+)/); 4 | } 5 | function isAboveVersion(a, b) { 6 | if (a === b) { 7 | return true; 8 | } 9 | var a_components = a.split('.'); 10 | var b_components = b.split('.'); 11 | var len = Math.min(a_components.length, b_components.length); 12 | for (var i = 0; i < len; i++) { 13 | var first = parseInt(a_components[i], 10); 14 | var second = parseInt(b_components[i], 10); 15 | if (first > second) { 16 | return true; 17 | } 18 | if (first < second) { 19 | return false; 20 | } 21 | } 22 | if (a_components.length > b_components.length) { 23 | return true; 24 | } 25 | if (a_components.length < b_components.length) { 26 | return false; 27 | } 28 | return true; 29 | } 30 | exports.isAboveVersion = isAboveVersion; 31 | //# sourceMappingURL=compareVersions.js.map -------------------------------------------------------------------------------- /lib/editor/utils/compareVersions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"compareVersions.js","sourceRoot":"","sources":["../../../src/editor/utils/compareVersions.ts"],"names":[],"mappings":";AAMA,uBAAuB,CAAS;IAC9B,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACvC,CAAC;AAQD,wBAA+B,CAAS,EAAE,CAAS;IACjD,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,IAAI,CAAC;IAAC,CAAC;IAC7B,IAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/D,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7C,EAAE,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QAAC,CAAC;QACpC,EAAE,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;YAAC,MAAM,CAAC,KAAK,CAAC;QAAC,CAAC;IACvC,CAAC;IACD,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,IAAI,CAAC;IAAC,CAAC;IAC/D,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,KAAK,CAAC;IAAC,CAAC;IAChE,MAAM,CAAC,IAAI,CAAC;AACd,CAAC;AAdD,wCAcC"} -------------------------------------------------------------------------------- /lib/editor/utils/directory.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.directory = function () { 3 | if (atom && atom.project.rootDirectories.length > 0) { 4 | return atom.project.rootDirectories[0].path; 5 | } 6 | return ''; 7 | }; 8 | //# sourceMappingURL=directory.js.map -------------------------------------------------------------------------------- /lib/editor/utils/directory.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"directory.js","sourceRoot":"","sources":["../../../src/editor/utils/directory.ts"],"names":[],"mappings":";AAAa,QAAA,SAAS,GAAG;IACvB,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9C,CAAC;IACD,MAAM,CAAC,EAAE,CAAC;AACZ,CAAC,CAAA"} -------------------------------------------------------------------------------- /lib/editor/utils/grammar.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.getFromScope = function (scopeName) { 3 | return atom.grammars.grammarForScopeName(scopeName); 4 | }; 5 | exports.tokenizeLines = function (grammar, text) { return grammar.tokenizeLines(text); }; 6 | ; 7 | //# sourceMappingURL=grammar.js.map -------------------------------------------------------------------------------- /lib/editor/utils/grammar.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"grammar.js","sourceRoot":"","sources":["../../../src/editor/utils/grammar.ts"],"names":[],"mappings":";AAAa,QAAA,YAAY,GAAG,UAAC,SAAiB;IAC5C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC,CAAA;AAEY,QAAA,aAAa,GAAG,UAAC,OAAO,EAAE,IAAY,IAAK,OAAA,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,EAA3B,CAA2B,CAAC;AAAA,CAAC"} -------------------------------------------------------------------------------- /lib/editor/utils/setup.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var compareVersions_1 = require("./compareVersions"); 3 | var atom_plugin_command_line_1 = require("atom-plugin-command-line"); 4 | exports.name = 'Atom'; 5 | exports.minVersion = '1.8'; 6 | exports.versionLabel = exports.name + " >= " + exports.minVersion; 7 | exports.versionFailMessage = "\nFirst make sure you have atom shell commands installed.\nClick the atom menu and select \"Install Shell Commands\".\n\nOtherwise, update your version of Atom.\nClick on the blue \"update\" squirrel in the bottom right corner of your editor."; 8 | function isAboveMinVersion() { 9 | return new Promise(function (resolve, reject) { 10 | var minOrLater = atom_plugin_command_line_1.default('atom', '-v').then(function (res) { 11 | var match = res.match(/Atom\s+:\s+([0-9]\.[0-9]\.[0-9])/); 12 | if (match && match[1] && compareVersions_1.isAboveVersion(match[1], exports.minVersion)) { 13 | resolve(true); 14 | } 15 | else { 16 | resolve(false); 17 | } 18 | }); 19 | }); 20 | } 21 | exports.isAboveMinVersion = isAboveMinVersion; 22 | exports.issuesPath = 'https://github.com/coderoad/atom-coderoad/issues'; 23 | //# sourceMappingURL=setup.js.map -------------------------------------------------------------------------------- /lib/editor/utils/setup.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/editor/utils/setup.tsx"],"names":[],"mappings":";AAAA,qDAAiD;AACjD,qEAAmD;AAEtC,QAAA,IAAI,GAAG,MAAM,CAAC;AACd,QAAA,UAAU,GAAG,KAAK,CAAC;AAEnB,QAAA,YAAY,GAAM,YAAI,YAAO,kBAAY,CAAC;AAE1C,QAAA,kBAAkB,GAAG,oPAK6C,CAAC;AAMhF;IACE,MAAM,CAAC,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAI,UAAU,GAAG,kCAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAC,GAAW;YAC1D,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAC1D,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,gCAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,kBAAU,CAAC,CAAC,CAAC,CAAC;gBAC9D,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,8CAWC;AAEY,QAAA,UAAU,GAAG,kDAAkD,CAAC"} -------------------------------------------------------------------------------- /lib/editor/utils/subscriptions.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var atom_1 = require("atom"); 3 | var Subscriptions = (function () { 4 | function Subscriptions() { 5 | this.subscriptions = new atom_1.CompositeDisposable(); 6 | } 7 | Subscriptions.prototype.onActivate = function (store, actions) { 8 | var _this = this; 9 | this.subscriptions.add(atom.commands.add('atom-workspace', { 10 | 'cr-viewer:toggle': function () { return store.dispatch(actions.windowToggle()); } 11 | })); 12 | atom.workspace.observeTextEditors(function (editor) { 13 | _this.subscriptions.add(editor.onDidSave(function () { return store.dispatch(actions.testRun()); })); 14 | }); 15 | return this.subscriptions; 16 | }; 17 | Subscriptions.prototype.onDeactivate = function (store) { 18 | store.subscribe(function () { return null; }); 19 | this.subscriptions.dispose(); 20 | }; 21 | return Subscriptions; 22 | }()); 23 | Object.defineProperty(exports, "__esModule", { value: true }); 24 | exports.default = Subscriptions; 25 | //# sourceMappingURL=subscriptions.js.map -------------------------------------------------------------------------------- /lib/editor/utils/subscriptions.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../src/editor/utils/subscriptions.ts"],"names":[],"mappings":";AAAA,6BAAyC;AAEzC;IAAA;QACU,kBAAa,GAAG,IAAI,0BAAmB,EAAE,CAAC;IAsBpD,CAAC;IApBQ,kCAAU,GAAjB,UAAkB,KAAuB,EAAE,OAAO;QAAlD,iBAYC;QAXC,IAAI,CAAC,aAAa,CAAC,GAAG,CACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAClC,kBAAkB,EAAE,cAAM,OAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,EAAtC,CAAsC;SACjE,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,UAAC,MAAwB;YACzD,KAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,cAAM,OAAA,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAjC,CAAiC,CAAC,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEM,oCAAY,GAAnB,UAAoB,KAAuB;QAEzC,KAAK,CAAC,SAAS,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC,CAAC;QAE5B,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IACH,oBAAC;AAAD,CAAC,AAvBD,IAuBC;;AAvBD,gCAuBC"} -------------------------------------------------------------------------------- /lib/editor/utils/ui.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | exports.addRightPanel = function (panel) { 3 | return atom.workspace.addRightPanel({ 4 | item: panel, 5 | priority: 0, 6 | }); 7 | }; 8 | //# sourceMappingURL=ui.js.map -------------------------------------------------------------------------------- /lib/editor/utils/ui.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/editor/utils/ui.ts"],"names":[],"mappings":";AAAa,QAAA,aAAa,GAAG,UAAC,KAAK;IACjC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;QAChC,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,CAAC;KACZ,CAAC,CAAC;AACP,CAAC,CAAC"} -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var editor_1 = require("./editor"); 3 | var core_coderoad_1 = require("core-coderoad"); 4 | module.exports = core_coderoad_1.default(editor_1.default); 5 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /lib/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,mCAAkC;AAClC,+CAAiC;AAGjC,MAAM,CAAC,OAAO,GAAG,uBAAI,CAAC,gBAAU,CAAC,CAAC"} -------------------------------------------------------------------------------- /menus/cr.json: -------------------------------------------------------------------------------- 1 | { 2 | "menu": [{ 3 | "label": "Packages", 4 | "submenu": [{ 5 | "label": "CodeRoad", 6 | "submenu": [{ 7 | "label": "Toggle", 8 | "command": "cr-viewer:toggle" 9 | }] 10 | }] 11 | }] 12 | } 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atom-coderoad", 3 | "version": "0.13.3", 4 | "description": "Interactive tutorial plugin for Atom", 5 | "keywords": [ 6 | "atom", 7 | "coderoad", 8 | "education", 9 | "learn", 10 | "tutorial" 11 | ], 12 | "bugs": { 13 | "url": "https://github.com/coderoad/atom-coderoad" 14 | }, 15 | "license": "Apache", 16 | "author": "Shawn McKay ", 17 | "files": [ 18 | "package.json", 19 | "keymaps", 20 | "lib", 21 | "menus", 22 | "styles", 23 | "*.md" 24 | ], 25 | "main": "./lib/index.js", 26 | "repository": "https://github.com/coderoad/atom-coderoad", 27 | "scripts": { 28 | "compile": "tsc" 29 | }, 30 | "dependencies": { 31 | "atom-plugin-command-line": "^1.0.2", 32 | "core-coderoad": "1.0.0", 33 | "node-file-exists": "^1.1.0" 34 | }, 35 | "devDependencies": { 36 | "tslint": "^3.15.1", 37 | "tslint-react": "^1.0.0", 38 | "typescript": "^2.0.3" 39 | }, 40 | "engines": { 41 | "atom": ">=1.0.0 <2.0.0" 42 | }, 43 | "activationCommands": { 44 | "atom-workspace": "cr-viewer:toggle" 45 | }, 46 | "consumedServices": { 47 | "status-bar": { 48 | "versions": { 49 | "1.0.0": "consumeStatusBar" 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/editor/actions/console.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Toggle atom devtools console 3 | * @returns void 4 | */ 5 | export function toggleDevTools(): void { 6 | atom.toggleDevTools(); 7 | } 8 | 9 | /** 10 | * Clear atom devtools console 11 | * @returns void 12 | */ 13 | export function clearConsole(): void { 14 | atom.executeJavaScriptInDevTools(console.clear()); 15 | } 16 | 17 | /** 18 | * Open atom devtools 19 | * @returns void 20 | */ 21 | export function openDevTools(): void { 22 | atom.openDevTools(); 23 | } 24 | -------------------------------------------------------------------------------- /src/editor/actions/editor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Get the current active atom editor 3 | * @returns Promise 4 | */ 5 | export function getEditor(): Promise { 6 | return new Promise((resolve, reject) => { 7 | const editor = atom.workspace.getActiveTextEditor(); 8 | let checkForEditor = setInterval(() => { 9 | if (editor) { 10 | clearInterval(checkForEditor); 11 | resolve(editor); 12 | } 13 | }, 50); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /src/editor/actions/file.ts: -------------------------------------------------------------------------------- 1 | import {unlink} from 'fs'; 2 | 3 | import {getEditor} from './editor'; 4 | import fileExists from 'node-file-exists'; 5 | 6 | /** 7 | * Open a new folder in atom 8 | * @returns void 9 | */ 10 | export function openFolder(): void { 11 | atom.open(); 12 | } 13 | 14 | /** 15 | * Saves the current editor 16 | * @returns void 17 | */ 18 | export function save(): void { 19 | getEditor().then(editor => editor.save()); 20 | } 21 | 22 | /** 23 | * Opens a file 24 | * https://atom.io/docs/api/v1.10.2/Workspace#instance-open 25 | * @param {string} file file name 26 | * @param {} options={} file open options 27 | * @returns Promise 28 | */ 29 | export function open(file: string, options = {}): Promise { 30 | return new Promise((resolve, reject) => { 31 | atom.workspace.open(file, options); 32 | // resolve when file opens 33 | // https://atom.io/docs/api/v1.10.2/Workspace#instance-onDidOpen 34 | atom.workspace.onDidOpen(() => resolve()); 35 | }); 36 | } 37 | 38 | /** 39 | * Scroll to cursor position 40 | * @param {string} content text editor content 41 | * @returns Promise 42 | */ 43 | export function scroll(content: string): any { 44 | return getEditor().then((editor: AtomCore.IEditor) => { 45 | const regex = new RegExp( 46 | content.replace(/[\\\.\+\*\?\^\$\[\]\(\)\{\}\/\'\#\:\!\=\|]/ig, '\\$&'), 'gm' 47 | ); 48 | return editor.scan(regex, (scanned) => { 49 | const {row, column} = scanned.range.start; 50 | editor.setCursorScreenPosition([row + 1, column]); 51 | scanned.stop(); 52 | }); 53 | }); 54 | } 55 | -------------------------------------------------------------------------------- /src/editor/actions/index.ts: -------------------------------------------------------------------------------- 1 | export {toggleDevTools, clearConsole, openDevTools} from './console'; 2 | export {getEditor} from './editor'; 3 | export {openFolder, open, save, scroll} from './file'; 4 | // export {quit} from './quit'; 5 | // export {closeAllPanels} from './tabs'; 6 | // export {openTerminal} from './terminal'; 7 | export {set, insert} from './write'; 8 | export {writeFileFromContent, writeFileFromFile} from './writeFile'; 9 | -------------------------------------------------------------------------------- /src/editor/actions/quit.ts: -------------------------------------------------------------------------------- 1 | export function quit(): void { 2 | // TODO: quit without destroying ALL subscriptions 3 | } 4 | -------------------------------------------------------------------------------- /src/editor/actions/tabs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * close all other tabs 3 | * @returns void 4 | */ 5 | export function closeAllPanels(): void { 6 | let editors: AtomCore.IEditor[] = atom.workspace.getTextEditors(); 7 | editors.forEach((editor: AtomCore.IEditor) => { 8 | // if (editor !== activeEditor) { 9 | editor.destroy(); 10 | // } 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /src/editor/actions/terminal.ts: -------------------------------------------------------------------------------- 1 | export function openTerminal(): boolean { 2 | // if (atom.packages.isPackageActive('terminal-plus')) { 3 | // if (!document.getElementsByClassName('xterm')[0]) { 4 | // atom.commands.dispatch( 5 | // document.getElementsByTagName('atom-workspace')[0], 'terminal-plus:toggle' 6 | // ); 7 | // } 8 | // return true; 9 | // } 10 | // return false; 11 | return false; 12 | } 13 | -------------------------------------------------------------------------------- /src/editor/actions/write.ts: -------------------------------------------------------------------------------- 1 | import {getEditor} from './editor'; 2 | 3 | /** 4 | * add text to the active editor 5 | * @param {'set'|'insert'} action 6 | * @param {string} text 7 | * @param {} options={} 8 | * @result Promise 9 | */ 10 | function write(action: 'set' | 'insert', text: string, options = {}): Promise { 11 | return getEditor().then((editor: AtomCore.IEditor) => { 12 | editor.moveToBottom(); 13 | editor[`${action}Text`](text, options); 14 | editor.insertNewline(); 15 | editor.moveToBottom(); 16 | setCursorPosition(editor); 17 | editor.save(); 18 | }); 19 | } 20 | 21 | /** 22 | * set text 23 | * https://atom.io/docs/api/v1.10.2/TextEditor#instance-setText 24 | * @param {string} text 25 | */ 26 | export function set(text: string) { 27 | return write('set', text); 28 | } 29 | 30 | /** 31 | * insert text 32 | * https://atom.io/docs/api/v1.10.2/TextEditor#instance-insertText 33 | * @param {string} text 34 | * @param {} options={} 35 | */ 36 | export function insert(text: string, options = {}) { 37 | return write('insert', text, options); 38 | } 39 | 40 | const cursor: RegExp = /::>/g; 41 | 42 | /** 43 | * replace ::> with cursor position 44 | * @param {AtomCore.IEditor} editor 45 | */ 46 | function setCursorPosition(editor: AtomCore.IEditor) { 47 | return editor.scan(cursor, (scanned) => { 48 | editor.setCursorScreenPosition(scanned.range.start); 49 | scanned.replace(''); 50 | scanned.stop(); 51 | }); 52 | } 53 | -------------------------------------------------------------------------------- /src/editor/actions/writeFile.ts: -------------------------------------------------------------------------------- 1 | import { mkdirSync, readFile, writeFile } from 'fs'; 2 | import fileExists from 'node-file-exists'; 3 | import { join } from 'path'; 4 | 5 | /** 6 | * writes content to a user file 7 | * @param {} {to user file path 8 | * @param {} content text editor content 9 | * @param {} dir} user directory 10 | */ 11 | export function writeFileFromContent({to, content, dir}): void { 12 | const toAbs = join(dir, to); 13 | createFolder({dir, to}).then(() => { 14 | writeFile(toAbs, content, (writeErr) => { 15 | if (writeErr) { 16 | console.log(`Error: tried but failed to write to ${toAbs} with: ${content}`, writeErr); 17 | } 18 | console.log('wrote file: ', toAbs); 19 | }); 20 | }); 21 | } 22 | 23 | /** 24 | * writes from a tutorial file to a user file 25 | * @param {} {to user file path 26 | * @param {} from tutorial file path 27 | * @param {} dir user directory 28 | * @param {} tutorialDir} tutorial directory 29 | * @returns void 30 | */ 31 | export function writeFileFromFile({to, from, dir, tutorialDir}): void { 32 | const toAbs = join(dir, to); 33 | const fromAbs = join(tutorialDir, from); 34 | 35 | createFolder({dir, to}).then(() => { 36 | // writes { to: './dest.js', from: '' } 37 | readFile(fromAbs, 'utf8', (readErr, data) => { 38 | const err = `Error: tried to write '${fromAbs}' to '${toAbs}' but failed.`; 39 | if (readErr) { console.log(err, readErr); } 40 | writeFile(toAbs, data, (writeErr) => { 41 | if (writeErr) { console.log(writeErr); } 42 | console.log(`wrote file contents of ${to} to ${from}`); 43 | }); 44 | }); 45 | }); 46 | } 47 | 48 | /** 49 | * create user folder 50 | * @param {} {dir user directory 51 | * @param {} to} user folder path 52 | */ 53 | function createFolder({dir, to}): Promise { 54 | return new Promise((resolve, reject) => { 55 | // extract folders without final file name 56 | const folders = to.split('/').slice(0, -1); 57 | if (folders.length === 0) { 58 | resolve(); 59 | } else { 60 | let current: string[] = []; 61 | // write each missing folder 62 | folders.forEach((x: string) => { 63 | current.push(x); 64 | const folderPath = join(dir, current.join('/')); 65 | if (!fileExists(folderPath)) { 66 | mkdirSync(folderPath); 67 | } 68 | }); 69 | resolve(); 70 | } 71 | }); 72 | } 73 | -------------------------------------------------------------------------------- /src/editor/index.ts: -------------------------------------------------------------------------------- 1 | import * as action from './actions'; 2 | import { directory } from './utils/directory'; 3 | import { getFromScope, tokenizeLines } from './utils/grammar'; 4 | import { 5 | isAboveMinVersion, issuesPath, minVersion, name, 6 | versionFailMessage, versionLabel 7 | } from './utils/setup'; 8 | import Subscriptions from './utils/subscriptions'; 9 | import {addRightPanel} from './utils/ui'; 10 | 11 | const editor = { 12 | action, 13 | directory, 14 | name, 15 | grammar: { 16 | getFromScope, 17 | tokenizeLines, 18 | }, 19 | version: { 20 | minVersion, 21 | label: versionLabel, 22 | failMessage: versionFailMessage, 23 | isAboveMinVersion, 24 | }, 25 | issuesPath, 26 | Subscriptions, 27 | addRightPanel, 28 | }; 29 | 30 | export default editor; 31 | -------------------------------------------------------------------------------- /src/editor/utils/compareVersions.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * extracts versions intro array from a string 3 | * "0.1.0" -> ['0', '1', '0'] 4 | * or returns null 5 | * @param {string} v 6 | */ 7 | function matchVersions(v: string): string[]|null { 8 | return v.match(/([0-9]+)\.([0-9]+)/); 9 | } 10 | 11 | /** 12 | * checks that a version is >= b version 13 | * @param {string} a 14 | * @param {string} b 15 | * @returns boolean 16 | */ 17 | export function isAboveVersion(a: string, b: string): boolean { 18 | if (a === b) { return true; } 19 | const a_components = a.split('.'); 20 | const b_components = b.split('.'); 21 | const len = Math.min(a_components.length, b_components.length); 22 | for (let i = 0; i < len; i++) { 23 | const first = parseInt(a_components[i], 10); 24 | const second = parseInt(b_components[i], 10); 25 | if (first > second) { return true; } 26 | if (first < second) { return false; } 27 | } 28 | if (a_components.length > b_components.length) { return true; } 29 | if (a_components.length < b_components.length) { return false; } 30 | return true; 31 | } -------------------------------------------------------------------------------- /src/editor/utils/directory.ts: -------------------------------------------------------------------------------- 1 | export const directory = () => { 2 | if (atom && atom.project.rootDirectories.length > 0) { 3 | return atom.project.rootDirectories[0].path; 4 | } 5 | return ''; 6 | } -------------------------------------------------------------------------------- /src/editor/utils/grammar.ts: -------------------------------------------------------------------------------- 1 | export const getFromScope = (scopeName: string) => { 2 | return atom.grammars.grammarForScopeName(scopeName); 3 | } 4 | 5 | export const tokenizeLines = (grammar, text: string) => grammar.tokenizeLines(text);; -------------------------------------------------------------------------------- /src/editor/utils/setup.tsx: -------------------------------------------------------------------------------- 1 | import {isAboveVersion} from './compareVersions'; 2 | import commandLine from 'atom-plugin-command-line'; 3 | 4 | export const name = 'Atom'; 5 | export const minVersion = '1.8'; 6 | 7 | export const versionLabel = `${name} >= ${minVersion}`; 8 | 9 | export const versionFailMessage = ` 10 | First make sure you have atom shell commands installed. 11 | Click the atom menu and select "Install Shell Commands". 12 | 13 | Otherwise, update your version of Atom. 14 | Click on the blue "update" squirrel in the bottom right corner of your editor.`; 15 | 16 | /** 17 | * checks that the version of atom is above a minimum version 18 | * @returns Promise 19 | */ 20 | export function isAboveMinVersion(): Promise { 21 | return new Promise((resolve, reject) => { 22 | let minOrLater = commandLine('atom', '-v').then((res: string) => { 23 | let match = res.match(/Atom\s+:\s+([0-9]\.[0-9]\.[0-9])/); 24 | if (match && match[1] && isAboveVersion(match[1], minVersion)) { 25 | resolve(true); 26 | } else { 27 | resolve(false); 28 | } 29 | }); 30 | }); 31 | } 32 | 33 | export const issuesPath = 'https://github.com/coderoad/atom-coderoad/issues'; 34 | -------------------------------------------------------------------------------- /src/editor/utils/subscriptions.ts: -------------------------------------------------------------------------------- 1 | import {CompositeDisposable} from 'atom'; 2 | 3 | export default class Subscriptions { 4 | private subscriptions = new CompositeDisposable(); 5 | 6 | public onActivate(store: Redux.Store, actions): AtomCore.Disposable { 7 | this.subscriptions.add( 8 | atom.commands.add('atom-workspace', { 9 | 'cr-viewer:toggle': () => store.dispatch(actions.windowToggle()) 10 | }) 11 | ); 12 | // run tests on save 13 | atom.workspace.observeTextEditors((editor: AtomCore.IEditor) => { 14 | this.subscriptions.add(editor.onDidSave(() => store.dispatch(actions.testRun()))); 15 | }); 16 | // return all subscriptions 17 | return this.subscriptions; 18 | } 19 | 20 | public onDeactivate(store: Redux.Store): void { 21 | // unsubscribe from Redux store 22 | store.subscribe(() => null); 23 | // cleanup subscriptions 24 | this.subscriptions.dispose(); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/editor/utils/ui.ts: -------------------------------------------------------------------------------- 1 | export const addRightPanel = (panel) => { 2 | return atom.workspace.addRightPanel({ 3 | item: panel, 4 | priority: 0, 5 | }); 6 | }; 7 | 8 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import atomEditor from './editor'; 2 | import main from 'core-coderoad'; 3 | 4 | // module.exports needed to load commonjs Atom module 5 | module.exports = main(atomEditor); -------------------------------------------------------------------------------- /src/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "assertion-error": "registry:dt/assertion-error#1.0.0+20160316155526", 4 | "atom": "registry:dt/atom#0.0.0+20160505173316", 5 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 6 | "electron": "registry:env/electron#0.37.6+20160909065630", 7 | "emissary": "registry:dt/emissary#0.0.0+20160317120654", 8 | "es6-promise": "registry:dt/es6-promise#0.0.0+20160614011821", 9 | "jest": "registry:dt/jest#0.9.0+20160706021812", 10 | "jquery": "registry:dt/jquery#1.10.0+20160908203239", 11 | "mixto": "registry:dt/mixto#0.0.0+20160317120654", 12 | "node": "registry:dt/node#6.0.0+20160831021119", 13 | "pathwatcher": "registry:dt/pathwatcher#0.0.0+20160317120654", 14 | "q": "registry:dt/q#0.0.0+20160613154756", 15 | "redux": "registry:dt/redux#3.5.2+20160703092728", 16 | "rx": "npm:rx/ts/rx.all.d.ts", 17 | "space-pen": "registry:dt/space-pen#0.0.0+20160316155526", 18 | "status-bar": "registry:dt/status-bar#0.0.0+20160317120654", 19 | "text-buffer": "registry:dt/text-buffer#0.0.0+20160317120654" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/typings/coderoad/core.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'core-coderoad' { 2 | export default function main(editor): any; 3 | } 4 | -------------------------------------------------------------------------------- /src/typings/editor/index.d.ts: -------------------------------------------------------------------------------- 1 | interface IEditor { 2 | action: IEditorActions; 3 | directory: string; 4 | name: 'atom' | 'vscode'; 5 | grammar: { 6 | getFromScope(scope: string): any; 7 | tokenizeLines(lines: string[]): any; 8 | }; 9 | version: { 10 | minVersion: string; 11 | label: string; 12 | failMessage: string; 13 | isAboveVersion(a: string, b: string): boolean; 14 | }; 15 | issuesPath: string; 16 | Subscription: any; 17 | addRightPanel: any; 18 | } 19 | 20 | interface IEditorActions { 21 | toggleDevTools(): any; 22 | clearConsole(): any; 23 | openDevTools(): any; 24 | getEditor(): any; 25 | openFolder(): any; 26 | open(file: string, options?: Object): any; 27 | save(): any; 28 | scroll(content: string): any; 29 | set(text: string): any; 30 | insert(text: string, options?: Object): any; 31 | writeFileFromContent(obj: { 32 | to: string; 33 | content: string; 34 | dir: string; 35 | }): void; 36 | writeFileFromFile(obj: { 37 | to: string; 38 | from: string; 39 | dir: string; 40 | tutorialDir: string; 41 | }): void; 42 | } -------------------------------------------------------------------------------- /src/typings/globals/assertion-error/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/assertion-error/assertion-error.d.ts 3 | declare module 'assertion-error' { 4 | class AssertionError implements Error { 5 | constructor(message: string, props?: any, ssf?: Function); 6 | name: string; 7 | message: string; 8 | showDiff: boolean; 9 | stack: string; 10 | } 11 | export = AssertionError; 12 | } 13 | -------------------------------------------------------------------------------- /src/typings/globals/assertion-error/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/assertion-error/assertion-error.d.ts", 5 | "raw": "registry:dt/assertion-error#1.0.0+20160316155526", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/assertion-error/assertion-error.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/atom-plugin-command-line/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'atom-plugin-command-line' { 2 | export default function commandLine(root: string, commands?: string): Promise; 3 | } 4 | -------------------------------------------------------------------------------- /src/typings/globals/atom/custom.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'atom' { 2 | export interface CompositeDisposable { 3 | constructor: () => any; 4 | dispose: () => any; 5 | add: (...disposables: AtomCore.Disposable[]) => any; 6 | remove: (disposable: AtomCore.Disposable) => any; 7 | clear: () => any; 8 | } 9 | export var CompositeDisposable; 10 | } -------------------------------------------------------------------------------- /src/typings/globals/atom/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/2eaeb872aa33a5f90215ca02d467be7286e741a7/atom/atom.d.ts", 5 | "raw": "registry:dt/atom#0.0.0+20160505173316", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/2eaeb872aa33a5f90215ca02d467be7286e741a7/atom/atom.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/core-js/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/25e18b592470e3dddccc826fde2bb8e7610ef863/core-js/core-js.d.ts", 5 | "raw": "registry:dt/core-js#0.0.0+20160725163759", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/25e18b592470e3dddccc826fde2bb8e7610ef863/core-js/core-js.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/electron/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/types/env-electron/33b7814e99a685288e87a8756167d3230acaefeb/typings.json", 5 | "raw": "registry:env/electron#0.37.6+20160909065630", 6 | "main": "index.d.ts", 7 | "version": "0.37.4", 8 | "files": [ 9 | "index.d.ts", 10 | "lib/app.d.ts", 11 | "lib/auto-updater.d.ts", 12 | "lib/browser-window.d.ts", 13 | "lib/clipboard.d.ts", 14 | "lib/content-tracing.d.ts", 15 | "lib/crash-reporter.d.ts", 16 | "lib/desktop-capturer.d.ts", 17 | "lib/dialog.d.ts", 18 | "lib/download-item.d.ts", 19 | "lib/event-emitter.d.ts", 20 | "lib/file-object.d.ts", 21 | "lib/global-shortcut.d.ts", 22 | "lib/ipc-main.d.ts", 23 | "lib/ipc-renderer.d.ts", 24 | "lib/menu-item.d.ts", 25 | "lib/menu.d.ts", 26 | "lib/native-image.d.ts", 27 | "lib/power-monitor.d.ts", 28 | "lib/power-save-blocker.d.ts", 29 | "lib/protocol.d.ts", 30 | "lib/remote.d.ts", 31 | "lib/screen.d.ts", 32 | "lib/session.d.ts", 33 | "lib/shell.d.ts", 34 | "lib/tray.d.ts", 35 | "lib/web-contents.d.ts", 36 | "lib/web-frame.d.ts", 37 | "lib/web-view.d.ts", 38 | "lib/window-open.d.ts" 39 | ], 40 | "name": "electron", 41 | "type": "typings" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/typings/globals/emissary/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/emissary/emissary.d.ts 3 | declare namespace Emissary { 4 | interface IEmitterStatic extends Mixto.IMixinStatic { 5 | new ():IEmitter; 6 | } 7 | 8 | interface IEmitter { 9 | on(eventNames:string, handler:Function):any; // return value type are Signal 10 | once(eventName:string, handler:Function):any; // return value type are Signal 11 | signal(eventName:string):void; 12 | behavior(eventName:string, initialValue:any):void; 13 | emit(eventName:string, ...args:any[]):void; 14 | off(eventNames:string, handler:Function):void; 15 | pauseEvents(eventNames:string):void; 16 | resumeEvents(eventNames:string):void; 17 | incrementSubscriptionCount(eventName:string):number; 18 | decrementSubscriptionCount(eventName:string):number; 19 | getSubscriptionCount(eventName:string):number; 20 | hasSubscriptions(eventName:string):boolean; 21 | } 22 | 23 | interface ISubscriberStatic extends Mixto.IMixinStatic { 24 | new ():ISubscriber; 25 | } 26 | 27 | interface ISubscriber { 28 | subscribeWith(eventEmitter:any, methodName:string, args:any):ISubscription; 29 | 30 | addSubscription(subscription:any):ISubscription; 31 | 32 | subscribe(eventEmitterOrSubscription:any, ...args:any[]):ISubscription; 33 | 34 | subscribeToCommand(eventEmitter:any, ...args:any[]):ISubscription; 35 | 36 | unsubscribe(object?:any):any; 37 | } 38 | 39 | interface ISubscriptionStatic { 40 | new (emitter: any, eventNames:string, handler:Function):ISubscription; 41 | } 42 | 43 | interface ISubscription extends IEmitter { 44 | cancelled:boolean; 45 | 46 | off():any; 47 | } 48 | } 49 | 50 | declare module "emissary" { 51 | var Emitter:Emissary.IEmitterStatic; 52 | var Subscriber:Emissary.ISubscriberStatic; 53 | var Signal:Function; // TODO 54 | var Behavior:Function; // TODO 55 | var combine:Function; // TODO 56 | } 57 | -------------------------------------------------------------------------------- /src/typings/globals/emissary/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/emissary/emissary.d.ts", 5 | "raw": "registry:dt/emissary#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/emissary/emissary.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/jest/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a14e3e7bca87cead0c25b187f510de34089b9ed7/jest/jest.d.ts 3 | declare function afterEach(fn: jest.EmptyFunction): void; 4 | declare function beforeEach(fn: jest.EmptyFunction): void; 5 | declare function describe(name: string, fn: jest.EmptyFunction): void; 6 | declare var it: jest.It; 7 | declare function pit(name: string, fn: jest.EmptyFunction): void; 8 | 9 | declare function xdescribe(name: string, fn: jest.EmptyFunction): void; 10 | declare function xit(name: string, fn: jest.EmptyFunction): void; 11 | 12 | declare function expect(actual: any): jest.Matchers; 13 | 14 | interface NodeRequire { 15 | requireActual(moduleName: string): any; 16 | } 17 | 18 | declare namespace jest { 19 | function addMatchers(matchers: CustomMatcherFactories): void; 20 | function autoMockOff(): void; 21 | function autoMockOn(): void; 22 | function clearAllTimers(): void; 23 | function currentTestPath(): string; 24 | function disableAutomock(): void; 25 | function fn(implementation?: Function): Mock; 26 | function dontMock(moduleName: string): void; 27 | function genMockFromModule(moduleName: string): Mock; 28 | function mock(moduleName: string, factory?: Function): void; 29 | function runAllTicks(): void; 30 | function runAllTimers(): void; 31 | function runOnlyPendingTimers(): void; 32 | function setMock(moduleName: string, moduleExports: T): void; 33 | function unmock(moduleName: string): void; 34 | 35 | interface EmptyFunction { 36 | (): void; 37 | } 38 | 39 | interface Matchers { 40 | not: Matchers; 41 | toThrow(expected?: any): boolean; 42 | toThrowError(expected?: any): boolean; 43 | toBe(expected: any): boolean; 44 | toEqual(expected: any): boolean; 45 | toBeFalsy(): boolean; 46 | toBeTruthy(): boolean; 47 | toBeNull(): boolean; 48 | toBeDefined(): boolean; 49 | toBeUndefined(): boolean; 50 | toMatch(expected: RegExp): boolean; 51 | toMatchSnapshot(): boolean; 52 | toContain(expected: string): boolean; 53 | toBeCloseTo(expected: number, delta: number): boolean; 54 | toBeGreaterThan(expected: number): boolean; 55 | toBeLessThan(expected: number): boolean; 56 | toBeCalled(): boolean; 57 | toBeCalledWith(...args: any[]): boolean; 58 | lastCalledWith(...args: any[]): boolean; 59 | } 60 | 61 | interface It { 62 | (name: string, fn: EmptyFunction): void; 63 | only(name: string, fn: EmptyFunction): void; 64 | } 65 | 66 | interface Mock { 67 | new (): T; 68 | (...args: any[]): any; // TODO please fix this line! added for TypeScript 1.1.0-1 https://github.com/DefinitelyTyped/DefinitelyTyped/pull/2932 69 | mock: MockContext; 70 | mockClear(): void; 71 | mockImplementation(fn: Function): Mock; 72 | mockImpl(fn: Function): Mock; 73 | mockReturnThis(): Mock; 74 | mockReturnValue(value: any): Mock; 75 | mockReturnValueOnce(value: any): Mock; 76 | } 77 | 78 | interface MockContext { 79 | calls: any[][]; 80 | instances: T[]; 81 | } 82 | 83 | // taken from Jasmine since addMatchers calls into the jasmine api 84 | interface CustomMatcherFactories { 85 | [index: string]: CustomMatcherFactory; 86 | } 87 | 88 | // taken from Jasmine since addMatchers calls into the jasmine api 89 | interface CustomMatcherFactory { 90 | (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; 91 | } 92 | 93 | // taken from Jasmine since addMatchers calls into the jasmine api 94 | interface MatchersUtil { 95 | equals(a: any, b: any, customTesters?: Array): boolean; 96 | contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; 97 | buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; 98 | } 99 | 100 | // taken from Jasmine since addMatchers calls into the jasmine api 101 | interface CustomEqualityTester { 102 | (first: any, second: any): boolean; 103 | } 104 | 105 | // taken from Jasmine since addMatchers calls into the jasmine api 106 | interface CustomMatcher { 107 | compare(actual: T, expected: T): CustomMatcherResult; 108 | compare(actual: any, expected: any): CustomMatcherResult; 109 | } 110 | 111 | // taken from Jasmine since addMatchers calls into the jasmine api 112 | interface CustomMatcherResult { 113 | pass: boolean; 114 | message: string; 115 | } 116 | 117 | // taken from Jasmine which takes from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() 118 | interface ArrayLike { 119 | length: number; 120 | [n: number]: T; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/typings/globals/jest/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a14e3e7bca87cead0c25b187f510de34089b9ed7/jest/jest.d.ts", 5 | "raw": "registry:dt/jest#0.9.0+20160706021812", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a14e3e7bca87cead0c25b187f510de34089b9ed7/jest/jest.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/jquery/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5c7d1fcbea9b14df54fc4554d94cb67dfabffd9a/jquery/jquery.d.ts", 5 | "raw": "registry:dt/jquery#1.10.0+20160908203239", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5c7d1fcbea9b14df54fc4554d94cb67dfabffd9a/jquery/jquery.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/mixto/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mixto/mixto.d.ts 3 | declare namespace Mixto { 4 | interface IMixinStatic { 5 | includeInto(constructor:any):void; 6 | extend(object:any):void; 7 | } 8 | } 9 | 10 | declare module "mixto" { 11 | var _tmp:Mixto.IMixinStatic; 12 | export = _tmp; 13 | } 14 | -------------------------------------------------------------------------------- /src/typings/globals/mixto/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mixto/mixto.d.ts", 5 | "raw": "registry:dt/mixto#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mixto/mixto.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/node-file-exists/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'node-file-exists' { 2 | export default function fileExists(path: string): boolean; 3 | } 4 | -------------------------------------------------------------------------------- /src/typings/globals/node/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/723e5c7a2d4fdb317a162caeee299ecf856b3cac/node/node.d.ts", 5 | "raw": "registry:dt/node#6.0.0+20160831021119", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/723e5c7a2d4fdb317a162caeee299ecf856b3cac/node/node.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/pathwatcher/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/pathwatcher/pathwatcher.d.ts 3 | declare namespace PathWatcher { 4 | interface IFileStatic { 5 | new (path:string, symlink?:boolean):IFile; 6 | } 7 | 8 | interface IFile { 9 | realPath:string; 10 | path:string; 11 | symlink:boolean; 12 | cachedContents:string; 13 | digest:string; 14 | 15 | handleEventSubscriptions():void; 16 | setPath(path:string):void; 17 | getPath():string; 18 | getRealPathSync():string; 19 | getBaseName():string; 20 | write(text:string):void; 21 | readSync(flushCache:boolean):string; 22 | read(flushCache?:boolean):Q.Promise; 23 | // exists():boolean; 24 | existsSync():boolean; 25 | setDigest(contents:string):void; 26 | getDigest():string; 27 | writeFileWithPrivilegeEscalationSync (filePath:string, text:string):void; 28 | handleNativeChangeEvent(eventType:string, eventPath:string):void; 29 | detectResurrectionAfterDelay():void; 30 | detectResurrection():void; 31 | subscribeToNativeChangeEvents():void; 32 | unsubscribeFromNativeChangeEvents():void; 33 | } 34 | 35 | interface IDirectoryStatic { 36 | new (path:string, symlink?:boolean):IDirectory; 37 | } 38 | 39 | interface IDirectory { 40 | realPath:string; 41 | path:string; 42 | symlink:boolean; 43 | 44 | getBaseName():string; 45 | getPath():void; 46 | getRealPathSync():string; 47 | contains(pathToCheck:string):boolean; 48 | relativize(fullPath:string):string; 49 | getEntriesSync():any[]; // return type are {File | Directory}[] 50 | getEntries(callback:Function):void; 51 | subscribeToNativeChangeEvents():void; 52 | unsubscribeFromNativeChangeEvents():void; 53 | isPathPrefixOf(prefix:string, fullPath:string):boolean; 54 | } 55 | } 56 | 57 | declare module "pathwatcher" { 58 | 59 | import events = require("events"); 60 | 61 | interface IHandleWatcher extends events.EventEmitter { 62 | onEvent(event:any, filePath:any, oldFilePath:any):any; 63 | start():void; 64 | closeIfNoListener():void; 65 | close():void; 66 | } 67 | 68 | interface IPathWatcher { 69 | isWatchingParent:boolean; 70 | path:any; 71 | handleWatcher:IHandleWatcher; 72 | 73 | close():void; 74 | } 75 | 76 | function watch(path:string, callback:Function):IPathWatcher; 77 | 78 | function closeAllWatchers():void; 79 | 80 | function getWatchedPaths():string[]; 81 | 82 | var File:PathWatcher.IFileStatic; 83 | var Directory:PathWatcher.IDirectoryStatic; 84 | } 85 | -------------------------------------------------------------------------------- /src/typings/globals/pathwatcher/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/pathwatcher/pathwatcher.d.ts", 5 | "raw": "registry:dt/pathwatcher#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/pathwatcher/pathwatcher.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/q/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/623f30ab194a3486e014ca39bc7f2089897d6ce4/q/Q.d.ts 3 | declare function Q(promise: Q.IPromise): Q.Promise; 4 | /** 5 | * If value is not a promise, returns a promise that is fulfilled with value. 6 | */ 7 | declare function Q(value: T): Q.Promise; 8 | 9 | declare namespace Q { 10 | interface IPromise { 11 | then(onFulfill?: (value: T) => U | IPromise, onReject?: (error: any) => U | IPromise): IPromise; 12 | } 13 | 14 | interface Deferred { 15 | promise: Promise; 16 | resolve(value?: T): void; 17 | resolve(value?: IPromise): void; 18 | reject(reason: any): void; 19 | notify(value: any): void; 20 | makeNodeResolver(): (reason: any, value: T) => void; 21 | } 22 | 23 | interface Promise { 24 | /** 25 | * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. 26 | 27 | * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise returned from callback is finished. 28 | */ 29 | fin(finallyCallback: () => any): Promise; 30 | /** 31 | * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. 32 | 33 | * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise returned from callback is finished. 34 | */ 35 | finally(finallyCallback: () => any): Promise; 36 | 37 | /** 38 | * The then method from the Promises/A+ specification, with an additional progress handler. 39 | */ 40 | then(onFulfill?: (value: T) => U | IPromise, onReject?: (error: any) => U | IPromise, onProgress?: Function): Promise; 41 | 42 | /** 43 | * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. 44 | * 45 | * This is especially useful in conjunction with all 46 | */ 47 | spread(onFulfill: (...args: any[]) => IPromise | U, onReject?: (reason: any) => IPromise | U): Promise; 48 | 49 | fail(onRejected: (reason: any) => U | IPromise): Promise; 50 | 51 | /** 52 | * A sugar method, equivalent to promise.then(undefined, onRejected). 53 | */ 54 | catch(onRejected: (reason: any) => U | IPromise): Promise; 55 | 56 | /** 57 | * A sugar method, equivalent to promise.then(undefined, undefined, onProgress). 58 | */ 59 | progress(onProgress: (progress: any) => any): Promise; 60 | 61 | /** 62 | * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, either because promise is rejected and no onRejected callback was provided, or because onFulfilled or onRejected threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a future turn of the event loop. 63 | * 64 | * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions thrown in then callbacks are consumed and transformed into rejections, exceptions at the end of the chain are easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the event loop, so that it won't be caught, it causes an onerror event on the browser window, or an uncaughtException event on Node.js's process object. 65 | * 66 | * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, exceptions will be delivered there instead of thrown in a future turn. 67 | * 68 | * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends with you, call done to terminate it. 69 | */ 70 | done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; 71 | 72 | /** 73 | * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. If callback is not a function, simply returns promise. 74 | */ 75 | nodeify(callback: (reason: any, value: any) => void): Promise; 76 | 77 | /** 78 | * Returns a promise to get the named property of an object. Essentially equivalent to 79 | * 80 | * promise.then(function (o) { 81 | * return o[propertyName]; 82 | * }); 83 | */ 84 | get(propertyName: String): Promise; 85 | set(propertyName: String, value: any): Promise; 86 | delete(propertyName: String): Promise; 87 | /** 88 | * Returns a promise for the result of calling the named method of an object with the given array of arguments. The object itself is this in the function, just like a synchronous method call. Essentially equivalent to 89 | * 90 | * promise.then(function (o) { 91 | * return o[methodName].apply(o, args); 92 | * }); 93 | */ 94 | post(methodName: String, args: any[]): Promise; 95 | /** 96 | * Returns a promise for the result of calling the named method of an object with the given variadic arguments. The object itself is this in the function, just like a synchronous method call. 97 | */ 98 | invoke(methodName: String, ...args: any[]): Promise; 99 | fapply(args: any[]): Promise; 100 | fcall(...args: any[]): Promise; 101 | 102 | /** 103 | * Returns a promise for an array of the property names of an object. Essentially equivalent to 104 | * 105 | * promise.then(function (o) { 106 | * return Object.keys(o); 107 | * }); 108 | */ 109 | keys(): Promise; 110 | 111 | /** 112 | * A sugar method, equivalent to promise.then(function () { return value; }). 113 | */ 114 | thenResolve(value: U): Promise; 115 | /** 116 | * A sugar method, equivalent to promise.then(function () { throw reason; }). 117 | */ 118 | thenReject(reason: any): Promise; 119 | 120 | /** 121 | * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for that same value, perhaps deferred but not replaced by the promise returned by the onFulfilled handler. 122 | */ 123 | tap(onFulfilled: (value: T) => any): Promise; 124 | 125 | timeout(ms: number, message?: string): Promise; 126 | /** 127 | * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. 128 | */ 129 | delay(ms: number): Promise; 130 | 131 | /** 132 | * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. 133 | */ 134 | isFulfilled(): boolean; 135 | /** 136 | * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. 137 | */ 138 | isRejected(): boolean; 139 | /** 140 | * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. 141 | */ 142 | isPending(): boolean; 143 | 144 | valueOf(): any; 145 | 146 | /** 147 | * Returns a "state snapshot" object, which will be in one of three forms: 148 | * 149 | * - { state: "pending" } 150 | * - { state: "fulfilled", value: } 151 | * - { state: "rejected", reason: } 152 | */ 153 | inspect(): PromiseState; 154 | } 155 | 156 | interface PromiseState { 157 | /** 158 | * "fulfilled", "rejected", "pending" 159 | */ 160 | state: string; 161 | value?: T; 162 | reason?: any; 163 | } 164 | 165 | // If no value provided, returned promise will be of void type 166 | export function when(): Promise; 167 | 168 | // if no fulfill, reject, or progress provided, returned promise will be of same type 169 | export function when(value: T | IPromise): Promise; 170 | 171 | // If a non-promise value is provided, it will not reject or progress 172 | export function when(value: T | IPromise, onFulfilled: (val: T) => U | IPromise, onRejected?: (reason: any) => U | IPromise, onProgress?: (progress: any) => any): Promise; 173 | 174 | /** 175 | * Currently "impossible" (and I use the term loosely) to implement due to TypeScript limitations as it is now. 176 | * See: https://github.com/Microsoft/TypeScript/issues/1784 for discussion on it. 177 | */ 178 | // export function try(method: Function, ...args: any[]): Promise; 179 | 180 | export function fbind(method: (...args: any[]) => T | IPromise, ...args: any[]): (...args: any[]) => Promise; 181 | 182 | export function fcall(method: (...args: any[]) => T, ...args: any[]): Promise; 183 | 184 | export function send(obj: any, functionName: string, ...args: any[]): Promise; 185 | export function invoke(obj: any, functionName: string, ...args: any[]): Promise; 186 | export function mcall(obj: any, functionName: string, ...args: any[]): Promise; 187 | 188 | export function denodeify(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; 189 | export function nbind(nodeFunction: Function, thisArg: any, ...args: any[]): (...args: any[]) => Promise; 190 | export function nfbind(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; 191 | export function nfcall(nodeFunction: Function, ...args: any[]): Promise; 192 | export function nfapply(nodeFunction: Function, args: any[]): Promise; 193 | 194 | export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; 195 | export function npost(nodeModule: any, functionName: string, args: any[]): Promise; 196 | export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; 197 | export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; 198 | 199 | /** 200 | * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. 201 | */ 202 | export function all(promises: [IPromise, IPromise, IPromise, IPromise, IPromise, IPromise]): Promise<[A, B, C, D, E, F]>; 203 | /** 204 | * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. 205 | */ 206 | export function all(promises: [IPromise, IPromise, IPromise, IPromise, IPromise]): Promise<[A, B, C, D, E]>; 207 | /** 208 | * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. 209 | */ 210 | export function all(promises: [IPromise, IPromise, IPromise, IPromise]): Promise<[A, B, C, D]>; 211 | /** 212 | * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. 213 | */ 214 | export function all(promises: [IPromise, IPromise, IPromise]): Promise<[A, B, C]>; 215 | /** 216 | * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. 217 | */ 218 | export function all(promises: [IPromise, IPromise]): Promise<[A, B]>; 219 | /** 220 | * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. 221 | */ 222 | export function all(promises: IPromise[]): Promise; 223 | 224 | /** 225 | * Returns a promise for the first of an array of promises to become settled. 226 | */ 227 | export function race(promises: IPromise[]): Promise; 228 | 229 | /** 230 | * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. 231 | */ 232 | export function allSettled(promises: IPromise[]): Promise[]>; 233 | 234 | export function allResolved(promises: IPromise[]): Promise[]>; 235 | 236 | /** 237 | * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. 238 | * This is especially useful in conjunction with all. 239 | */ 240 | export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U | IPromise, onRejected?: (reason: any) => U | IPromise): Promise; 241 | 242 | /** 243 | * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". 244 | */ 245 | export function timeout(promise: Promise, ms: number, message?: string): Promise; 246 | 247 | /** 248 | * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. 249 | */ 250 | export function delay(promise: Promise, ms: number): Promise; 251 | /** 252 | * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. 253 | */ 254 | export function delay(value: T, ms: number): Promise; 255 | /** 256 | * Returns a promise that will be fulfilled with undefined after at least ms milliseconds have passed. 257 | */ 258 | export function delay(ms: number): Promise ; 259 | /** 260 | * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. 261 | */ 262 | export function isFulfilled(promise: Promise): boolean; 263 | /** 264 | * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. 265 | */ 266 | export function isRejected(promise: Promise): boolean; 267 | /** 268 | * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. 269 | */ 270 | export function isPending(promise: Promise): boolean; 271 | 272 | /** 273 | * Returns a "deferred" object with a: 274 | * promise property 275 | * resolve(value) method 276 | * reject(reason) method 277 | * notify(value) method 278 | * makeNodeResolver() method 279 | */ 280 | export function defer(): Deferred; 281 | 282 | /** 283 | * Returns a promise that is rejected with reason. 284 | */ 285 | export function reject(reason?: any): Promise; 286 | 287 | export function Promise(resolver: (resolve: (val: T | IPromise) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; 288 | 289 | /** 290 | * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. 291 | * 292 | * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that the function always returns a promise even in the face of unintentional thrown exceptions. 293 | */ 294 | export function promised(callback: (...args: any[]) => T): (...args: any[]) => Promise; 295 | 296 | /** 297 | * Returns whether the given value is a Q promise. 298 | */ 299 | export function isPromise(object: any): boolean; 300 | /** 301 | * Returns whether the given value is a promise (i.e. it's an object with a then function). 302 | */ 303 | export function isPromiseAlike(object: any): boolean; 304 | /** 305 | * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. 306 | */ 307 | export function isPending(object: any): boolean; 308 | /** 309 | * If an object is not a promise, it is as "near" as possible. 310 | * If a promise is rejected, it is as "near" as possible too. 311 | * If it’s a fulfilled promise, the fulfillment value is nearer. 312 | * If it’s a deferred promise and the deferred has been resolved, the 313 | * resolution is "nearer". 314 | */ 315 | export function nearer(promise: Promise): T; 316 | 317 | /** 318 | * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. 319 | */ 320 | export function async(generatorFunction: any): (...args: any[]) => Promise; 321 | export function nextTick(callback: Function): void; 322 | 323 | /** 324 | * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the event loop, usually as a result of done. Can be useful for getting the full stack trace of an error in browsers, which is not usually possible with window.onerror. 325 | */ 326 | export var onerror: (reason: any) => void; 327 | /** 328 | * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked across asynchronous promise operations, so that if an uncaught error is thrown by done or a rejection reason's stack property is inspected in a rejection callback, a long stack trace is produced. 329 | */ 330 | export var longStackSupport: boolean; 331 | 332 | /** 333 | * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). 334 | * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. 335 | * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. 336 | * Calling resolve with a non-promise value causes promise to be fulfilled with that value. 337 | */ 338 | export function resolve(object: IPromise): Promise; 339 | /** 340 | * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). 341 | * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. 342 | * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. 343 | * Calling resolve with a non-promise value causes promise to be fulfilled with that value. 344 | */ 345 | export function resolve(object: T): Promise; 346 | 347 | /** 348 | * Resets the global "Q" variable to the value it has before Q was loaded. 349 | * This will either be undefined if there was no version or the version of Q which was already loaded before. 350 | * @returns { The last version of Q. } 351 | */ 352 | export function noConflict(): typeof Q; 353 | } 354 | 355 | declare module "q" { 356 | export = Q; 357 | } 358 | -------------------------------------------------------------------------------- /src/typings/globals/q/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/623f30ab194a3486e014ca39bc7f2089897d6ce4/q/Q.d.ts", 5 | "raw": "registry:dt/q#0.0.0+20160613154756", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/623f30ab194a3486e014ca39bc7f2089897d6ce4/q/Q.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/redux/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/15ddcf312782faf9e7fdfe724a3a29382a5825d7/redux/redux.d.ts 3 | declare namespace Redux { 4 | /** 5 | * An *action* is a plain object that represents an intention to change the 6 | * state. Actions are the only way to get data into the store. Any data, 7 | * whether from UI events, network callbacks, or other sources such as 8 | * WebSockets needs to eventually be dispatched as actions. 9 | * 10 | * Actions must have a `type` field that indicates the type of action being 11 | * performed. Types can be defined as constants and imported from another 12 | * module. It’s better to use strings for `type` than Symbols because strings 13 | * are serializable. 14 | * 15 | * Other than `type`, the structure of an action object is really up to you. 16 | * If you’re interested, check out Flux Standard Action for recommendations on 17 | * how actions should be constructed. 18 | */ 19 | interface Action { 20 | type: any; 21 | } 22 | 23 | 24 | /* reducers */ 25 | 26 | /** 27 | * A *reducer* (also called a *reducing function*) is a function that accepts 28 | * an accumulation and a value and returns a new accumulation. They are used 29 | * to reduce a collection of values down to a single value 30 | * 31 | * Reducers are not unique to Redux—they are a fundamental concept in 32 | * functional programming. Even most non-functional languages, like 33 | * JavaScript, have a built-in API for reducing. In JavaScript, it's 34 | * `Array.prototype.reduce()`. 35 | * 36 | * In Redux, the accumulated value is the state object, and the values being 37 | * accumulated are actions. Reducers calculate a new state given the previous 38 | * state and an action. They must be *pure functions*—functions that return 39 | * the exact same output for given inputs. They should also be free of 40 | * side-effects. This is what enables exciting features like hot reloading and 41 | * time travel. 42 | * 43 | * Reducers are the most important concept in Redux. 44 | * 45 | * *Do not put API calls into reducers.* 46 | * 47 | * @template S State object type. 48 | */ 49 | type Reducer = (state: S, action: A) => S; 50 | 51 | /** 52 | * Object whose values correspond to different reducer functions. 53 | */ 54 | interface ReducersMapObject { 55 | [key: string]: Reducer; 56 | } 57 | 58 | /** 59 | * Turns an object whose values are different reducer functions, into a single 60 | * reducer function. It will call every child reducer, and gather their results 61 | * into a single state object, whose keys correspond to the keys of the passed 62 | * reducer functions. 63 | * 64 | * @template S Combined state object type. 65 | * 66 | * @param reducers An object whose values correspond to different reducer 67 | * functions that need to be combined into one. One handy way to obtain it 68 | * is to use ES6 `import * as reducers` syntax. The reducers may never 69 | * return undefined for any action. Instead, they should return their 70 | * initial state if the state passed to them was undefined, and the current 71 | * state for any unrecognized action. 72 | * 73 | * @returns A reducer function that invokes every reducer inside the passed 74 | * object, and builds a state object with the same shape. 75 | */ 76 | function combineReducers(reducers: ReducersMapObject): Reducer; 77 | 78 | 79 | /* store */ 80 | 81 | /** 82 | * A *dispatching function* (or simply *dispatch function*) is a function that 83 | * accepts an action or an async action; it then may or may not dispatch one 84 | * or more actions to the store. 85 | * 86 | * We must distinguish between dispatching functions in general and the base 87 | * `dispatch` function provided by the store instance without any middleware. 88 | * 89 | * The base dispatch function *always* synchronously sends an action to the 90 | * store’s reducer, along with the previous state returned by the store, to 91 | * calculate a new state. It expects actions to be plain objects ready to be 92 | * consumed by the reducer. 93 | * 94 | * Middleware wraps the base dispatch function. It allows the dispatch 95 | * function to handle async actions in addition to actions. Middleware may 96 | * transform, delay, ignore, or otherwise interpret actions or async actions 97 | * before passing them to the next middleware. 98 | */ 99 | interface Dispatch { 100 | (action: A): A; 101 | } 102 | 103 | /** 104 | * Function to remove listener added by `Store.subscribe()`. 105 | */ 106 | interface Unsubscribe { 107 | (): void; 108 | } 109 | 110 | /** 111 | * A store is an object that holds the application’s state tree. 112 | * There should only be a single store in a Redux app, as the composition 113 | * happens on the reducer level. 114 | * 115 | * @template S State object type. 116 | */ 117 | interface Store { 118 | /** 119 | * Dispatches an action. It is the only way to trigger a state change. 120 | * 121 | * The `reducer` function, used to create the store, will be called with the 122 | * current state tree and the given `action`. Its return value will be 123 | * considered the **next** state of the tree, and the change listeners will 124 | * be notified. 125 | * 126 | * The base implementation only supports plain object actions. If you want 127 | * to dispatch a Promise, an Observable, a thunk, or something else, you 128 | * need to wrap your store creating function into the corresponding 129 | * middleware. For example, see the documentation for the `redux-thunk` 130 | * package. Even the middleware will eventually dispatch plain object 131 | * actions using this method. 132 | * 133 | * @param action A plain object representing “what changed”. It is a good 134 | * idea to keep actions serializable so you can record and replay user 135 | * sessions, or use the time travelling `redux-devtools`. An action must 136 | * have a `type` property which may not be `undefined`. It is a good idea 137 | * to use string constants for action types. 138 | * 139 | * @returns For convenience, the same action object you dispatched. 140 | * 141 | * Note that, if you use a custom middleware, it may wrap `dispatch()` to 142 | * return something else (for example, a Promise you can await). 143 | */ 144 | dispatch: Dispatch; 145 | 146 | /** 147 | * Reads the state tree managed by the store. 148 | * 149 | * @returns The current state tree of your application. 150 | */ 151 | getState(): S; 152 | 153 | /** 154 | * Adds a change listener. It will be called any time an action is 155 | * dispatched, and some part of the state tree may potentially have changed. 156 | * You may then call `getState()` to read the current state tree inside the 157 | * callback. 158 | * 159 | * You may call `dispatch()` from a change listener, with the following 160 | * caveats: 161 | * 162 | * 1. The subscriptions are snapshotted just before every `dispatch()` call. 163 | * If you subscribe or unsubscribe while the listeners are being invoked, 164 | * this will not have any effect on the `dispatch()` that is currently in 165 | * progress. However, the next `dispatch()` call, whether nested or not, 166 | * will use a more recent snapshot of the subscription list. 167 | * 168 | * 2. The listener should not expect to see all states changes, as the state 169 | * might have been updated multiple times during a nested `dispatch()` before 170 | * the listener is called. It is, however, guaranteed that all subscribers 171 | * registered before the `dispatch()` started will be called with the latest 172 | * state by the time it exits. 173 | * 174 | * @param listener A callback to be invoked on every dispatch. 175 | * @returns A function to remove this change listener. 176 | */ 177 | subscribe(listener: () => void): Unsubscribe; 178 | 179 | /** 180 | * Replaces the reducer currently used by the store to calculate the state. 181 | * 182 | * You might need this if your app implements code splitting and you want to 183 | * load some of the reducers dynamically. You might also need this if you 184 | * implement a hot reloading mechanism for Redux. 185 | * 186 | * @param nextReducer The reducer for the store to use instead. 187 | */ 188 | replaceReducer(nextReducer: Reducer): void; 189 | } 190 | 191 | /** 192 | * A store creator is a function that creates a Redux store. Like with 193 | * dispatching function, we must distinguish the base store creator, 194 | * `createStore(reducer, preloadedState)` exported from the Redux package, from 195 | * store creators that are returned from the store enhancers. 196 | * 197 | * @template S State object type. 198 | */ 199 | interface StoreCreator { 200 | (reducer: Reducer, enhancer?: StoreEnhancer): Store; 201 | (reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; 202 | } 203 | 204 | /** 205 | * A store enhancer is a higher-order function that composes a store creator 206 | * to return a new, enhanced store creator. This is similar to middleware in 207 | * that it allows you to alter the store interface in a composable way. 208 | * 209 | * Store enhancers are much the same concept as higher-order components in 210 | * React, which are also occasionally called “component enhancers”. 211 | * 212 | * Because a store is not an instance, but rather a plain-object collection of 213 | * functions, copies can be easily created and modified without mutating the 214 | * original store. There is an example in `compose` documentation 215 | * demonstrating that. 216 | * 217 | * Most likely you’ll never write a store enhancer, but you may use the one 218 | * provided by the developer tools. It is what makes time travel possible 219 | * without the app being aware it is happening. Amusingly, the Redux 220 | * middleware implementation is itself a store enhancer. 221 | */ 222 | type StoreEnhancer = (next: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator; 223 | type GenericStoreEnhancer = (next: StoreEnhancerStoreCreator) => StoreEnhancerStoreCreator; 224 | type StoreEnhancerStoreCreator = (reducer: Reducer, preloadedState?: S) => Store; 225 | 226 | /** 227 | * Creates a Redux store that holds the state tree. 228 | * The only way to change the data in the store is to call `dispatch()` on it. 229 | * 230 | * There should only be a single store in your app. To specify how different 231 | * parts of the state tree respond to actions, you may combine several 232 | * reducers 233 | * into a single reducer function by using `combineReducers`. 234 | * 235 | * @template S State object type. 236 | * 237 | * @param reducer A function that returns the next state tree, given the 238 | * current state tree and the action to handle. 239 | * 240 | * @param [preloadedState] The initial state. You may optionally specify it to 241 | * hydrate the state from the server in universal apps, or to restore a 242 | * previously serialized user session. If you use `combineReducers` to 243 | * produce the root reducer function, this must be an object with the same 244 | * shape as `combineReducers` keys. 245 | * 246 | * @param [enhancer] The store enhancer. You may optionally specify it to 247 | * enhance the store with third-party capabilities such as middleware, time 248 | * travel, persistence, etc. The only store enhancer that ships with Redux 249 | * is `applyMiddleware()`. 250 | * 251 | * @returns A Redux store that lets you read the state, dispatch actions and 252 | * subscribe to changes. 253 | */ 254 | const createStore: StoreCreator; 255 | 256 | 257 | /* middleware */ 258 | 259 | interface MiddlewareAPI { 260 | dispatch: Dispatch; 261 | getState(): S; 262 | } 263 | 264 | /** 265 | * A middleware is a higher-order function that composes a dispatch function 266 | * to return a new dispatch function. It often turns async actions into 267 | * actions. 268 | * 269 | * Middleware is composable using function composition. It is useful for 270 | * logging actions, performing side effects like routing, or turning an 271 | * asynchronous API call into a series of synchronous actions. 272 | */ 273 | interface Middleware { 274 | (api: MiddlewareAPI): (next: Dispatch) => Dispatch; 275 | } 276 | 277 | /** 278 | * Creates a store enhancer that applies middleware to the dispatch method 279 | * of the Redux store. This is handy for a variety of tasks, such as 280 | * expressing asynchronous actions in a concise manner, or logging every 281 | * action payload. 282 | * 283 | * See `redux-thunk` package as an example of the Redux middleware. 284 | * 285 | * Because middleware is potentially asynchronous, this should be the first 286 | * store enhancer in the composition chain. 287 | * 288 | * Note that each middleware will be given the `dispatch` and `getState` 289 | * functions as named arguments. 290 | * 291 | * @param middlewares The middleware chain to be applied. 292 | * @returns A store enhancer applying the middleware. 293 | */ 294 | function applyMiddleware(...middlewares: Middleware[]): GenericStoreEnhancer; 295 | 296 | 297 | /* action creators */ 298 | 299 | /** 300 | * An *action creator* is, quite simply, a function that creates an action. Do 301 | * not confuse the two terms—again, an action is a payload of information, and 302 | * an action creator is a factory that creates an action. 303 | * 304 | * Calling an action creator only produces an action, but does not dispatch 305 | * it. You need to call the store’s `dispatch` function to actually cause the 306 | * mutation. Sometimes we say *bound action creators* to mean functions that 307 | * call an action creator and immediately dispatch its result to a specific 308 | * store instance. 309 | * 310 | * If an action creator needs to read the current state, perform an API call, 311 | * or cause a side effect, like a routing transition, it should return an 312 | * async action instead of an action. 313 | * 314 | * @template A Returned action type. 315 | */ 316 | interface ActionCreator { 317 | (...args: any[]): A; 318 | } 319 | 320 | /** 321 | * Object whose values are action creator functions. 322 | */ 323 | interface ActionCreatorsMapObject { 324 | [key: string]: ActionCreator; 325 | } 326 | 327 | /** 328 | * Turns an object whose values are action creators, into an object with the 329 | * same keys, but with every function wrapped into a `dispatch` call so they 330 | * may be invoked directly. This is just a convenience method, as you can call 331 | * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. 332 | * 333 | * For convenience, you can also pass a single function as the first argument, 334 | * and get a function in return. 335 | * 336 | * @param actionCreator An object whose values are action creator functions. 337 | * One handy way to obtain it is to use ES6 `import * as` syntax. You may 338 | * also pass a single function. 339 | * 340 | * @param dispatch The `dispatch` function available on your Redux store. 341 | * 342 | * @returns The object mimicking the original object, but with every action 343 | * creator wrapped into the `dispatch` call. If you passed a function as 344 | * `actionCreator`, the return value will also be a single function. 345 | */ 346 | function bindActionCreators>(actionCreator: A, dispatch: Dispatch): A; 347 | 348 | function bindActionCreators< 349 | A extends ActionCreator, 350 | B extends ActionCreator 351 | >(actionCreator: A, dispatch: Dispatch): B; 352 | 353 | function bindActionCreators(actionCreators: M, dispatch: Dispatch): M; 354 | 355 | function bindActionCreators< 356 | M extends ActionCreatorsMapObject, 357 | N extends ActionCreatorsMapObject 358 | >(actionCreators: M, dispatch: Dispatch): N; 359 | 360 | 361 | /* compose */ 362 | 363 | /** 364 | * Composes single-argument functions from right to left. The rightmost 365 | * function can take multiple arguments as it provides the signature for the 366 | * resulting composite function. 367 | * 368 | * @param funcs The functions to compose. 369 | * @returns R function obtained by composing the argument functions from right 370 | * to left. For example, `compose(f, g, h)` is identical to doing 371 | * `(...args) => f(g(h(...args)))`. 372 | */ 373 | function compose(): (a: R, ...args: any[]) => R; 374 | 375 | function compose( 376 | f1: (b: A) => R, 377 | f2: (...args: any[]) => A 378 | ): (...args: any[]) => R; 379 | 380 | function compose( 381 | f1: (b: B) => R, 382 | f2: (a: A) => B, 383 | f3: (...args: any[]) => A 384 | ): (...args: any[]) => R; 385 | 386 | function compose( 387 | f1: (b: C) => R, 388 | f2: (a: B) => C, 389 | f3: (a: A) => B, 390 | f4: (...args: any[]) => A 391 | ): (...args: any[]) => R; 392 | 393 | function compose( 394 | f1: (a: any) => R, 395 | ...funcs: Function[] 396 | ): (...args: any[]) => R; 397 | } 398 | 399 | declare module "redux" { 400 | export = Redux; 401 | } 402 | -------------------------------------------------------------------------------- /src/typings/globals/redux/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/15ddcf312782faf9e7fdfe724a3a29382a5825d7/redux/redux.d.ts", 5 | "raw": "registry:dt/redux#3.5.2+20160703092728", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/15ddcf312782faf9e7fdfe724a3a29382a5825d7/redux/redux.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/rx/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "/Users/shmck/Desktop/PROJECT/core-coderoad/node_modules/rx/ts/rx.all.d.ts", 5 | "raw": "npm:rx/ts/rx.all.d.ts", 6 | "typings": "/Users/shmck/Desktop/PROJECT/core-coderoad/node_modules/rx/ts/rx.all.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/sort-package-json/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'sort-package-json' { 2 | export function sortPackageJson(package: string): string; 3 | } 4 | -------------------------------------------------------------------------------- /src/typings/globals/space-pen/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/space-pen/space-pen.d.ts 3 | interface JQuery { 4 | view():any; 5 | views():any[]; 6 | } 7 | 8 | interface JQuery { 9 | scrollBottom():number; 10 | scrollBottom(newValue:number):JQuery; 11 | scrollDown():JQuery; 12 | scrollUp():JQuery; 13 | scrollToTop():JQuery; 14 | scrollToBottom():JQuery; 15 | scrollRight():number; 16 | scrollRight(newValue:number):JQuery; 17 | pageUp():JQuery; 18 | pageDown():JQuery; 19 | isOnDom():boolean; 20 | isVisible():boolean; 21 | isHidden():boolean; 22 | isDisabled():boolean; 23 | enable():JQuery; 24 | disable():JQuery; 25 | insertAt(index:number, element:any):JQuery; 26 | removeAt(index:number):JQuery; 27 | indexOf(child:any):any; 28 | containsElement(element:any):boolean; 29 | preempt(eventName:any, handler:Function):any; 30 | handlers(eventName:any):any; 31 | hasParent():boolean; 32 | hasFocus():boolean; 33 | flashError():number; 34 | trueHeight():any; 35 | trueWidth():any; 36 | document(eventName:any, docString:string):any; 37 | events():any; 38 | command(eventName:any, handler:any):any; 39 | command(eventName:any, selector:any, handler:any):any; 40 | command(eventName:any, selector:any, options:any, handler:any):any; 41 | iconSize(size:number):void; 42 | intValue():number; 43 | } 44 | 45 | declare class View /* implements JQuery */ { 46 | 47 | static builderStack:Builder[]; 48 | 49 | static subview(name:any, view:any):void; 50 | 51 | static text(str:string):void; 52 | 53 | static tag(tagName:any, ...args:any[]):void; 54 | 55 | static raw(str:string):void; 56 | 57 | static pushBuilder():void; 58 | 59 | static popBuilder():Builder; 60 | 61 | static buildHtml(fn:()=>void):string[]; 62 | 63 | static render(fn:()=>void):JQuery; 64 | 65 | // please override this method! 66 | static content(...args:any[]):void; 67 | 68 | // tag start 69 | static a(...args:any[]):void; 70 | 71 | static abbr(...args:any[]):void; 72 | 73 | static address(...args:any[]):void; 74 | 75 | static article(...args:any[]):void; 76 | 77 | static aside(...args:any[]):void; 78 | 79 | static audio(...args:any[]):void; 80 | 81 | static b(...args:any[]):void; 82 | 83 | static bdi(...args:any[]):void; 84 | 85 | static bdo(...args:any[]):void; 86 | 87 | static blockquote(...args:any[]):void; 88 | 89 | static body(...args:any[]):void; 90 | 91 | static button(...args:any[]):void; 92 | 93 | static canvas(...args:any[]):void; 94 | 95 | static caption(...args:any[]):void; 96 | 97 | static cite(...args:any[]):void; 98 | 99 | static code(...args:any[]):void; 100 | 101 | static colgroup(...args:any[]):void; 102 | 103 | static datalist(...args:any[]):void; 104 | 105 | static dd(...args:any[]):void; 106 | 107 | static del(...args:any[]):void; 108 | 109 | static details(...args:any[]):void; 110 | 111 | static dfn(...args:any[]):void; 112 | 113 | static div(...args:any[]):void; 114 | 115 | static dl(...args:any[]):void; 116 | 117 | static dt(...args:any[]):void; 118 | 119 | static em(...args:any[]):void; 120 | 121 | static fieldset(...args:any[]):void; 122 | 123 | static figcaption(...args:any[]):void; 124 | 125 | static figure(...args:any[]):void; 126 | 127 | static footer(...args:any[]):void; 128 | 129 | static form(...args:any[]):void; 130 | 131 | static h1(...args:any[]):void; 132 | 133 | static h2(...args:any[]):void; 134 | 135 | static h3(...args:any[]):void; 136 | 137 | static h4(...args:any[]):void; 138 | 139 | static h5(...args:any[]):void; 140 | 141 | static h6(...args:any[]):void; 142 | 143 | static head(...args:any[]):void; 144 | 145 | static header(...args:any[]):void; 146 | 147 | static hgroup(...args:any[]):void; 148 | 149 | static html(...args:any[]):void; 150 | 151 | static i(...args:any[]):void; 152 | 153 | static iframe(...args:any[]):void; 154 | 155 | static ins(...args:any[]):void; 156 | 157 | static kbd(...args:any[]):void; 158 | 159 | static label(...args:any[]):void; 160 | 161 | static legend(...args:any[]):void; 162 | 163 | static li(...args:any[]):void; 164 | 165 | static map(...args:any[]):void; 166 | 167 | static mark(...args:any[]):void; 168 | 169 | static menu(...args:any[]):void; 170 | 171 | static meter(...args:any[]):void; 172 | 173 | static nav(...args:any[]):void; 174 | 175 | static noscript(...args:any[]):void; 176 | 177 | static object(...args:any[]):void; 178 | 179 | static ol(...args:any[]):void; 180 | 181 | static optgroup(...args:any[]):void; 182 | 183 | static option(...args:any[]):void; 184 | 185 | static output(...args:any[]):void; 186 | 187 | static p(...args:any[]):void; 188 | 189 | static pre(...args:any[]):void; 190 | 191 | static progress(...args:any[]):void; 192 | 193 | static q(...args:any[]):void; 194 | 195 | static rp(...args:any[]):void; 196 | 197 | static rt(...args:any[]):void; 198 | 199 | static ruby(...args:any[]):void; 200 | 201 | static s(...args:any[]):void; 202 | 203 | static samp(...args:any[]):void; 204 | 205 | static script(...args:any[]):void; 206 | 207 | static section(...args:any[]):void; 208 | 209 | static select(...args:any[]):void; 210 | 211 | static small(...args:any[]):void; 212 | 213 | static span(...args:any[]):void; 214 | 215 | static strong(...args:any[]):void; 216 | 217 | static style(...args:any[]):void; 218 | 219 | static sub(...args:any[]):void; 220 | 221 | static summary(...args:any[]):void; 222 | 223 | static sup(...args:any[]):void; 224 | 225 | static table(...args:any[]):void; 226 | 227 | static tbody(...args:any[]):void; 228 | 229 | static td(...args:any[]):void; 230 | 231 | static textarea(...args:any[]):void; 232 | 233 | static tfoot(...args:any[]):void; 234 | 235 | static th(...args:any[]):void; 236 | 237 | static thead(...args:any[]):void; 238 | 239 | static time(...args:any[]):void; 240 | 241 | static title(...args:any[]):void; 242 | 243 | static tr(...args:any[]):void; 244 | 245 | static u(...args:any[]):void; 246 | 247 | static ul(...args:any[]):void; 248 | 249 | static video(...args:any[]):void; 250 | 251 | static area(...args:any[]):void; 252 | 253 | static base(...args:any[]):void; 254 | 255 | static br(...args:any[]):void; 256 | 257 | static col(...args:any[]):void; 258 | 259 | static command(...args:any[]):void; 260 | 261 | static embed(...args:any[]):void; 262 | 263 | static hr(...args:any[]):void; 264 | 265 | static img(...args:any[]):void; 266 | 267 | static input(...args:any[]):void; 268 | 269 | static keygen(...args:any[]):void; 270 | 271 | static link(...args:any[]):void; 272 | 273 | static meta(...args:any[]):void; 274 | 275 | static param(...args:any[]):void; 276 | 277 | static source(...args:any[]):void; 278 | 279 | static track(...args:any[]):void; 280 | 281 | static wbrk(...args:any[]):void; 282 | 283 | // tag end 284 | 285 | initialize(view:View, args:any):void; 286 | 287 | constructor(...args:any[]); 288 | 289 | buildHtml(params:any):any; 290 | 291 | wireOutlets(view:View):void; 292 | 293 | bindEventHandlers(view:View):void; 294 | 295 | pushStack(elems:any):any; 296 | 297 | end():any; 298 | 299 | command(commandName:any, selector:any, options:any, handler:any):any; 300 | 301 | preempt(eventName:any, handler:any):any; 302 | } 303 | 304 | declare class Builder { 305 | document:any[]; 306 | postProcessingSteps:any[]; 307 | 308 | buildHtml():any[]; 309 | 310 | tag(name:string, ...args:any[]):void; 311 | 312 | openTag(name:string, attributes:any):void; 313 | 314 | closeTag(name:string):void; 315 | 316 | text(str:string):void; 317 | 318 | raw(str:string):void; 319 | 320 | subview(outletName:any, subview:View):void; 321 | 322 | extractOptions(args:any):any; 323 | } 324 | 325 | declare module "space-pen" { 326 | 327 | // copy & paste start 328 | class View /* implements JQueryStatic */ { 329 | 330 | static builderStack:Builder[]; 331 | 332 | static subview(name:any, view:any):void; 333 | 334 | static text(str:string):void; 335 | 336 | static tag(tagName:any, ...args:any[]):void; 337 | 338 | static raw(str:string):void; 339 | 340 | static pushBuilder():void; 341 | 342 | static popBuilder():Builder; 343 | 344 | static buildHtml(fn:()=>void):string[]; 345 | 346 | static render(fn:()=>void):JQuery; 347 | 348 | // please override this method! 349 | static content(...args:any[]):void; 350 | 351 | // tag start 352 | static a(...args:any[]):any; 353 | 354 | static abbr(...args:any[]):any; 355 | 356 | static address(...args:any[]):any; 357 | 358 | static article(...args:any[]):any; 359 | 360 | static aside(...args:any[]):any; 361 | 362 | static audio(...args:any[]):any; 363 | 364 | static b(...args:any[]):any; 365 | 366 | static bdi(...args:any[]):any; 367 | 368 | static bdo(...args:any[]):any; 369 | 370 | static blockquote(...args:any[]):any; 371 | 372 | static body(...args:any[]):any; 373 | 374 | static button(...args:any[]):any; 375 | 376 | static canvas(...args:any[]):any; 377 | 378 | static caption(...args:any[]):any; 379 | 380 | static cite(...args:any[]):any; 381 | 382 | static code(...args:any[]):any; 383 | 384 | static colgroup(...args:any[]):any; 385 | 386 | static datalist(...args:any[]):any; 387 | 388 | static dd(...args:any[]):any; 389 | 390 | static del(...args:any[]):any; 391 | 392 | static details(...args:any[]):any; 393 | 394 | static dfn(...args:any[]):any; 395 | 396 | static div(...args:any[]):any; 397 | 398 | static dl(...args:any[]):any; 399 | 400 | static dt(...args:any[]):any; 401 | 402 | static em(...args:any[]):any; 403 | 404 | static fieldset(...args:any[]):any; 405 | 406 | static figcaption(...args:any[]):any; 407 | 408 | static figure(...args:any[]):any; 409 | 410 | static footer(...args:any[]):any; 411 | 412 | static form(...args:any[]):any; 413 | 414 | static h1(...args:any[]):any; 415 | 416 | static h2(...args:any[]):any; 417 | 418 | static h3(...args:any[]):any; 419 | 420 | static h4(...args:any[]):any; 421 | 422 | static h5(...args:any[]):any; 423 | 424 | static h6(...args:any[]):any; 425 | 426 | static head(...args:any[]):any; 427 | 428 | static header(...args:any[]):any; 429 | 430 | static hgroup(...args:any[]):any; 431 | 432 | static html(...args:any[]):any; 433 | 434 | static i(...args:any[]):any; 435 | 436 | static iframe(...args:any[]):any; 437 | 438 | static ins(...args:any[]):any; 439 | 440 | static kbd(...args:any[]):any; 441 | 442 | static label(...args:any[]):any; 443 | 444 | static legend(...args:any[]):any; 445 | 446 | static li(...args:any[]):any; 447 | 448 | static map(...args:any[]):any; 449 | 450 | static mark(...args:any[]):any; 451 | 452 | static menu(...args:any[]):any; 453 | 454 | static meter(...args:any[]):any; 455 | 456 | static nav(...args:any[]):any; 457 | 458 | static noscript(...args:any[]):any; 459 | 460 | static object(...args:any[]):any; 461 | 462 | static ol(...args:any[]):any; 463 | 464 | static optgroup(...args:any[]):any; 465 | 466 | static option(...args:any[]):any; 467 | 468 | static output(...args:any[]):any; 469 | 470 | static p(...args:any[]):any; 471 | 472 | static pre(...args:any[]):any; 473 | 474 | static progress(...args:any[]):any; 475 | 476 | static q(...args:any[]):any; 477 | 478 | static rp(...args:any[]):any; 479 | 480 | static rt(...args:any[]):any; 481 | 482 | static ruby(...args:any[]):any; 483 | 484 | static s(...args:any[]):any; 485 | 486 | static samp(...args:any[]):any; 487 | 488 | static script(...args:any[]):any; 489 | 490 | static section(...args:any[]):any; 491 | 492 | static select(...args:any[]):any; 493 | 494 | static small(...args:any[]):any; 495 | 496 | static span(...args:any[]):any; 497 | 498 | static strong(...args:any[]):any; 499 | 500 | static style(...args:any[]):any; 501 | 502 | static sub(...args:any[]):any; 503 | 504 | static summary(...args:any[]):any; 505 | 506 | static sup(...args:any[]):any; 507 | 508 | static table(...args:any[]):any; 509 | 510 | static tbody(...args:any[]):any; 511 | 512 | static td(...args:any[]):any; 513 | 514 | static textarea(...args:any[]):any; 515 | 516 | static tfoot(...args:any[]):any; 517 | 518 | static th(...args:any[]):any; 519 | 520 | static thead(...args:any[]):any; 521 | 522 | static time(...args:any[]):any; 523 | 524 | static title(...args:any[]):any; 525 | 526 | static tr(...args:any[]):any; 527 | 528 | static u(...args:any[]):any; 529 | 530 | static ul(...args:any[]):any; 531 | 532 | static video(...args:any[]):any; 533 | 534 | static area(...args:any[]):any; 535 | 536 | static base(...args:any[]):any; 537 | 538 | static br(...args:any[]):any; 539 | 540 | static col(...args:any[]):any; 541 | 542 | static command(...args:any[]):any; 543 | 544 | static embed(...args:any[]):any; 545 | 546 | static hr(...args:any[]):any; 547 | 548 | static img(...args:any[]):any; 549 | 550 | static input(...args:any[]):any; 551 | 552 | static keygen(...args:any[]):any; 553 | 554 | static link(...args:any[]):any; 555 | 556 | static meta(...args:any[]):any; 557 | 558 | static param(...args:any[]):any; 559 | 560 | static source(...args:any[]):any; 561 | 562 | static track(...args:any[]):any; 563 | 564 | static wbrk(...args:any[]):any; 565 | 566 | // tag end 567 | 568 | initialize(view:View, args:any):void; 569 | 570 | constructor(...args:any[]); 571 | 572 | buildHtml(params:any):any; 573 | 574 | wireOutlets(view:View):void; 575 | 576 | bindEventHandlers(view:View):void; 577 | 578 | pushStack(elems:any):any; 579 | 580 | end():any; 581 | 582 | command(eventName:string, handler:any):any; 583 | 584 | command(eventName:string, selector:any, handler:any):any; 585 | 586 | command(eventName:string, selector:any, options:any, handler:any):any; 587 | 588 | preempt(eventName:any, handler:any):any; 589 | } 590 | 591 | class Builder { 592 | document:any[]; 593 | postProcessingSteps:any[]; 594 | 595 | buildHtml():any[]; 596 | 597 | tag(name:string, ...args:any[]):void; 598 | 599 | openTag(name:string, attributes:any):void; 600 | 601 | closeTag(name:string):void; 602 | 603 | text(str:string):void; 604 | 605 | raw(str:string):void; 606 | 607 | subview(outletName:any, subview:View):void; 608 | 609 | extractOptions(args:any):any; 610 | } 611 | // copy & paste end 612 | 613 | 614 | var jQuery:JQueryStatic; 615 | var $:JQueryStatic; 616 | var $$:(fn:Function)=>JQuery; // same type as View.render's return type. 617 | var $$$:(fn:Function)=>any; // same type as View.buildHtml's return type's [0]. 618 | } 619 | -------------------------------------------------------------------------------- /src/typings/globals/space-pen/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/space-pen/space-pen.d.ts", 5 | "raw": "registry:dt/space-pen#0.0.0+20160316155526", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/space-pen/space-pen.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/status-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/status-bar/status-bar.d.ts 3 | declare namespace StatusBar { 4 | interface IStatusBarViewStatic { 5 | content():any; 6 | 7 | new(...args:any[]):IStatusBarView; 8 | } 9 | 10 | interface IStatusBarView extends View { 11 | 12 | initialize():any; 13 | attach():any; 14 | destroy():any; 15 | appendLeft(view:View):any; 16 | prependLeft(view:View):any; 17 | appendRight(view:View):any; 18 | prependRight(view:View):any; 19 | getActiveBuffer():TextBuffer.ITextBuffer; 20 | getActiveItem():any; 21 | storeActiveBuffer():TextBuffer.ITextBuffer; 22 | subscribeToBuffer(event:string, callback:Function):any; 23 | subscribeAllToBuffer():any[]; 24 | unsubscribeAllFromBuffer():any[]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/typings/globals/status-bar/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/status-bar/status-bar.d.ts", 5 | "raw": "registry:dt/status-bar#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/status-bar/status-bar.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/globals/text-buffer/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/text-buffer/text-buffer.d.ts 3 | declare namespace TextBuffer { 4 | 5 | interface IPointStatic { 6 | new (row?:number, column?:number):IPoint; 7 | 8 | fromObject(point:IPoint, copy?:boolean):IPoint; 9 | fromObject(object:number[]):IPoint; 10 | fromObject(object:{row:number; column:number;}):IPoint; 11 | 12 | min(point1:IPoint, point2:IPoint):IPoint; 13 | min(point1:number[], point2:IPoint):IPoint; 14 | min(point1:{row:number; column:number;}, point2:IPoint):IPoint; 15 | 16 | min(point1:IPoint, point2:number[]):IPoint; 17 | min(point1:number[], point2:number[]):IPoint; 18 | min(point1:{row:number; column:number;}, point2:number[]):IPoint; 19 | 20 | min(point1:IPoint, point2:{row:number; column:number;}):IPoint; 21 | min(point1:number[], point2:{row:number; column:number;}):IPoint; 22 | min(point1:{row:number; column:number;}, point2:{row:number; column:number;}):IPoint; 23 | } 24 | 25 | interface IPoint { 26 | constructor: IPointStatic; 27 | 28 | row:number; 29 | column:number; 30 | 31 | copy():IPoint; 32 | freeze():IPoint; 33 | 34 | translate(delta:IPoint):IPoint; 35 | translate(delta:number[]):IPoint; 36 | translate(delta:{row:number; column:number;}):IPoint; 37 | 38 | add(other:IPoint):IPoint; 39 | add(other:number[]):IPoint; 40 | add(other:{row:number; column:number;}):IPoint; 41 | 42 | splitAt(column:number):IPoint[]; 43 | compare(other:IPoint):number; 44 | isEqual(other:IPoint):boolean; 45 | isLessThan(other:IPoint):boolean; 46 | isLessThanOrEqual(other:IPoint):boolean; 47 | isGreaterThan(other:IPoint):boolean; 48 | isGreaterThanOrEqual(other:IPoint):boolean; 49 | toArray():number[]; 50 | serialize():number[]; 51 | } 52 | 53 | interface IRangeStatic { 54 | deserialize(array:IPoint[]):IRange; 55 | 56 | fromObject(object:IPoint[]):IRange; 57 | 58 | fromObject(object:IRange, copy?:boolean):IRange; 59 | 60 | fromObject(object:{start: IPoint; end: IPoint}):IRange; 61 | fromObject(object:{start: number[]; end: IPoint}):IRange; 62 | fromObject(object:{start: {row:number; column:number;}; end: IPoint}):IRange; 63 | 64 | fromObject(object:{start: IPoint; end: number[]}):IRange; 65 | fromObject(object:{start: number[]; end: number[]}):IRange; 66 | fromObject(object:{start: {row:number; column:number;}; end: number[]}):IRange; 67 | 68 | fromObject(object:{start: IPoint; end: {row:number; column:number;}}):IRange; 69 | fromObject(object:{start: number[]; end: {row:number; column:number;}}):IRange; 70 | fromObject(object:{start: {row:number; column:number;}; end: {row:number; column:number;}}):IRange; 71 | 72 | fromText(point:IPoint, text:string):IRange; 73 | fromText(point:number[], text:string):IRange; 74 | fromText(point:{row:number; column:number;}, text:string):IRange; 75 | fromText(text:string):IRange; 76 | 77 | fromPointWithDelta(startPoint:IPoint, rowDelta:number, columnDelta:number):IRange; 78 | fromPointWithDelta(startPoint:number[], rowDelta:number, columnDelta:number):IRange; 79 | fromPointWithDelta(startPoint:{row:number; column:number;}, rowDelta:number, columnDelta:number):IRange; 80 | 81 | new(point1:IPoint, point2:IPoint):IRange; 82 | new(point1:number[], point2:IPoint):IRange; 83 | new(point1:{row:number; column:number;}, point2:IPoint):IRange; 84 | 85 | new(point1:IPoint, point2:number[]):IRange; 86 | new(point1:number[], point2:number[]):IRange; 87 | new(point1:{row:number; column:number;}, point2:number[]):IRange; 88 | 89 | new(point1:IPoint, point2:{row:number; column:number;}):IRange; 90 | new(point1:number[], point2:{row:number; column:number;}):IRange; 91 | new(point1:{row:number; column:number;}, point2:{row:number; column:number;}):IRange; 92 | } 93 | 94 | interface IRange { 95 | constructor:IRangeStatic; 96 | 97 | start: IPoint; 98 | end: IPoint; 99 | 100 | serialize():number[][]; 101 | copy():IRange; 102 | freeze():IRange; 103 | isEqual(other:IRange):boolean; 104 | isEqual(other:IPoint[]):boolean; 105 | 106 | compare(object:IPoint[]):number; 107 | 108 | compare(object:{start: IPoint; end: IPoint}):number; 109 | compare(object:{start: number[]; end: IPoint}):number; 110 | compare(object:{start: {row:number; column:number;}; end: IPoint}):number; 111 | 112 | compare(object:{start: IPoint; end: number[]}):number; 113 | compare(object:{start: number[]; end: number[]}):number; 114 | compare(object:{start: {row:number; column:number;}; end: number[]}):number; 115 | 116 | compare(object:{start: IPoint; end: {row:number; column:number;}}):number; 117 | compare(object:{start: number[]; end: {row:number; column:number;}}):number; 118 | compare(object:{start: {row:number; column:number;}; end: {row:number; column:number;}}):number; 119 | 120 | isSingleLine():boolean; 121 | coversSameRows(other:IRange):boolean; 122 | 123 | add(object:IPoint[]):IRange; 124 | 125 | add(object:{start: IPoint; end: IPoint}):IRange; 126 | add(object:{start: number[]; end: IPoint}):IRange; 127 | add(object:{start: {row:number; column:number;}; end: IPoint}):IRange; 128 | 129 | add(object:{start: IPoint; end: number[]}):IRange; 130 | add(object:{start: number[]; end: number[]}):IRange; 131 | add(object:{start: {row:number; column:number;}; end: number[]}):IRange; 132 | 133 | add(object:{start: IPoint; end: {row:number; column:number;}}):IRange; 134 | add(object:{start: number[]; end: {row:number; column:number;}}):IRange; 135 | add(object:{start: {row:number; column:number;}; end: {row:number; column:number;}}):IRange; 136 | 137 | translate(startPoint:IPoint, endPoint:IPoint):IRange; 138 | translate(startPoint:IPoint):IRange; 139 | 140 | intersectsWith(otherRange:IRange):boolean; 141 | containsRange(otherRange:IRange, exclusive:boolean):boolean; 142 | 143 | containsPoint(point:IPoint, exclusive:boolean):boolean; 144 | containsPoint(point:number[], exclusive:boolean):boolean; 145 | containsPoint(point:{row:number; column:number;}, exclusive:boolean):boolean; 146 | 147 | intersectsRow(row:number):boolean; 148 | intersectsRowRange(startRow:number, endRow:number):boolean; 149 | union(otherRange:IRange):IRange; 150 | isEmpty():boolean; 151 | toDelta():IPoint; 152 | getRowCount():number; 153 | getRows():number[]; 154 | } 155 | 156 | interface IHistory { 157 | // TBD 158 | } 159 | 160 | interface IMarkerManager { 161 | // TBD 162 | } 163 | 164 | interface IMarker { 165 | // TBD 166 | } 167 | 168 | interface IBufferPatch { 169 | // TBD 170 | } 171 | 172 | interface ITextBufferStatic { 173 | Point: IPointStatic; 174 | Range: IRangeStatic; 175 | newlineRegex:any; 176 | 177 | new (text:string): ITextBuffer; 178 | new (params:any): ITextBuffer; 179 | } 180 | 181 | interface ITextBuffer extends Emissary.IEmitter, Emissary.ISubscriber { 182 | // Delegator.includeInto(TextBuffer); 183 | // Serializable.includeInto(TextBuffer); 184 | 185 | cachedText:string; 186 | stoppedChangingDelay:number; 187 | stoppedChangingTimeout:any; 188 | cachedDiskContents:string; 189 | conflict:boolean; 190 | file:any; // pathwatcher.IFile 191 | refcount:number; 192 | 193 | lines:string[]; 194 | lineEndings:string[]; 195 | offsetIndex:any; // span-skip-list.SpanSkipList 196 | history:IHistory; 197 | markers:IMarkerManager; 198 | loaded:boolean; 199 | digestWhenLastPersisted:string; 200 | modifiedWhenLastPersisted:boolean; 201 | useSerializedText:boolean; 202 | 203 | deserializeParams(params:any):any; 204 | serializeParams():any; 205 | 206 | getText():string; 207 | getLines():string; 208 | isEmpty():boolean; 209 | getLineCount():number; 210 | getLastRow():number; 211 | lineForRow(row:number):string; 212 | getLastLine():string; 213 | lineEndingForRow(row:number):string; 214 | lineLengthForRow(row:number):number; 215 | setText(text:string):IRange; 216 | setTextViaDiff(text:any):any[]; 217 | setTextInRange(range:IRange, text:string, normalizeLineEndings?:boolean):IRange; 218 | insert(position:IPoint, text:string, normalizeLineEndings?:boolean):IRange; 219 | append(text:string, normalizeLineEndings?:boolean):IRange; 220 | delete(range:IRange):IRange; 221 | deleteRow(row:number):IRange; 222 | deleteRows(startRow:number, endRow:number):IRange; 223 | buildPatch(oldRange:IRange, newText:string, normalizeLineEndings?:boolean):IBufferPatch; 224 | applyPatch(patch:IBufferPatch):any; 225 | getTextInRange(range:IRange):string; 226 | clipRange(range:IRange):IRange; 227 | clipPosition(position:IPoint):IPoint; 228 | getFirstPosition():IPoint; 229 | getEndPosition():IPoint; 230 | getRange():IRange; 231 | rangeForRow(row:number, includeNewline?:boolean):IRange; 232 | characterIndexForPosition(position:IPoint):number; 233 | positionForCharacterIndex(offset:number):IPoint; 234 | getMaxCharacterIndex():number; 235 | loadSync():ITextBuffer; 236 | load():Q.IPromise; 237 | finishLoading():ITextBuffer; 238 | handleTextChange(event:any):any; 239 | destroy():any; 240 | isAlive():boolean; 241 | isDestroyed():boolean; 242 | isRetained():boolean; 243 | retain():ITextBuffer; 244 | release():ITextBuffer; 245 | subscribeToFile():any; 246 | hasMultipleEditors():boolean; 247 | reload():any; 248 | updateCachedDiskContentsSync():string; 249 | updateCachedDiskContents():Q.IPromise; 250 | getBaseName():string; 251 | getPath():string; 252 | getUri():string; 253 | setPath(filePath:string):any; 254 | save():void; 255 | saveAs(filePath:string):any; 256 | isModified():boolean; 257 | isInConflict():boolean; 258 | destroyMarker(id:any):any; 259 | matchesInCharacterRange(regex:any, startIndex:any, endIndex:any):any[]; 260 | scan(regex:any, iterator:any):any; 261 | backwardsScan(regex:any, iterator:any):any; 262 | replace(regex:any, replacementText:any):any; 263 | scanInRange(regex:any, range:any, iterator:any, reverse:any):any; 264 | backwardsScanInRange(regex:any, range:any, iterator:any):any; 265 | isRowBlank(row:number):boolean; 266 | previousNonBlankRow(startRow:number):number; 267 | nextNonBlankRow(startRow:number):number; 268 | usesSoftTabs():boolean; 269 | cancelStoppedChangingTimeout():any; 270 | scheduleModifiedEvents():any; 271 | emitModifiedStatusChanged(modifiedStatus:any):any; 272 | logLines(start:number, end:number):void; 273 | 274 | // delegate to history property 275 | undo():any; 276 | redo():any; 277 | transact(fn:Function):any; 278 | beginTransaction():any; 279 | commitTransaction():any; 280 | abortTransaction():any; 281 | clearUndoStack():any; 282 | 283 | // delegate to markers property 284 | markRange(range:any, properties:any):any; 285 | markPosition(range:any, properties:any):any; 286 | getMarker(id:number):IMarker; 287 | getMarkers():IMarker[]; 288 | getMarkerCount():number; 289 | } 290 | } 291 | 292 | declare module "text-buffer" { 293 | var _: TextBuffer.ITextBufferStatic; 294 | export = _; 295 | } 296 | -------------------------------------------------------------------------------- /src/typings/globals/text-buffer/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "resolution": "main", 3 | "tree": { 4 | "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/text-buffer/text-buffer.d.ts", 5 | "raw": "registry:dt/text-buffer#0.0.0+20160317120654", 6 | "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/text-buffer/text-buffer.d.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/typings/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | -------------------------------------------------------------------------------- /styles/styles.less: -------------------------------------------------------------------------------- 1 | @import 'ui-variables'; 2 | 3 | #crv { 4 | position: relative; 5 | overflow-y: scroll; 6 | font-size: @input-font-size; 7 | pre { 8 | margin-bottom: 10px !important; 9 | padding-bottom: 0; 10 | } 11 | code { 12 | background-color: @input-background-color; 13 | border-radius: @component-border-radius; 14 | } 15 | .editor { 16 | min-height: 25px; 17 | } 18 | a, 19 | a:hover, 20 | a:link { 21 | font-weight: bold; 22 | text-decoration: none; 23 | color: rgb(0, 188, 212); 24 | } 25 | a:visited { 26 | font-weight: normal; 27 | } 28 | .cr-bg { 29 | height: 100%; 30 | background-color: @syntax-background-color; 31 | } 32 | .cr-start { 33 | height: calc(100% - 300px); 34 | background-color: @syntax-background-color; 35 | position: relative; 36 | text-align: center; 37 | color: white; 38 | } 39 | .cr-page { 40 | height: calc(100% - 200px); 41 | background-color: @syntax-background-color; 42 | } 43 | } 44 | 45 | /* Style Alert Button */ 46 | .cr-alert.PASS > div > div > button > div > span { 47 | color: #73C990; // green 48 | } 49 | .cr-alert.FAIL > div > div > button > div > span { 50 | color: #FF4081; // pink 51 | } 52 | .cr-alert.NOTE > div > div > button > div > span { 53 | color: #9DA5B4; // blue 54 | } 55 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES5", 4 | "module": "commonjs", 5 | "declaration": false, 6 | "noImplicitAny": false, 7 | "removeComments": true, 8 | "jsx": "react", 9 | "experimentalDecorators": true, 10 | "emitDecoratorMetadata": true, 11 | "sourceMap": true, 12 | "moduleResolution": "node", 13 | "strictNullChecks": true, 14 | "outDir": "./lib", 15 | "rootDirs": [ 16 | "src", 17 | "node_modules" 18 | ] 19 | }, 20 | "filesGlob": [ 21 | "**/*.d.ts", 22 | "**/*.ts", 23 | "**/*.tsx", 24 | "!**/*.test.ts", 25 | "!**/*.test.tsx", 26 | "!node_modules/**/*", 27 | "!src/__tests__/**/*", 28 | "!src/__coverage/**/*" 29 | ], 30 | "exclude": [ 31 | "node_modules" 32 | ], 33 | "files": [ 34 | "src/typings/coderoad/core.d.ts", 35 | "src/typings/editor/index.d.ts", 36 | "src/typings/globals/assertion-error/index.d.ts", 37 | "src/typings/globals/atom-plugin-command-line/index.d.ts", 38 | "src/typings/globals/atom/custom.d.ts", 39 | "src/typings/globals/atom/index.d.ts", 40 | "src/typings/globals/core-js/index.d.ts", 41 | "src/typings/globals/electron/index.d.ts", 42 | "src/typings/globals/emissary/index.d.ts", 43 | "src/typings/globals/jest/index.d.ts", 44 | "src/typings/globals/jquery/index.d.ts", 45 | "src/typings/globals/mixto/index.d.ts", 46 | "src/typings/globals/node-file-exists/index.d.ts", 47 | "src/typings/globals/node/index.d.ts", 48 | "src/typings/globals/pathwatcher/index.d.ts", 49 | "src/typings/globals/q/index.d.ts", 50 | "src/typings/globals/redux/index.d.ts", 51 | "src/typings/globals/rx/index.d.ts", 52 | "src/typings/globals/sort-package-json/index.d.ts", 53 | "src/typings/globals/space-pen/index.d.ts", 54 | "src/typings/globals/status-bar/index.d.ts", 55 | "src/typings/globals/text-buffer/index.d.ts", 56 | "src/typings/index.d.ts", 57 | "src/editor/actions/console.ts", 58 | "src/editor/actions/editor.ts", 59 | "src/editor/actions/file.ts", 60 | "src/editor/actions/index.ts", 61 | "src/editor/actions/quit.ts", 62 | "src/editor/actions/tabs.ts", 63 | "src/editor/actions/terminal.ts", 64 | "src/editor/actions/write.ts", 65 | "src/editor/actions/writeFile.ts", 66 | "src/editor/index.ts", 67 | "src/editor/utils/compareVersions.ts", 68 | "src/editor/utils/directory.ts", 69 | "src/editor/utils/grammar.ts", 70 | "src/editor/utils/subscriptions.ts", 71 | "src/editor/utils/ui.ts", 72 | "src/index.ts", 73 | "src/editor/utils/setup.tsx" 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["tslint:latest", "tslint-react"], 3 | "rules": { 4 | "jsx-alignment": true, 5 | "jsx-no-lambda": true, 6 | "jsx-no-string-ref": true, 7 | "jsx-self-close": true, 8 | "align": [true, "parameters", "statements"], 9 | "class-name": true, 10 | "comment-format": [true, "check-space"], 11 | "curly": true, 12 | "eofline": true, 13 | "forin": true, 14 | "indent": [true, "spaces"], 15 | "label-position": true, 16 | "label-undefined": true, 17 | "max-line-length": [true, 140], 18 | "member-ordering": [true, 19 | "public-before-private", 20 | "static-before-instance", 21 | "variables-before-functions" 22 | ], 23 | "no-arg": true, 24 | "no-bitwise": true, 25 | "no-console": [true, 26 | "debug", 27 | "info", 28 | "time", 29 | "timeEnd", 30 | "trace" 31 | ], 32 | "no-construct": true, 33 | "no-consecutive-blank-lines": true, 34 | "no-debugger": true, 35 | "no-duplicate-key": true, 36 | "no-duplicate-variable": true, 37 | "no-empty": true, 38 | "no-eval": true, 39 | "no-inferrable-types": true, 40 | "no-shadowed-variable": true, 41 | "no-string-literal": true, 42 | "no-switch-case-fall-through": true, 43 | "no-trailing-whitespace": true, 44 | "no-unused-expression": true, 45 | "no-unused-variable": "react", 46 | "no-unreachable": true, 47 | "no-use-before-declare": true, 48 | "no-var-keyword": true, 49 | "object-literal-sort-keys": false, 50 | "one-line": [true, 51 | "check-open-brace", 52 | "check-catch", 53 | "check-else", 54 | "check-finally", 55 | "check-whitespace" 56 | ], 57 | "quotemark": [true, "single", "avoid-escape"], 58 | "radix": true, 59 | "semicolon": [true, "always"], 60 | "trailing-comma": [true, { 61 | "singleline": "never" 62 | }], 63 | "triple-equals": [true, "allow-null-check"], 64 | "typedef-whitespace": [true, { 65 | "call-signature": "nospace", 66 | "index-signature": "nospace", 67 | "parameter": "nospace", 68 | "property-declaration": "nospace", 69 | "variable-declaration": "nospace" 70 | }], 71 | "variable-name": [true, "ban-keywords"], 72 | "whitespace": [true, 73 | "check-branch", 74 | "check-decl", 75 | "check-operator", 76 | "check-separator", 77 | "check-type" 78 | ] 79 | } 80 | } 81 | --------------------------------------------------------------------------------