├── .gitignore ├── .vscode └── launch.json ├── LICENSE ├── README.md ├── candombed ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── scripts │ ├── copy-static.ts │ ├── hack1.ts │ └── watch-static.ts ├── src │ ├── actions │ │ ├── State.ts │ │ ├── addFile.ts │ │ ├── reducers.ts │ │ ├── selectExample.ts │ │ └── selectFileFromTree.ts │ ├── declarations.d.ts │ ├── examples │ │ └── projectsJson │ │ │ ├── ts-sample-project.json │ │ │ ├── vscode-inline-types-master.json │ │ │ ├── yamat.json │ │ │ └── yo-master.json │ ├── main.ts │ ├── projectActions.ts │ ├── static │ │ ├── examples │ │ │ ├── monaco-project-referenceProvider.html │ │ │ └── monaco-project.html │ │ ├── index.css │ │ ├── index.html │ │ └── test.html │ ├── types.ts │ ├── ui │ │ ├── contextMenu.tsx │ │ ├── fileTree.tsx │ │ ├── forkRibbon.tsx │ │ ├── layout.tsx │ │ ├── modals │ │ │ ├── loadProjectModal.tsx │ │ │ ├── saveProjectModal.tsx │ │ │ └── whatsThisModal.tsx │ │ └── navbar.tsx │ └── util │ │ ├── examples.ts │ │ └── testtest.ts └── tsconfig.json ├── docs ├── candombed │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── examples │ │ ├── monaco-project-referenceProvider.html │ │ └── monaco-project.html │ ├── index.css │ ├── index.html │ ├── jquery.slim.min.js │ ├── jsonc-parser │ │ └── main.js │ ├── monaco-editor │ │ └── min │ │ │ ├── vs │ │ │ ├── base │ │ │ │ └── worker │ │ │ │ │ └── workerMain.js │ │ │ ├── basic-languages │ │ │ │ └── markdown │ │ │ │ │ └── markdown.js │ │ │ ├── editor │ │ │ │ ├── contrib │ │ │ │ │ └── suggest │ │ │ │ │ │ └── media │ │ │ │ │ │ ├── String_16x.svg │ │ │ │ │ │ └── String_inverse_16x.svg │ │ │ │ ├── editor.main.css │ │ │ │ ├── editor.main.js │ │ │ │ ├── editor.main.nls.de.js │ │ │ │ ├── editor.main.nls.es.js │ │ │ │ ├── editor.main.nls.fr.js │ │ │ │ ├── editor.main.nls.it.js │ │ │ │ ├── editor.main.nls.ja.js │ │ │ │ ├── editor.main.nls.js │ │ │ │ ├── editor.main.nls.ko.js │ │ │ │ ├── editor.main.nls.ru.js │ │ │ │ ├── editor.main.nls.zh-cn.js │ │ │ │ ├── editor.main.nls.zh-tw.js │ │ │ │ └── standalone │ │ │ │ │ └── browser │ │ │ │ │ └── quickOpen │ │ │ │ │ └── symbol-sprite.svg │ │ │ ├── language │ │ │ │ ├── json │ │ │ │ │ ├── jsonMode.js │ │ │ │ │ └── jsonWorker.js │ │ │ │ └── typescript │ │ │ │ │ ├── lib │ │ │ │ │ └── typescriptServices.js │ │ │ │ │ ├── tsMode.js │ │ │ │ │ └── tsWorker.js │ │ │ └── loader.js │ │ │ └── vscode-languageserver-types │ │ │ └── main.js │ ├── src.js │ └── test.html ├── monaco-typescript-project-util-sample-project │ ├── index.html │ ├── main.css │ └── src.js └── typescript-compiler │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── examples │ ├── ts-browser-create-program-fails.html │ ├── ts-browser-create-sourcefile-works.html │ └── ts-browser-transpile-works.html │ ├── index.css │ ├── index.html │ ├── jquery.slim.min.js │ ├── jsonc-parser │ └── main.js │ ├── monaco-editor │ └── min │ │ ├── vs │ │ ├── base │ │ │ └── worker │ │ │ │ └── workerMain.js │ │ ├── basic-languages │ │ │ └── markdown │ │ │ │ └── markdown.js │ │ ├── editor │ │ │ ├── contrib │ │ │ │ └── suggest │ │ │ │ │ └── media │ │ │ │ │ ├── String_16x.svg │ │ │ │ │ └── String_inverse_16x.svg │ │ │ ├── editor.main.css │ │ │ ├── editor.main.js │ │ │ ├── editor.main.nls.de.js │ │ │ ├── editor.main.nls.es.js │ │ │ ├── editor.main.nls.fr.js │ │ │ ├── editor.main.nls.it.js │ │ │ ├── editor.main.nls.ja.js │ │ │ ├── editor.main.nls.js │ │ │ ├── editor.main.nls.ko.js │ │ │ ├── editor.main.nls.ru.js │ │ │ ├── editor.main.nls.zh-cn.js │ │ │ ├── editor.main.nls.zh-tw.js │ │ │ └── standalone │ │ │ │ └── browser │ │ │ │ └── quickOpen │ │ │ │ └── symbol-sprite.svg │ │ ├── language │ │ │ ├── json │ │ │ │ ├── jsonMode.js │ │ │ │ └── jsonWorker.js │ │ │ └── typescript │ │ │ │ ├── lib │ │ │ │ └── typescriptServices.js │ │ │ │ ├── tsMode.js │ │ │ │ └── tsWorker.js │ │ └── loader.js │ │ └── vscode-languageserver-types │ │ └── main.js │ ├── src.js │ └── typescript.js ├── monaco-typescript-project-util-cli ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── src │ └── index.ts └── tsconfig.json ├── monaco-typescript-project-util-sample-project ├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── src │ ├── dummyProject.ts │ ├── index.ts │ ├── layout.tsx │ ├── projectFiles.tsx │ └── static │ │ ├── index.html │ │ └── main.css └── tsconfig.json ├── monaco-typescript-project-util ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── src │ ├── index.ts │ ├── monaco │ │ ├── actionManager.ts │ │ ├── index.ts │ │ ├── installTypes.ts │ │ ├── loader │ │ │ └── cdnAmdLoader.ts │ │ ├── monacoFacade.ts │ │ ├── navigateExternalDefinitions.ts │ │ ├── register.ts │ │ ├── tsConfig.ts │ │ ├── tsWorker.ts │ │ └── workspaceManager.ts │ ├── types.ts │ ├── ui-util │ │ ├── fileTreeUtil.ts │ │ └── index.ts │ ├── ui │ │ ├── Editor.tsx │ │ ├── FileTree.tsx │ │ └── index.ts │ └── util │ │ ├── fetchUtil.ts │ │ ├── filesDefinitions.ts │ │ ├── index.ts │ │ ├── loadScript.ts │ │ ├── logUtil.ts │ │ ├── projectSerialization.ts │ │ └── tsUtil.ts └── tsconfig.json ├── node_modules ├── .bin │ ├── shjs │ └── yamat ├── balanced-match │ ├── .npmignore │ ├── LICENSE.md │ ├── README.md │ ├── index.js │ └── package.json ├── brace-expansion │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── camelcase │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── concat-map │ ├── .travis.yml │ ├── LICENSE │ ├── README.markdown │ ├── example │ │ └── map.js │ ├── index.js │ ├── package.json │ └── test │ │ └── map.js ├── executive │ ├── LICENSE │ ├── README.md │ ├── executive.d.ts │ ├── lib │ │ ├── executive.cjs.js │ │ ├── executive.cjs.js.map │ │ ├── executive.es6.js │ │ └── executive.es6.js.map │ ├── package.json │ └── src │ │ ├── executive.coffee │ │ ├── flow │ │ ├── index.coffee │ │ ├── parallel.coffee │ │ └── serial.coffee │ │ ├── index.coffee │ │ ├── spawn │ │ ├── async.coffee │ │ ├── buffer-stream.coffee │ │ ├── parse.coffee │ │ ├── shell-builtins.coffee │ │ └── sync.coffee │ │ └── utils.coffee ├── fs.realpath │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── old.js │ └── package.json ├── glob │ ├── LICENSE │ ├── README.md │ ├── changelog.md │ ├── common.js │ ├── glob.js │ ├── package.json │ └── sync.js ├── inflight │ ├── LICENSE │ ├── README.md │ ├── inflight.js │ └── package.json ├── inherits │ ├── LICENSE │ ├── README.md │ ├── inherits.js │ ├── inherits_browser.js │ └── package.json ├── interpret │ ├── CHANGELOG │ ├── LICENSE │ ├── README.md │ ├── index.js │ └── package.json ├── minimatch │ ├── LICENSE │ ├── README.md │ ├── minimatch.js │ └── package.json ├── once │ ├── LICENSE │ ├── README.md │ ├── once.js │ └── package.json ├── path-is-absolute │ ├── index.js │ ├── license │ ├── package.json │ └── readme.md ├── path-parse │ ├── .travis.yml │ ├── README.md │ ├── index.js │ ├── index.min.js │ ├── package.json │ ├── test.js │ └── test.min.js ├── rechoir │ ├── .npmignore │ ├── .travis.yml │ ├── CHANGELOG │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── extension.js │ │ ├── normalize.js │ │ └── register.js │ └── package.json ├── resolve │ ├── .editorconfig │ ├── .eslintignore │ ├── .eslintrc │ ├── .travis.yml │ ├── LICENSE │ ├── appveyor.yml │ ├── example │ │ ├── async.js │ │ └── sync.js │ ├── index.js │ ├── lib │ │ ├── async.js │ │ ├── caller.js │ │ ├── core.js │ │ ├── core.json │ │ ├── node-modules-paths.js │ │ └── sync.js │ ├── package.json │ ├── readme.markdown │ └── test │ │ ├── .eslintrc │ │ ├── core.js │ │ ├── dotdot.js │ │ ├── dotdot │ │ ├── abc │ │ │ └── index.js │ │ └── index.js │ │ ├── faulty_basedir.js │ │ ├── filter.js │ │ ├── filter_sync.js │ │ ├── mock.js │ │ ├── mock_sync.js │ │ ├── module_dir.js │ │ ├── module_dir │ │ ├── xmodules │ │ │ └── aaa │ │ │ │ └── index.js │ │ ├── ymodules │ │ │ └── aaa │ │ │ │ └── index.js │ │ └── zmodules │ │ │ └── bbb │ │ │ ├── main.js │ │ │ └── package.json │ │ ├── node-modules-paths.js │ │ ├── node_path.js │ │ ├── node_path │ │ ├── x │ │ │ ├── aaa │ │ │ │ └── index.js │ │ │ └── ccc │ │ │ │ └── index.js │ │ └── y │ │ │ ├── bbb │ │ │ └── index.js │ │ │ └── ccc │ │ │ └── index.js │ │ ├── nonstring.js │ │ ├── pathfilter.js │ │ ├── pathfilter │ │ └── deep_ref │ │ │ └── main.js │ │ ├── precedence.js │ │ ├── precedence │ │ ├── aaa.js │ │ ├── aaa │ │ │ ├── index.js │ │ │ └── main.js │ │ ├── bbb.js │ │ └── bbb │ │ │ └── main.js │ │ ├── resolver.js │ │ ├── resolver │ │ ├── baz │ │ │ ├── doom.js │ │ │ ├── package.json │ │ │ └── quux.js │ │ ├── browser_field │ │ │ ├── a.js │ │ │ ├── b.js │ │ │ └── package.json │ │ ├── cup.coffee │ │ ├── dot_main │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── dot_slash_main │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── foo.js │ │ ├── incorrect_main │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── mug.coffee │ │ ├── mug.js │ │ ├── other_path │ │ │ ├── lib │ │ │ │ └── other-lib.js │ │ │ └── root.js │ │ ├── quux │ │ │ └── foo │ │ │ │ └── index.js │ │ ├── same_names │ │ │ ├── foo.js │ │ │ └── foo │ │ │ │ └── index.js │ │ ├── symlinked │ │ │ └── _ │ │ │ │ ├── node_modules │ │ │ │ └── foo.js │ │ │ │ └── symlink_target │ │ │ │ └── .gitkeep │ │ └── without_basedir │ │ │ └── main.js │ │ ├── resolver_sync.js │ │ ├── subdirs.js │ │ └── symlinks.js ├── shelljs │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ └── shjs │ ├── commands.js │ ├── global.js │ ├── make.js │ ├── package.json │ ├── plugin.js │ ├── shell.js │ └── src │ │ ├── cat.js │ │ ├── cd.js │ │ ├── chmod.js │ │ ├── common.js │ │ ├── cp.js │ │ ├── dirs.js │ │ ├── echo.js │ │ ├── error.js │ │ ├── exec-child.js │ │ ├── exec.js │ │ ├── find.js │ │ ├── grep.js │ │ ├── head.js │ │ ├── ln.js │ │ ├── ls.js │ │ ├── mkdir.js │ │ ├── mv.js │ │ ├── popd.js │ │ ├── pushd.js │ │ ├── pwd.js │ │ ├── rm.js │ │ ├── sed.js │ │ ├── set.js │ │ ├── sort.js │ │ ├── tail.js │ │ ├── tempdir.js │ │ ├── test.js │ │ ├── to.js │ │ ├── toEnd.js │ │ ├── touch.js │ │ ├── uniq.js │ │ └── which.js ├── wrappy │ ├── LICENSE │ ├── README.md │ ├── package.json │ └── wrappy.js ├── yamat │ ├── Changelog.md │ ├── README.md │ ├── TODO.md │ ├── bin │ │ └── yamat.js │ ├── dist │ │ └── src │ │ │ ├── cli.d.ts │ │ │ ├── cli.js │ │ │ ├── force-dependency.d.ts │ │ │ ├── force-dependency.js │ │ │ ├── help.d.ts │ │ │ ├── help.js │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── link.d.ts │ │ │ ├── link.js │ │ │ ├── pack.d.ts │ │ │ ├── pack.js │ │ │ ├── run.d.ts │ │ │ ├── run.js │ │ │ ├── types.d.ts │ │ │ ├── types.js │ │ │ ├── typings.d.ts │ │ │ ├── typings.js │ │ │ ├── unlink.d.ts │ │ │ ├── unlink.js │ │ │ ├── util.d.ts │ │ │ └── util.js │ └── package.json └── yargs-parser │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── README.md │ ├── index.js │ ├── lib │ └── tokenize-arg-string.js │ └── package.json ├── package-lock.json ├── package.json ├── typescript-compiler-in-the-browser ├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── scripts │ ├── copy-static.ts │ └── watch-static.ts ├── src │ ├── compiler │ │ ├── declarations.d.ts │ │ ├── execute.ts │ │ ├── languageServiceProvider │ │ │ ├── dummy1 │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── languageServiceProviderFactory.ts │ │ ├── main.ts │ │ ├── manager.ts │ │ ├── programProvider │ │ │ ├── dummy1 │ │ │ │ └── programProviderVeryDummyImpl.ts │ │ │ ├── index.ts │ │ │ └── programProviderFactory.ts │ │ ├── types.ts │ │ ├── ui │ │ │ ├── forkRibbon.tsx │ │ │ ├── iuSettingsState.ts │ │ │ ├── layout.tsx │ │ │ ├── mainContentProjectEditor │ │ │ │ ├── CompilerEditor.tsx │ │ │ │ ├── CompilerFileTree.tsx │ │ │ │ ├── fileNavigator.tsx │ │ │ │ ├── mainContentProjectEditor.tsx │ │ │ │ └── projectState.ts │ │ │ ├── mainContentSimple1 │ │ │ │ ├── currentExample.tsx │ │ │ │ ├── exampleOutput.tsx │ │ │ │ └── mainContentSimple1.tsx │ │ │ └── navbar │ │ │ │ ├── dropTsProjectFolderModal.tsx │ │ │ │ ├── loadProjectModal.tsx │ │ │ │ ├── navbar.tsx │ │ │ │ ├── saveProjectModal.tsx │ │ │ │ ├── uiSettings.tsx │ │ │ │ └── whatsThisModal.tsx │ │ └── util │ │ │ ├── libraries.ts │ │ │ └── uiUtil.ts │ ├── examples │ │ ├── exampleFilesManager.ts │ │ ├── exampleUtil.ts │ │ ├── files │ │ │ ├── transformation1 │ │ │ │ └── test1.ts │ │ │ ├── tsSimpleAst1 │ │ │ │ └── toRename.ts │ │ │ ├── tsTranspilingProject1 │ │ │ │ ├── someImpl.ts │ │ │ │ ├── someModel.ts │ │ │ │ └── someUI.tsx │ │ │ └── tsquery1 │ │ │ │ └── sample1.ts │ │ ├── languageService1.ts │ │ ├── loadProjectJsonTest1.ts │ │ ├── projectsJson │ │ │ ├── ts-sample-project.json │ │ │ └── yamat.json │ │ ├── transformation1.ts │ │ ├── tsSimple1.ts │ │ ├── tsSimpleAst1.ts │ │ ├── tsSimpleAstAndTsQueryTogether.ts │ │ ├── tsTranspilingProject1.ts │ │ ├── tsquery1.ts │ │ └── typeChecker1.ts │ └── static │ │ ├── examples │ │ ├── ts-browser-create-program-fails.html │ │ ├── ts-browser-create-sourcefile-works.html │ │ └── ts-browser-transpile-works.html │ │ ├── index.css │ │ └── index.html └── tsconfig.json └── yamat.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | .yamat 6 | *.tgz 7 | .idea 8 | /static -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${workspaceFolder}/index.js" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /candombed/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | .yamat 6 | *.tgz 7 | .idea 8 | /static 9 | /docs 10 | -------------------------------------------------------------------------------- /candombed/.npmignore: -------------------------------------------------------------------------------- 1 | /docs 2 | node_modules 3 | /src 4 | /dist* 5 | /examples 6 | /tsconfig* -------------------------------------------------------------------------------- /candombed/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /candombed/README.md: -------------------------------------------------------------------------------- 1 | # Candombed 2 | 3 | A TypeScript Project editor and framework, 100% in the browser, on top of [monaco-editor](https://github.com/Microsoft/monaco-editor). Built on top of [monaco-typescript-project-util](https://github.com/cancerberoSgx/typescript-in-the-browser/tree/master/monaco-typescript-project-util) 4 | 5 | ![candombed](https://upload.wikimedia.org/wikipedia/commons/b/b5/12_candombe.jpg) 6 | 7 | # See it in action 8 | 9 | * [Candombed - humble attempt to build a TypeScript Project Editor](https://cancerberosgx.github.io/typescript-in-the-browser/candombed) 10 | 11 | # Objectives 12 | 13 | Built on top of monaco-typescript-project-util to bring an opinionated TypeScript project editor, very simple to install, 100% browser side as static pages 14 | 15 | # Usage 16 | 17 | TODO 18 | 19 | 20 | ## Development 21 | 22 | ```sh 23 | npm install 24 | ``` 25 | 26 | Development environment: 27 | 28 | ```sh 29 | npm run dev-prepare # just once 30 | npm run dev # http://localhost:3000/ 31 | ``` 32 | 33 | or for candombed: 34 | 35 | ```sh 36 | npm run dev-candombed-prepare # just once 37 | npm run dev-candombed # http://localhost:3000/candombed/ 38 | ``` 39 | 40 | Production build: 41 | ```sh 42 | npm run all 43 | ``` 44 | 45 | That last one will generate a production ready distribution in ./docs 46 | 47 | 48 | # TODO 49 | 50 | * remove examples from the source code put in docs and fetch() 51 | add a example using tsx -------------------------------------------------------------------------------- /candombed/scripts/copy-static.ts: -------------------------------------------------------------------------------- 1 | 2 | const copies = [ 3 | { source: 'src/static/*', dest: 'static' }, 4 | { source: 'node_modules/bootstrap/dist/css/bootstrap.min.css', dest: 'static' }, 5 | { source: 'node_modules/jquery/dist/jquery.slim.min.js', dest: 'static' }, 6 | { source: 'node_modules/bootstrap/dist/js/bootstrap.min.js', dest: 'static' }, 7 | { source: 'node_modules/monaco-editor/min/vs/base/*', dest: 'static/monaco-editor/min/vs/base' }, 8 | { source: 'node_modules/monaco-editor/min/vs/editor/*', dest: 'static/monaco-editor/min/vs/editor' }, 9 | { source: 'node_modules/monaco-editor/min/vs/language/typescript/*', dest: 'static/monaco-editor/min/vs/language/typescript' }, 10 | { source: 'node_modules/monaco-editor/min/vs/basic-languages/markdown/*', dest: 'static/monaco-editor/min/vs/basic-languages/markdown' }, 11 | { source: 'node_modules/monaco-editor/min/vs/language/json/*', dest: 'static/monaco-editor/min/vs/language/json' }, 12 | { source: 'node_modules/monaco-editor/min/vs/loader.js', dest: 'static/monaco-editor/min/vs' }, 13 | { source: 'node_modules/vscode-languageserver-types/lib/umd/main.js', dest: 'static/monaco-editor/min/vscode-languageserver-types/' }, 14 | { source: 'node_modules/jsonc-parser/lib/umd/main.js', dest: 'static/jsonc-parser' } 15 | 16 | ] 17 | 18 | 19 | import { cp, mkdir } from 'shelljs' 20 | export function copy() { 21 | copies.forEach(c => { 22 | mkdir('-p', c.dest); 23 | cp('-rf', c.source, c.dest) 24 | }) 25 | } 26 | copy() 27 | 28 | -------------------------------------------------------------------------------- /candombed/scripts/hack1.ts: -------------------------------------------------------------------------------- 1 | // https://github.com/tomkp/react-split-pane/issues/284 2 | 3 | import {readFileSync, writeFileSync} from 'fs' 4 | 5 | const pj = JSON.parse(readFileSync('node_modules/react-split-pane/package.json').toString()) 6 | delete pj.browserify 7 | writeFileSync('node_modules/react-split-pane/package.json', JSON.stringify(pj, null, 2)) -------------------------------------------------------------------------------- /candombed/scripts/watch-static.ts: -------------------------------------------------------------------------------- 1 | import { watch } from 'fs'; 2 | import { copy } from './copy-static'; 3 | 4 | 5 | import { cp, mkdir } from 'shelljs' 6 | // watch('src/static', ()=>{ 7 | // copy() 8 | // }) 9 | 10 | watch('src/static', ()=>{ 11 | cp('-r', 'src/static/*', 'static') 12 | }) 13 | // watch('src/static/examples', ()=>{ 14 | // copy() 15 | // }) -------------------------------------------------------------------------------- /candombed/src/actions/State.ts: -------------------------------------------------------------------------------- 1 | import { TreeNode } from 'monaco-typescript-project-util'; 2 | import { Project, ProjectFile } from '../types'; 3 | export interface State { 4 | project: Project 5 | selectedFile?: string 6 | 7 | ui: { 8 | fileTreeNodes: TreeNode[], 9 | directoryExpandedNodeData: {fileName: string, expanded: boolean}[] 10 | } 11 | } 12 | 13 | export const initialState: State = { 14 | project: { 15 | name: '', 16 | files: [] 17 | }, 18 | ui: { 19 | fileTreeNodes: [], 20 | directoryExpandedNodeData: [] 21 | } 22 | } 23 | export function getSelectedFile(state: State): ProjectFile { 24 | return state.project.files.find(f => f.fileName === state.selectedFile) 25 | } -------------------------------------------------------------------------------- /candombed/src/actions/addFile.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import { initialState, State } from '../actions/State'; 3 | // import { store } from '../main'; 4 | import { ProjectFile } from '../types'; 5 | import { projectFilesToTreeNodes } from '../projectActions'; 6 | import { storeDispatch } from '../main'; 7 | 8 | export function addFiles(state: State = initialState, action: AddFilesAction): State { 9 | if (action.type === AddFilesActionId && state.project && state.project.files) { 10 | const files = state.project.files.concat(action.files).filter((v, i, arr) => arr.indexOf(v) === i) 11 | let newState = Object.assign({}, state, { 12 | project: Object.assign({}, state.project, { files }), 13 | ui: Object.assign({}, state.ui, { 14 | fileTreeNodes: projectFilesToTreeNodes(state.project.files, state.ui.directoryExpandedNodeData) 15 | }) 16 | }) 17 | return newState 18 | } 19 | return state 20 | } 21 | 22 | export const AddFilesActionId: 'AddFilesAction' = 'AddFilesAction' 23 | export function dispatchAddFile(files: ProjectFile[]) { 24 | storeDispatch({ 25 | type: AddFilesActionId, 26 | files 27 | }) 28 | } 29 | interface AddFilesAction extends Action { 30 | files: ProjectFile[] 31 | } -------------------------------------------------------------------------------- /candombed/src/actions/reducers.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import { selectExample } from './selectExample'; 3 | import { selectFileFromTree } from './selectFileFromTree'; 4 | import { initialState, State } from './State'; 5 | import { addFiles } from './addFile'; 6 | 7 | function voidReducer(state: State = initialState, action: Action) { 8 | return state 9 | } 10 | 11 | const allReducers: ((state: State, action: any)=>State)[] = [voidReducer, selectFileFromTree, selectExample, addFiles] 12 | 13 | export function reducer (state: State = initialState, action: Action){ 14 | let s: State = state 15 | allReducers.forEach( reducer=> { 16 | s = reducer(s, action ) 17 | } 18 | ) 19 | return s 20 | } 21 | export function getReduceres(){ 22 | return reducer 23 | } -------------------------------------------------------------------------------- /candombed/src/actions/selectExample.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import { initialState, State } from '../actions/State'; 3 | // import { store } from '../main'; 4 | import { getExamples } from '../util/examples'; 5 | import { projectFilesToTreeNodes } from '../projectActions'; 6 | import { storeDispatch } from '../main'; 7 | 8 | export function selectExample(state: State = initialState, action: SelectExampleAction): State { 9 | if (action.type === SelectExampleActionId) { 10 | const newState: State = Object.assign({}, state, { 11 | project: getExamples().find(ex => ex.name === action.exampleName), 12 | selectedFile: action.exampleName, 13 | ui: Object.assign({}, state.ui, { 14 | fileTreeNodes: projectFilesToTreeNodes(state.project.files, state.ui.directoryExpandedNodeData) 15 | }) 16 | }) 17 | return newState 18 | } 19 | return state 20 | } 21 | export const SelectExampleActionId: 'SelectExample' = 'SelectExample' 22 | 23 | export function dispatchSelectExample(exampleName: string) { 24 | storeDispatch({ 25 | type: SelectExampleActionId, 26 | exampleName 27 | }) 28 | } 29 | interface SelectExampleAction extends Action { 30 | exampleName: string 31 | } -------------------------------------------------------------------------------- /candombed/src/actions/selectFileFromTree.ts: -------------------------------------------------------------------------------- 1 | import { Action } from 'redux'; 2 | import { initialState, State } from '../actions/State'; 3 | // import { store } from '../main'; 4 | import { projectFilesToTreeNodes } from '../projectActions'; 5 | import { TreeNode } from 'monaco-typescript-project-util'; 6 | import { storeDispatch } from '../main'; 7 | 8 | 9 | export function selectFileFromTree(state: State = initialState, action: SelectFileFromTreeAction): State { 10 | if (action.type === SelectFileFromTreeActionId && state.project && state.project.files) { 11 | if (action.node.isDirectory) { 12 | let d = state.ui.directoryExpandedNodeData.find(d => d.fileName === action.node.fileName) 13 | if (!d) { 14 | d = { expanded: true, fileName: action.node.fileName } 15 | state.ui.directoryExpandedNodeData.push(d) 16 | } 17 | Object.assign(d, { expanded: !d.expanded }) 18 | return Object.assign({}, state, { 19 | ui: Object.assign(state.ui, { 20 | fileTreeNodes: projectFilesToTreeNodes(state.project.files, state.ui.directoryExpandedNodeData) 21 | }) 22 | }) 23 | } 24 | else { 25 | return Object.assign({}, state, { 26 | selectedFile: action.node.fileName 27 | }) 28 | } 29 | } 30 | return state 31 | } 32 | 33 | export const SelectFileFromTreeActionId: 'SelectFileFromTreeAction' = 'SelectFileFromTreeAction' 34 | export function dispatchSelectFileFromTree(node: TreeNode) { 35 | storeDispatch({ 36 | type: SelectFileFromTreeActionId, 37 | node 38 | }) 39 | } 40 | interface SelectFileFromTreeAction extends Action { 41 | node: TreeNode 42 | } -------------------------------------------------------------------------------- /candombed/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | // this is just for being able to import *.json files 2 | declare module "*.json" { 3 | const value: any; 4 | export default value; 5 | } -------------------------------------------------------------------------------- /candombed/src/main.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Workspace } from 'monaco-typescript-project-util'; 3 | import ReactDOM from 'react-dom'; 4 | import { Action, createStore, Store } from 'redux'; 5 | import { getReduceres } from './actions/reducers'; 6 | import { dispatchSelectExample } from './actions/selectExample'; 7 | import { dispatchSelectFileFromTree } from './actions/selectFileFromTree'; 8 | import { State } from './actions/State'; 9 | import layout from './ui/layout'; 10 | 11 | const store: Store = createStore(getReduceres()) 12 | export function storeDispatch(a: T): T { 13 | return store.dispatch(a); 14 | } 15 | 16 | function render(state: State = store.getState()) { 17 | ReactDOM.render(layout(state), document.getElementById('candombed-main')) 18 | } 19 | 20 | class CandombeWorkspace extends Workspace { 21 | oldState: State 22 | start() { 23 | store.subscribe(() => { 24 | const newState = store.getState() 25 | if (this.oldState && this.oldState.project.name != newState.project.name) { 26 | this.projectChanged(newState.project) 27 | } 28 | this.oldState = newState 29 | render(newState) 30 | }) 31 | setTimeout(() => { 32 | dispatchSelectExample('yamat') 33 | }, 500); 34 | } 35 | 36 | public selectedFileChanged(fileName: string) { 37 | dispatchSelectFileFromTree({ fileName, children: [], isDirectory: false }) 38 | } 39 | } 40 | 41 | const workspace = new CandombeWorkspace() 42 | workspace.setup().then(() => workspace.start()) 43 | -------------------------------------------------------------------------------- /candombed/src/projectActions.ts: -------------------------------------------------------------------------------- 1 | import { getMonacoModelFor } from 'monaco-typescript-project-util' 2 | import { getTsWorker } from 'monaco-typescript-project-util' 3 | import { dispatchAddFile } from './actions/addFile'; 4 | import { getSelectedFile, State } from './actions/State'; 5 | import { filesToTreeNodes, TreeNode } from 'monaco-typescript-project-util' 6 | 7 | import { ProjectFile } from './types'; 8 | //TODO: move to util/actionManager 9 | export async function getEmitOutput(state: State) { 10 | getTsWorker(getMonacoModelFor(getSelectedFile(state)).uri).then(async w => { 11 | const files = await w.getScriptFileNames() 12 | files.forEach(async f => { 13 | const emit = await w.getEmitOutput(f) 14 | const files = emit.outputFiles 15 | .filter(f => !f.name.startsWith('inmemory:/')) 16 | .map(outputFile => ({ 17 | fileName: outputFile.name 18 | .replace('file:///', ''), content: outputFile.text 19 | })) 20 | dispatchAddFile(files) 21 | }) 22 | }) 23 | } 24 | //TODO: move to util/actionManager 25 | export function projectFilesToTreeNodes(files: ProjectFile[], 26 | directoryExpandedNodeData: { fileName: string, expanded: boolean }[]): TreeNode[] { 27 | return filesToTreeNodes(files, undefined, (node, file: ProjectFile) => { 28 | if (node.isDirectory) { 29 | const found = directoryExpandedNodeData.find(n => n.fileName === node.fileName) 30 | node = Object.assign(node, { expanded: !found || found.expanded }) 31 | } 32 | return node 33 | }) 34 | } -------------------------------------------------------------------------------- /candombed/src/static/examples/monaco-project.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TypeScript Compiler in the browser 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |
21 | 22 | 23 | 49 | 50 | -------------------------------------------------------------------------------- /candombed/src/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | candombed 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /candombed/src/static/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Page Title 7 | 8 | 9 | 10 | 11 | 12 | 26 |
27 |

28 | I will change color 29 |

30 |

31 | Click me 32 |

33 |
34 | 35 | -------------------------------------------------------------------------------- /candombed/src/types.ts: -------------------------------------------------------------------------------- 1 | import { AbstractFile, AbstractProject } from 'monaco-typescript-project-util'; 2 | 3 | export interface Project extends AbstractProject{ 4 | files: ProjectFile[] 5 | } 6 | 7 | export interface ProjectFile extends AbstractFile{ 8 | expanded?: boolean 9 | } 10 | -------------------------------------------------------------------------------- /candombed/src/ui/fileTree.tsx: -------------------------------------------------------------------------------- 1 | import { FileTree, TreeNode } from 'monaco-typescript-project-util'; 2 | import { MouseEvent } from 'react'; 3 | import { ExtendedNodeData } from 'react-sortable-tree'; 4 | import { dispatchSelectFileFromTree } from '../actions/selectFileFromTree'; 5 | import { State } from '../actions/State'; 6 | import { onContextMenu, destroyTooltip } from './contextMenu'; 7 | import { projectFilesToTreeNodes } from '../projectActions'; 8 | 9 | 10 | export class CandombedFileTree extends FileTree { 11 | setSelectedFile(node: TreeNode) { 12 | dispatchSelectFileFromTree(node) 13 | destroyTooltip() // TODO: do it right with state and redux! 14 | } 15 | 16 | getTestData(): TreeNode[] { 17 | return projectFilesToTreeNodes(this.props.state.project.files, this.props.state.ui.directoryExpandedNodeData) 18 | } 19 | 20 | onContextMenu(e: MouseEvent, rowInfo: ExtendedNodeData, state: State) { 21 | onContextMenu(e, rowInfo, state) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /candombed/src/ui/forkRibbon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default ()=> 4 |
5 | 6 | function getRibbonHtml(){ 7 | return {__html: 'Fork me on GitHub'} 8 | 9 | } -------------------------------------------------------------------------------- /candombed/src/ui/layout.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import SplitPane from 'react-split-pane'; 3 | import { CandombedFileTree } from './fileTree'; 4 | import navbar from './navbar'; 5 | import { Editor } from 'monaco-typescript-project-util'; 6 | import { State, getSelectedFile } from '../actions/State'; 7 | import whatsThisModal from './modals/whatsThisModal'; 8 | import loadProjectModal from './modals/loadProjectModal'; 9 | import saveProjectModal from './modals/saveProjectModal'; 10 | import forkRibbon from './forkRibbon'; 11 | 12 | 13 | export default (state: State) => { 14 | 15 | return ( 16 |
17 | {navbar(state)} 18 | 19 | 28 | 29 | 34 | 35 | 36 |
console.log stuff panel
37 |
38 |
39 | {forkRibbon()} 40 | {whatsThisModal(state)} 41 | {loadProjectModal(state)} 42 | {saveProjectModal(state)} 43 |
44 | ) 45 | } 46 | -------------------------------------------------------------------------------- /candombed/src/ui/modals/loadProjectModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { State } from '../../actions/State'; 3 | 4 | export default (state: State)=>{ 5 | 6 | return ( 7 | 8 | 34 | 35 | 36 | )} -------------------------------------------------------------------------------- /candombed/src/ui/modals/saveProjectModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { projectToJson } from 'monaco-typescript-project-util'; 3 | import { State } from '../../actions/State'; 4 | 5 | export default (state: State)=>{ 6 | 7 | return ( 8 | 9 | 32 | 33 | 34 | )} -------------------------------------------------------------------------------- /candombed/src/ui/modals/whatsThisModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { State } from '../../actions/State'; 3 | 4 | export default (state: State)=> 5 | 6 | 25 | 26 | -------------------------------------------------------------------------------- /candombed/src/util/examples.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as tsSampleProjectFiles from '../examples/projectsJson/ts-sample-project.json' 3 | import * as yamatProjectFiles from '../examples/projectsJson/yamat.json' 4 | import * as vsCodeInlineTypes from '../examples/projectsJson/vscode-inline-types-master.json' 5 | import * as yo from '../examples/projectsJson/yo-master.json' 6 | 7 | import { ProjectFile } from '../types'; 8 | 9 | export function getExamples(){ 10 | return [ 11 | { 12 | name: 'yamat', 13 | files: (yamatProjectFiles as any).files as ProjectFile[] 14 | }, 15 | { 16 | name: 'tsSample', 17 | files: (tsSampleProjectFiles as any).files as ProjectFile[] 18 | }, 19 | { 20 | name: 'vscode-inline-types', 21 | files: (vsCodeInlineTypes as any).files as ProjectFile[] 22 | }, 23 | { 24 | name: 'yo (JavaScript)', 25 | files: (yo as any).files as ProjectFile[] 26 | }, 27 | 28 | 29 | ] 30 | } -------------------------------------------------------------------------------- /candombed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "jsx": "react", 7 | "jsxFactory": "React.createElement", 8 | "lib": ["es2018", "dom"], 9 | "outDir": "./dist", 10 | "rootDir": ".", 11 | "strict": true, 12 | "pretty": false, 13 | "strictNullChecks": false, 14 | // "noImplicitAny": false, 15 | "sourceMap": true, 16 | "esModuleInterop": true, 17 | "declaration": true, 18 | "skipLibCheck": true 19 | }, 20 | "include": [ 21 | "src" 22 | ], 23 | "exclude": [ 24 | "src/examples" 25 | ] 26 | } -------------------------------------------------------------------------------- /docs/candombed/examples/monaco-project.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TypeScript Compiler in the browser 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |
21 | 22 | 23 | 49 | 50 | -------------------------------------------------------------------------------- /docs/candombed/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | candombed 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/candombed/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Page Title 7 | 8 | 9 | 10 | 11 | 12 | 26 |
27 |

28 | I will change color 29 |

30 |

31 | Click me 32 |

33 |
34 | 35 | -------------------------------------------------------------------------------- /docs/monaco-typescript-project-util-sample-project/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Awesome TS Project Editor 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Fork me on GitHub 15 | 16 | -------------------------------------------------------------------------------- /docs/monaco-typescript-project-util-sample-project/main.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | } 4 | .wrapper { 5 | display: grid; 6 | grid-template-columns: 1fr 2fr; 7 | width: 100%; 8 | height: 100%; 9 | } 10 | .editor { 11 | resize: both; 12 | overflow: auto; 13 | } 14 | .files { 15 | background: #918899 16 | } 17 | .files .selected { 18 | background: #ccabeb 19 | } -------------------------------------------------------------------------------- /docs/typescript-compiler/examples/ts-browser-create-program-fails.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TypeScript Compiler API very simple example - transpiling code 8 | 9 | 10 | 11 | 12 | 13 |

In this example we just load typescript.js as it is, creating a Program fails because it tries to access the native filesystem (ts.sys is undefined in the browser). So we need to provide a custom CompilerHost and LanguageServiceHost and that's what this project is all about. 14 |

15 | 16 | 17 |

TypeScript Program:

18 |
19 | log = function (s) { document.getElementById('output').innerText += s + '\n' }
20 | const program = ts.createProgram(['test1.ts'], {})
21 | const sourceFile = ts.getSourceFile('test1.ts')
22 | log(sourceFile.getText())
23 |   
24 |

Output:

25 |

26 | 
27 | 
28 |   
29 | 
30 |   
40 | 
41 | 
42 | 
43 | 


--------------------------------------------------------------------------------
/docs/typescript-compiler/index.css:
--------------------------------------------------------------------------------
 1 | .editor{
 2 |   resize: vertical;
 3 |   overflow: auto;
 4 | }
 5 | 
 6 | 
 7 | #tsProjectFolderDropArea {
 8 |   width: 300px; 
 9 |   height: 150px; 
10 |   border: 3px solid pink; 
11 |   background-color: darkolivegreen
12 | }
13 | 
14 | #saveProjectJsonTextarea{
15 |   width: 100%
16 | }
17 | .rstcustom__rowWrapper{
18 | cursor: pointer
19 | }
20 | .rstcustom__node .selected {
21 |   background-color: #edaaaa
22 | }
23 | .examples-menu-item{
24 |   font-weight: bolder;
25 |   color: white !important;
26 |   text-decoration: underline
27 | }


--------------------------------------------------------------------------------
/docs/typescript-compiler/index.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |   
 5 |   
 6 |   TypeScript Compiler in the browser
 7 |   
 8 |   
 9 |   
10 | 
11 | 
12 |   
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 40 | 41 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-cli/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /dist* -------------------------------------------------------------------------------- /monaco-typescript-project-util-cli/.npmignore: -------------------------------------------------------------------------------- 1 | /docs 2 | node_modules 3 | /src 4 | /dist* 5 | /examples 6 | /tsconfig* -------------------------------------------------------------------------------- /monaco-typescript-project-util-cli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monaco-typescript-project-util-cli", 3 | "version": "1.0.0", 4 | "description": "example on using monaco-typescript-project-util just to see how easy it is", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "build": "tsc", 9 | "prepare": "npm run build", 10 | "all": "exit 0 " 11 | }, 12 | "repository": "https://github.com/cancerberoSgx/typescript-in-the-browser/tree/master/monaco-typescript-project-util-cli", 13 | "keywords": [ 14 | "monaco-editor", 15 | "typescript" 16 | ], 17 | "author": "Sebastian Gurin", 18 | "license": "MIT", 19 | "dependencies": { 20 | "shelljs": "^0.8.2" 21 | }, 22 | "devDependencies": { 23 | "@types/node": "^10.5.1", 24 | "@types/shelljs": "^0.8.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "jsx": "react", 7 | "lib": ["es2017", "dom"], 8 | "outDir": "./dist", 9 | "rootDir": "src", 10 | "strict": true, 11 | "strictNullChecks": false, 12 | "noImplicitAny": true, 13 | "sourceMap": true, 14 | "esModuleInterop": true, 15 | "declaration": true, 16 | "skipLibCheck": true 17 | }, 18 | "include": [ 19 | "src" 20 | ] 21 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | .yamat 6 | *.tgz 7 | .idea 8 | /static -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/README.md: -------------------------------------------------------------------------------- 1 | # monaco-typescript-project-util example project 1 2 | 3 | This is an example of using [monaco-typescript-project-util](https://github.com/cancerberoSgx/typescript-in-the-browser/tree/master/monaco-typescript-project-util). Most of the implementation resides in [index.ts](https://github.com/cancerberoSgx/typescript-in-the-browser/blob/master/monaco-typescript-project-util-sample-project/src/index.ts) file. 4 | 5 | More complex / variation examples to come. 6 | 7 | 8 | # See it in action 9 | 10 | * [Simple Sample project using monaco-typescript-project-util](https://cancerberosgx.github.io/typescript-in-the-browser/monaco-typescript-project-util-sample-project) 11 | 12 | # Objectives 13 | 14 | Built on top of monaco-typescript-project-util to bring an opinionated TypeScript project editor, very simple to install, 100% browser side as static pages 15 | 16 | # Development 17 | 18 | ```sh 19 | npm run dev 20 | ``` 21 | 22 | # Production build 23 | 24 | For generate a production ready distribution in ./static 25 | 26 | ```sh 27 | npm run build-production 28 | ``` 29 | 30 | # TODO 31 | 32 | * run docco from index.ts 33 | 34 | ## Done 35 | 36 | * There's an issue when user navigates through files the file tree stop working 37 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/src/layout.tsx: -------------------------------------------------------------------------------- 1 | import { AbstractProject, Editor, AbstractFile } from 'monaco-typescript-project-util'; 2 | import React from 'react'; 3 | import projectFiles from './projectFiles'; 4 | 5 | export default (project: AbstractProject, file: AbstractFile) => 6 |
7 |
8 | {projectFiles(project, file)} 9 |
10 | 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/src/projectFiles.tsx: -------------------------------------------------------------------------------- 1 | import { AbstractFile, AbstractProject } from 'monaco-typescript-project-util'; 2 | import React, { MouseEvent } from 'react'; 3 | import { ourAwesomeEditor } from '.'; 4 | 5 | export default (project: AbstractProject, selectedFile: AbstractFile) => 6 |
7 |

{project.name}'s' files:

8 |
    9 | {project.files.map(file => 10 |
  • 11 | {file.fileName} 12 |
  • 13 | )} 14 |
15 |
16 | 17 | function onFileListClicked(e: MouseEvent) { 18 | const clickedLink = e.target as HTMLAnchorElement 19 | const fileName = clickedLink.getAttribute('data-filename') 20 | ourAwesomeEditor.selectedFileChanged(fileName) 21 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/src/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Awesome TS Project Editor 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Fork me on GitHub 15 | 16 | -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/src/static/main.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | } 4 | .wrapper { 5 | display: grid; 6 | grid-template-columns: 1fr 2fr; 7 | width: 100%; 8 | height: 100%; 9 | } 10 | .editor { 11 | resize: both; 12 | overflow: auto; 13 | } 14 | .files { 15 | background: #918899 16 | } 17 | .files .selected { 18 | background: #ccabeb 19 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util-sample-project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "jsx": "react", 7 | "lib": ["es2018", "dom"], 8 | "outDir": "./dist", 9 | "rootDir": "src", 10 | "strict": true, 11 | "strictNullChecks": false, 12 | "noImplicitAny": true, 13 | "sourceMap": true, 14 | "esModuleInterop": true, 15 | "declaration": true, 16 | "skipLibCheck": true 17 | }, 18 | "include": [ 19 | "src" 20 | ] 21 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | .yamat 6 | *.tgz 7 | .idea 8 | /static 9 | /docs 10 | /docs -------------------------------------------------------------------------------- /monaco-typescript-project-util/.npmignore: -------------------------------------------------------------------------------- 1 | /docs 2 | node_modules 3 | /src 4 | /dist* 5 | /examples 6 | /tsconfig* -------------------------------------------------------------------------------- /monaco-typescript-project-util/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monaco-typescript-project-util", 3 | "version": "0.1.2", 4 | "description": "attempt to see if and how much we can run typescript compiler in the browser", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "build": "tsc", 9 | "all": "npm run build", 10 | "all-no-minify": "npm run build", 11 | "prepare": "npm run build" 12 | }, 13 | "keywords": [ 14 | "monaco-editor", 15 | "monaco editor", 16 | "monaco", 17 | "online editor", 18 | "TypeScript editor", 19 | "TypeScript project editor", 20 | "TypeScript" 21 | ], 22 | "author": "Sebastian Gurin", 23 | "license": "MIT", 24 | "repository": "https://github.com/cancerberoSgx/typescript-in-the-browser/tree/master/monaco-typescript-project-util", 25 | "dependencies": { 26 | "jsonc-parser": "^2.0.0", 27 | "monaco-editor": "^0.13.1", 28 | "react": "^16.4.1", 29 | "react-dom": "^16.4.1", 30 | "react-sortable-tree": "^2.2.0", 31 | "react-sortable-tree-theme-file-explorer": "^1.1.2", 32 | "typescript": "^2.9.2", 33 | "vscode-languageserver-types": "^3.8.2" 34 | }, 35 | "devDependencies": { 36 | "@types/node": "^10.3.6", 37 | "@types/react": "^16.4.2", 38 | "@types/react-dom": "^16.0.6", 39 | "@types/react-sortable-tree": "^0.2.1", 40 | "browser-sync": "^2.24.4", 41 | "browserify": "^16.2.2", 42 | "concurrently": "^3.6.0", 43 | "google-closure-compiler": "^20180610.0.2", 44 | "i": "^0.3.6", 45 | "source-map-support": "^0.5.6", 46 | "watchify": "^3.11.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/index.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from './types' 3 | export * from './ui' 4 | export * from './monaco' 5 | export * from './ui-util' 6 | export * from './util' 7 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/monaco/actionManager.ts: -------------------------------------------------------------------------------- 1 | import { AbstractProject } from '../types'; 2 | import { Workspace } from './workspaceManager'; 3 | import { installTypes } from './installTypes'; 4 | import { ProjectNature } from './tsConfig'; 5 | import { Action } from 'redux'; 6 | 7 | export class ActionManager { 8 | constructor(private workspace: Workspace) { 9 | 10 | } 11 | installTypes(project: AbstractProject): Promise { 12 | return installTypes(project, this.workspace.projectNature) 13 | } 14 | } 15 | let instance: ActionManager 16 | 17 | export function getActionManager(w?: Workspace): ActionManager { 18 | if (w && !instance) { 19 | instance = new ActionManager(w) 20 | } 21 | return instance 22 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/monaco/index.ts: -------------------------------------------------------------------------------- 1 | export * from './installTypes' 2 | export * from './monacoFacade' 3 | export * from './navigateExternalDefinitions' 4 | export * from './workspaceManager' 5 | export * from './register' 6 | export * from './tsConfig' 7 | export * from './tsWorker' 8 | export * from './actionManager' 9 | export * from './loader/cdnAmdLoader' 10 | export * from './workspaceManager' -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/monaco/monacoFacade.ts: -------------------------------------------------------------------------------- 1 | // monaco-editor type and hacks "facade" 2 | import * as _monaco from 'monaco-editor'; 3 | export function getMonaco(): typeof _monaco { 4 | return (window as any).monaco 5 | } 6 | export const re_quireMonaco = function(fn: () => void):void{ 7 | if(!(window as any).Re_quireMonaco){ 8 | const timer = setInterval(()=>{ 9 | if((window as any).Re_quireMonaco){ 10 | clearInterval(timer); 11 | (window as any).Re_quireMonaco(fn) 12 | } 13 | }, 100) 14 | } 15 | else{ 16 | (window as any).Re_quireMonaco(fn) 17 | } 18 | } 19 | 20 | export const monacoLoaded = ():Promise => { 21 | return new Promise(resolve=>{ 22 | re_quireMonaco(()=>resolve(getMonaco())) 23 | }) 24 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface AbstractFile { 2 | fileName: string 3 | content: string 4 | isDirectory?: boolean 5 | } 6 | 7 | export interface AbstractProject { 8 | name: string 9 | files: AbstractFile[] 10 | } 11 | 12 | export interface AbstractState{ 13 | project: AbstractProject, selectedFile?: string 14 | } 15 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/ui-util/index.ts: -------------------------------------------------------------------------------- 1 | export * from './fileTreeUtil' -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/ui/FileTree.tsx: -------------------------------------------------------------------------------- 1 | import React, { Component, MouseEvent } from 'react'; 2 | import SortableTree, { ExtendedNodeData } from 'react-sortable-tree'; 3 | import { AbstractState } from '../types'; 4 | import { filesToTreeNodes, TreeNode } from '../ui-util/fileTreeUtil'; 5 | const FileExplorerTheme = require('react-sortable-tree-theme-file-explorer'); 6 | 7 | // TODO : for performance move the onClick on the parent div (event delegation) 8 | export class FileTree extends Component<{ state:T }> { 9 | render() { 10 | if (!this.props.state.project) { 11 | return (
No project open
) 12 | } 13 | const treeData = this.getTestData() 14 | return ( 15 |
16 | this.setState({ treeData })} 19 | theme={FileExplorerTheme} 20 | canDrag={true} 21 | generateNodeProps={rowInfo => ({ 22 | onClick: (event:MouseEvent) => this.nodeClicked(event, rowInfo), 23 | class: this.props.state.selectedFile === (rowInfo.node as TreeNode).fileName ? 'selected' : '', 24 | onContextMenu: (e:MouseEvent) => { this.onContextMenu(e, rowInfo, this.props.state) } 25 | })} 26 | /> 27 |
28 | ); 29 | } 30 | getTestData() { 31 | return filesToTreeNodes(this.props.state.project.files) 32 | } 33 | nodeClicked(event: MouseEvent, rowInfo: ExtendedNodeData): any { 34 | this.setSelectedFile(rowInfo.node as TreeNode) 35 | } 36 | onContextMenu(e: MouseEvent, rowInfo: ExtendedNodeData, state: AbstractState){ 37 | 38 | } 39 | setSelectedFile(node: TreeNode) { 40 | } 41 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/ui/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Editor' 2 | export * from './FileTree' 3 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/util/fetchUtil.ts: -------------------------------------------------------------------------------- 1 | export function fetchFileText(url: string): Promise { 2 | return new Promise((resolve, reject) => { 3 | fetch(url) 4 | .then(response => response.blob()) 5 | .then(blob => { 6 | return new Promise(resolve => { 7 | const reader = new FileReader() 8 | reader.readAsText(blob) 9 | if (!reader.result && !reader.result.toString()) { 10 | reader.addEventListener("loadend", () => { 11 | resolve(reader.result.toString()) 12 | }) 13 | } 14 | else { 15 | resolve(reader.result.toString()) 16 | } 17 | }) 18 | }) 19 | .catch(ex => { 20 | reject(ex) 21 | throw ex 22 | }) 23 | .then(responseData => { 24 | resolve(responseData as string) 25 | }) 26 | .catch(ex => { 27 | reject(ex) 28 | }) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/util/filesDefinitions.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface PackageJson { 3 | name: string; 4 | version: string; 5 | description: string; 6 | main: string; 7 | typings: string; 8 | scripts: {[k: string]: string}; 9 | keywords: string[]; 10 | author: string; 11 | license: string; 12 | dependencies: {[k: string]: string}; 13 | devDependencies: {[k: string]: string}; 14 | } 15 | 16 | 17 | export interface TsConfigJson { 18 | compilerOptions: CompilerOptions; 19 | include: string[]; 20 | } 21 | 22 | export interface CompilerOptions { 23 | target: string; 24 | module: string; 25 | moduleResolution: string; 26 | jsx: string; 27 | jsxFactory: string; 28 | lib: string[]; 29 | outDir: string; 30 | rootDir: string; 31 | strict: boolean; 32 | strictNullChecks: boolean; 33 | noImplicitAny: boolean; 34 | sourceMap: boolean; 35 | esModuleInterop: boolean; 36 | declaration: boolean; 37 | skipLibCheck: boolean; 38 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/util/index.ts: -------------------------------------------------------------------------------- 1 | export * from './fetchUtil' 2 | export * from './logUtil' 3 | export * from './projectSerialization' 4 | export * from './tsUtil' 5 | export * from './filesDefinitions' -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/util/logUtil.ts: -------------------------------------------------------------------------------- 1 | export function debugFactory(componentName: string): Debug { 2 | return function debug(m: string) { 3 | if (debugFlags[componentName]) { 4 | console.log(`${componentName} debug: ${m}`) 5 | } 6 | } 7 | } 8 | const debugFlags: {[k: string]: boolean} = {} 9 | export function setDebugEnabledFor(componentName: string, enabled: boolean){ 10 | debugFlags[componentName] = enabled 11 | } 12 | export type Debug = (m: string) => void 13 | 14 | 15 | -------------------------------------------------------------------------------- /monaco-typescript-project-util/src/util/projectSerialization.ts: -------------------------------------------------------------------------------- 1 | import { AbstractProject } from '../types'; 2 | 3 | export function projectToJson(p: AbstractProject): string { 4 | return JSON.stringify(p) 5 | } 6 | 7 | export function jsonToProject(s: string): AbstractProject { 8 | // TODO: do it well , checking each property 9 | const parsed = JSON.parse(s) as AbstractProject 10 | // parsed.execute = () => { } 11 | return parsed 12 | } -------------------------------------------------------------------------------- /monaco-typescript-project-util/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "jsx": "react", 7 | "jsxFactory": "React.createElement", 8 | "lib": ["es2018", "dom"], 9 | "outDir": "./dist", 10 | "rootDir": ".", 11 | "strict": true, 12 | "strictNullChecks": false, 13 | "noImplicitAny": true, 14 | "sourceMap": true, 15 | "esModuleInterop": true, 16 | "declaration": true, 17 | "skipLibCheck": true 18 | }, 19 | "include": [ 20 | "src" 21 | ] 22 | } -------------------------------------------------------------------------------- /node_modules/.bin/shjs: -------------------------------------------------------------------------------- 1 | ../shelljs/bin/shjs -------------------------------------------------------------------------------- /node_modules/.bin/yamat: -------------------------------------------------------------------------------- 1 | ../yamat/bin/yamat.js -------------------------------------------------------------------------------- /node_modules/balanced-match/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | .gitignore 3 | .travis.yml 4 | Makefile 5 | example.js 6 | -------------------------------------------------------------------------------- /node_modules/balanced-match/LICENSE.md: -------------------------------------------------------------------------------- 1 | (MIT) 2 | 3 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/balanced-match/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = balanced; 3 | function balanced(a, b, str) { 4 | if (a instanceof RegExp) a = maybeMatch(a, str); 5 | if (b instanceof RegExp) b = maybeMatch(b, str); 6 | 7 | var r = range(a, b, str); 8 | 9 | return r && { 10 | start: r[0], 11 | end: r[1], 12 | pre: str.slice(0, r[0]), 13 | body: str.slice(r[0] + a.length, r[1]), 14 | post: str.slice(r[1] + b.length) 15 | }; 16 | } 17 | 18 | function maybeMatch(reg, str) { 19 | var m = str.match(reg); 20 | return m ? m[0] : null; 21 | } 22 | 23 | balanced.range = range; 24 | function range(a, b, str) { 25 | var begs, beg, left, right, result; 26 | var ai = str.indexOf(a); 27 | var bi = str.indexOf(b, ai + 1); 28 | var i = ai; 29 | 30 | if (ai >= 0 && bi > 0) { 31 | begs = []; 32 | left = str.length; 33 | 34 | while (i >= 0 && !result) { 35 | if (i == ai) { 36 | begs.push(i); 37 | ai = str.indexOf(a, i + 1); 38 | } else if (begs.length == 1) { 39 | result = [ begs.pop(), bi ]; 40 | } else { 41 | beg = begs.pop(); 42 | if (beg < left) { 43 | left = beg; 44 | right = bi; 45 | } 46 | 47 | bi = str.indexOf(b, i + 1); 48 | } 49 | 50 | i = ai < bi && ai >= 0 ? ai : bi; 51 | } 52 | 53 | if (begs.length) { 54 | result = [ left, right ]; 55 | } 56 | } 57 | 58 | return result; 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/brace-expansion/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013 Julian Gruber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/camelcase/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function preserveCamelCase(str) { 4 | let isLastCharLower = false; 5 | let isLastCharUpper = false; 6 | let isLastLastCharUpper = false; 7 | 8 | for (let i = 0; i < str.length; i++) { 9 | const c = str[i]; 10 | 11 | if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) { 12 | str = str.substr(0, i) + '-' + str.substr(i); 13 | isLastCharLower = false; 14 | isLastLastCharUpper = isLastCharUpper; 15 | isLastCharUpper = true; 16 | i++; 17 | } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) { 18 | str = str.substr(0, i - 1) + '-' + str.substr(i - 1); 19 | isLastLastCharUpper = isLastCharUpper; 20 | isLastCharUpper = false; 21 | isLastCharLower = true; 22 | } else { 23 | isLastCharLower = c.toLowerCase() === c; 24 | isLastLastCharUpper = isLastCharUpper; 25 | isLastCharUpper = c.toUpperCase() === c; 26 | } 27 | } 28 | 29 | return str; 30 | } 31 | 32 | module.exports = function (str) { 33 | if (arguments.length > 1) { 34 | str = Array.from(arguments) 35 | .map(x => x.trim()) 36 | .filter(x => x.length) 37 | .join('-'); 38 | } else { 39 | str = str.trim(); 40 | } 41 | 42 | if (str.length === 0) { 43 | return ''; 44 | } 45 | 46 | if (str.length === 1) { 47 | return str.toLowerCase(); 48 | } 49 | 50 | if (/^[a-z0-9]+$/.test(str)) { 51 | return str; 52 | } 53 | 54 | const hasUpperCase = str !== str.toLowerCase(); 55 | 56 | if (hasUpperCase) { 57 | str = preserveCamelCase(str); 58 | } 59 | 60 | return str 61 | .replace(/^[_.\- ]+/, '') 62 | .toLowerCase() 63 | .replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase()); 64 | }; 65 | -------------------------------------------------------------------------------- /node_modules/camelcase/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/camelcase/readme.md: -------------------------------------------------------------------------------- 1 | # camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) 2 | 3 | > Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar` 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save camelcase 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const camelCase = require('camelcase'); 17 | 18 | camelCase('foo-bar'); 19 | //=> 'fooBar' 20 | 21 | camelCase('foo_bar'); 22 | //=> 'fooBar' 23 | 24 | camelCase('Foo-Bar'); 25 | //=> 'fooBar' 26 | 27 | camelCase('--foo.bar'); 28 | //=> 'fooBar' 29 | 30 | camelCase('__foo__bar__'); 31 | //=> 'fooBar' 32 | 33 | camelCase('foo bar'); 34 | //=> 'fooBar' 35 | 36 | console.log(process.argv[3]); 37 | //=> '--foo-bar' 38 | camelCase(process.argv[3]); 39 | //=> 'fooBar' 40 | 41 | camelCase('foo', 'bar'); 42 | //=> 'fooBar' 43 | 44 | camelCase('__foo__', '--bar'); 45 | //=> 'fooBar' 46 | ``` 47 | 48 | 49 | ## Related 50 | 51 | - [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module 52 | - [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase 53 | 54 | 55 | ## License 56 | 57 | MIT © [Sindre Sorhus](https://sindresorhus.com) 58 | -------------------------------------------------------------------------------- /node_modules/concat-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /node_modules/concat-map/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/concat-map/README.markdown: -------------------------------------------------------------------------------- 1 | concat-map 2 | ========== 3 | 4 | Concatenative mapdashery. 5 | 6 | [![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) 7 | 8 | [![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) 9 | 10 | example 11 | ======= 12 | 13 | ``` js 14 | var concatMap = require('concat-map'); 15 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 16 | var ys = concatMap(xs, function (x) { 17 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 18 | }); 19 | console.dir(ys); 20 | ``` 21 | 22 | *** 23 | 24 | ``` 25 | [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] 26 | ``` 27 | 28 | methods 29 | ======= 30 | 31 | ``` js 32 | var concatMap = require('concat-map') 33 | ``` 34 | 35 | concatMap(xs, fn) 36 | ----------------- 37 | 38 | Return an array of concatenated elements by calling `fn(x, i)` for each element 39 | `x` and each index `i` in the array `xs`. 40 | 41 | When `fn(x, i)` returns an array, its result will be concatenated with the 42 | result array. If `fn(x, i)` returns anything else, that value will be pushed 43 | onto the end of the result array. 44 | 45 | install 46 | ======= 47 | 48 | With [npm](http://npmjs.org) do: 49 | 50 | ``` 51 | npm install concat-map 52 | ``` 53 | 54 | license 55 | ======= 56 | 57 | MIT 58 | 59 | notes 60 | ===== 61 | 62 | This module was written while sitting high above the ground in a tree. 63 | -------------------------------------------------------------------------------- /node_modules/concat-map/example/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 3 | var ys = concatMap(xs, function (x) { 4 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 5 | }); 6 | console.dir(ys); 7 | -------------------------------------------------------------------------------- /node_modules/concat-map/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (xs, fn) { 2 | var res = []; 3 | for (var i = 0; i < xs.length; i++) { 4 | var x = fn(xs[i], i); 5 | if (isArray(x)) res.push.apply(res, x); 6 | else res.push(x); 7 | } 8 | return res; 9 | }; 10 | 11 | var isArray = Array.isArray || function (xs) { 12 | return Object.prototype.toString.call(xs) === '[object Array]'; 13 | }; 14 | -------------------------------------------------------------------------------- /node_modules/concat-map/test/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var test = require('tape'); 3 | 4 | test('empty or not', function (t) { 5 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 6 | var ixes = []; 7 | var ys = concatMap(xs, function (x, ix) { 8 | ixes.push(ix); 9 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 10 | }); 11 | t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); 12 | t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); 13 | t.end(); 14 | }); 15 | 16 | test('always something', function (t) { 17 | var xs = [ 'a', 'b', 'c', 'd' ]; 18 | var ys = concatMap(xs, function (x) { 19 | return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; 20 | }); 21 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 22 | t.end(); 23 | }); 24 | 25 | test('scalars', function (t) { 26 | var xs = [ 'a', 'b', 'c', 'd' ]; 27 | var ys = concatMap(xs, function (x) { 28 | return x === 'b' ? [ 'B', 'B', 'B' ] : x; 29 | }); 30 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 31 | t.end(); 32 | }); 33 | 34 | test('undefs', function (t) { 35 | var xs = [ 'a', 'b', 'c', 'd' ]; 36 | var ys = concatMap(xs, function () {}); 37 | t.same(ys, [ undefined, undefined, undefined, undefined ]); 38 | t.end(); 39 | }); 40 | -------------------------------------------------------------------------------- /node_modules/executive/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2018 Zach Kelling 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/executive/executive.d.ts: -------------------------------------------------------------------------------- 1 | declare function exec(command: string | any[], options?: any, callback?: any): Promise 2 | 3 | declare namespace exec { 4 | export function interactive(command: string | any[], options?: any, callback?: any): Promise 5 | export function parallel(command: string | any[], options?: any, callback?: any): Promise 6 | export function quiet(command: string | any[], options?: any, callback?: any): Promise 7 | export function serial(command: string | any[], options?: any, callback?: any): Promise 8 | export function strict(command: string | any[], options?: any, callback?: any): Promise 9 | export function sync(command: string | any[], options?: any, callback?: any): any 10 | } 11 | 12 | export = exec 13 | -------------------------------------------------------------------------------- /node_modules/executive/src/flow/index.coffee: -------------------------------------------------------------------------------- 1 | import {isArray, isObject, isString} from 'es-is' 2 | 3 | import async from '../spawn/async' 4 | import sync from '../spawn/sync' 5 | import parallel from './parallel' 6 | import serial from './serial' 7 | 8 | 9 | # Execute array of commands, with serial exution by default 10 | array = (exec, cmds, opts, cb) -> 11 | if opts.parallel 12 | parallel exec, cmds, opts, cb 13 | else 14 | serial exec, cmds, opts, cb 15 | 16 | 17 | # Execute string representing commands 18 | string = (exec, str, opts, cb) -> 19 | cmds = (s for s in str.split '\n' when s.trim() != '') 20 | array exec, cmds, opts, cb 21 | 22 | 23 | # Execute object of commands 24 | object = (exec, obj, opts, cb) -> 25 | cmds = ([k, cmd] for k, cmd of obj) 26 | array exec, cmds, opts, cb 27 | 28 | 29 | # Execute commands using either serial or parallel control flow and return 30 | # result to cb 31 | export default (cmds, opts, cb) -> 32 | # Use sync exec if necessary 33 | exec = if opts.sync then sync else async 34 | 35 | if isString cmds 36 | return string exec, cmds, opts, cb 37 | if isObject cmds 38 | return object exec, cmds, opts, cb 39 | if isArray cmds 40 | return array exec, cmds, opts, cb 41 | 42 | throw new Error "Unable to return results for cmds = #{JSON.stringify cmds}" 43 | -------------------------------------------------------------------------------- /node_modules/executive/src/index.coffee: -------------------------------------------------------------------------------- 1 | import {isFunction} from 'es-is' 2 | 3 | import exec from './executive' 4 | 5 | # Set defaults for various helpers 6 | partial = (defaults) -> 7 | (cmds, opts, cb) -> 8 | [cb, opts] = [opts, {}] if isFunction opts 9 | exec cmds, (Object.assign {}, defaults, opts), cb 10 | 11 | # Defaults 12 | exec.interactive = partial interactive: true 13 | exec.parallel = partial parallel: true 14 | exec.quiet = partial quiet: true 15 | exec.serial = partial parallel: false 16 | exec.strict = partial strict: true 17 | exec.sync = partial sync: true 18 | 19 | export default exec 20 | -------------------------------------------------------------------------------- /node_modules/executive/src/spawn/buffer-stream.coffee: -------------------------------------------------------------------------------- 1 | import Stream from 'stream' 2 | 3 | class BufferStream extends Stream 4 | constructor: -> 5 | super() 6 | @buffer = '' 7 | @writable = true 8 | 9 | write: (data) -> 10 | @buffer += data 11 | 12 | end: (data) -> 13 | @write data if arguments.length 14 | @writable = false 15 | 16 | destroy: -> 17 | @writable = false 18 | 19 | toString: -> 20 | @buffer 21 | 22 | export default BufferStream 23 | -------------------------------------------------------------------------------- /node_modules/executive/src/spawn/shell-builtins.coffee: -------------------------------------------------------------------------------- 1 | export default shellBuiltins = 2 | # Bourne Shell builtins 3 | ':': true 4 | '.': true 5 | break: true 6 | cd: true 7 | continue: true 8 | eval: true 9 | exec: true 10 | exit: true 11 | export: true 12 | getopts: true 13 | hash: true 14 | pwd: true 15 | readonly: true 16 | return: true 17 | shift: true 18 | test: true 19 | times: true 20 | trap: true 21 | umask: true 22 | unset: true 23 | 24 | # Bash shell builtins 25 | alias: true 26 | bind: true 27 | builtin: true 28 | caller: true 29 | command: true 30 | declare: true 31 | echo: true 32 | enable: true 33 | help: true 34 | let: true 35 | local: true 36 | logout: true 37 | mapfile: true 38 | printf: true 39 | read: true 40 | readarray: true 41 | source: true 42 | type: true 43 | typeset: true 44 | ulimit: true 45 | unalias: true 46 | -------------------------------------------------------------------------------- /node_modules/executive/src/spawn/sync.coffee: -------------------------------------------------------------------------------- 1 | import {spawnSync} from 'child_process' 2 | 3 | import parse from './parse' 4 | import {logError} from '../utils' 5 | 6 | 7 | export default sync = (cmd, opts, cb) -> 8 | [cmd, args, opts] = parse cmd, opts 9 | 10 | { 11 | pid 12 | output 13 | stdout 14 | stderr 15 | status 16 | signal 17 | error 18 | } = spawnSync cmd, args, 19 | cwd: opts.cwd 20 | input: opts.input 21 | stdio: opts.stdio ? [0, 'pipe', 'pipe'] 22 | env: opts.env 23 | uid: opts.uid 24 | gid: opts.gid 25 | timeout: opts.timeout 26 | killSignal: opts.killSignal 27 | maxBuffer: opts.maxBuffer 28 | encoding: opts.encoding ? 'utf8' 29 | 30 | opts 31 | 32 | unless opts.quiet 33 | process.stdout.write stdout 34 | process.stderr.write stderr 35 | 36 | if not error? and status != 0 37 | error = new Error "Command failed, '#{cmd}' exited with status #{status}" 38 | 39 | if error? 40 | error.status = status 41 | error.pid = pid 42 | error.signal = signal 43 | error.stderr = stderr 44 | error.stdout = stdout 45 | logError error unless opts.quiet 46 | 47 | cb error, stdout, stderr, status 48 | 49 | status: status 50 | stderr: stderr 51 | stdout: stdout 52 | error: error 53 | -------------------------------------------------------------------------------- /node_modules/executive/src/utils.coffee: -------------------------------------------------------------------------------- 1 | # Log error 2 | export logError = (err) -> 3 | if (err.code is 'ENOENT') and /^spawn/.test err.syscall 4 | console.error "Error: #{err.code}, #{err.syscall}" 5 | console.error "Make sure '#{err.cmd}' exists and is executable." 6 | 7 | 8 | # Run command exactly once 9 | export once = (fn) -> 10 | ran = false 11 | result = null 12 | -> 13 | return result if ran 14 | ran = true 15 | result = fn.apply @, arguments 16 | fn = null 17 | result 18 | 19 | 20 | # Merge stdout, stderr, status into results object 21 | export mergeResult = (stdout, stderr, status, object) -> 22 | ret = if object? then object else {} 23 | 24 | ret.status ?= status 25 | ret.stderr ?= stderr 26 | ret.stdout ?= stdout 27 | 28 | ret 29 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/README.md: -------------------------------------------------------------------------------- 1 | # fs.realpath 2 | 3 | A backwards-compatible fs.realpath for Node v6 and above 4 | 5 | In Node v6, the JavaScript implementation of fs.realpath was replaced 6 | with a faster (but less resilient) native implementation. That raises 7 | new and platform-specific errors and cannot handle long or excessively 8 | symlink-looping paths. 9 | 10 | This module handles those cases by detecting the new errors and 11 | falling back to the JavaScript implementation. On versions of Node 12 | prior to v6, it has no effect. 13 | 14 | ## USAGE 15 | 16 | ```js 17 | var rp = require('fs.realpath') 18 | 19 | // async version 20 | rp.realpath(someLongAndLoopingPath, function (er, real) { 21 | // the ELOOP was handled, but it was a bit slower 22 | }) 23 | 24 | // sync version 25 | var real = rp.realpathSync(someLongAndLoopingPath) 26 | 27 | // monkeypatch at your own risk! 28 | // This replaces the fs.realpath/fs.realpathSync builtins 29 | rp.monkeypatch() 30 | 31 | // un-do the monkeypatching 32 | rp.unmonkeypatch() 33 | ``` 34 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/index.js: -------------------------------------------------------------------------------- 1 | module.exports = realpath 2 | realpath.realpath = realpath 3 | realpath.sync = realpathSync 4 | realpath.realpathSync = realpathSync 5 | realpath.monkeypatch = monkeypatch 6 | realpath.unmonkeypatch = unmonkeypatch 7 | 8 | var fs = require('fs') 9 | var origRealpath = fs.realpath 10 | var origRealpathSync = fs.realpathSync 11 | 12 | var version = process.version 13 | var ok = /^v[0-5]\./.test(version) 14 | var old = require('./old.js') 15 | 16 | function newError (er) { 17 | return er && er.syscall === 'realpath' && ( 18 | er.code === 'ELOOP' || 19 | er.code === 'ENOMEM' || 20 | er.code === 'ENAMETOOLONG' 21 | ) 22 | } 23 | 24 | function realpath (p, cache, cb) { 25 | if (ok) { 26 | return origRealpath(p, cache, cb) 27 | } 28 | 29 | if (typeof cache === 'function') { 30 | cb = cache 31 | cache = null 32 | } 33 | origRealpath(p, cache, function (er, result) { 34 | if (newError(er)) { 35 | old.realpath(p, cache, cb) 36 | } else { 37 | cb(er, result) 38 | } 39 | }) 40 | } 41 | 42 | function realpathSync (p, cache) { 43 | if (ok) { 44 | return origRealpathSync(p, cache) 45 | } 46 | 47 | try { 48 | return origRealpathSync(p, cache) 49 | } catch (er) { 50 | if (newError(er)) { 51 | return old.realpathSync(p, cache) 52 | } else { 53 | throw er 54 | } 55 | } 56 | } 57 | 58 | function monkeypatch () { 59 | fs.realpath = realpath 60 | fs.realpathSync = realpathSync 61 | } 62 | 63 | function unmonkeypatch () { 64 | fs.realpath = origRealpath 65 | fs.realpathSync = origRealpathSync 66 | } 67 | -------------------------------------------------------------------------------- /node_modules/fs.realpath/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "fs.realpath@^1.0.0", 3 | "_id": "fs.realpath@1.0.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 6 | "_location": "/fs.realpath", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "fs.realpath@^1.0.0", 12 | "name": "fs.realpath", 13 | "escapedName": "fs.realpath", 14 | "rawSpec": "^1.0.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 22 | "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", 23 | "_spec": "fs.realpath@^1.0.0", 24 | "_where": "/home/sg/git/typescript-in-the-browser/node_modules/glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/fs.realpath/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": {}, 35 | "deprecated": false, 36 | "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", 37 | "devDependencies": {}, 38 | "files": [ 39 | "old.js", 40 | "index.js" 41 | ], 42 | "homepage": "https://github.com/isaacs/fs.realpath#readme", 43 | "keywords": [ 44 | "realpath", 45 | "fs", 46 | "polyfill" 47 | ], 48 | "license": "ISC", 49 | "main": "index.js", 50 | "name": "fs.realpath", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/isaacs/fs.realpath.git" 54 | }, 55 | "scripts": { 56 | "test": "tap test/*.js --cov" 57 | }, 58 | "version": "1.0.0" 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/glob/changelog.md: -------------------------------------------------------------------------------- 1 | ## 7.0 2 | 3 | - Raise error if `options.cwd` is specified, and not a directory 4 | 5 | ## 6.0 6 | 7 | - Remove comment and negation pattern support 8 | - Ignore patterns are always in `dot:true` mode 9 | 10 | ## 5.0 11 | 12 | - Deprecate comment and negation patterns 13 | - Fix regression in `mark` and `nodir` options from making all cache 14 | keys absolute path. 15 | - Abort if `fs.readdir` returns an error that's unexpected 16 | - Don't emit `match` events for ignored items 17 | - Treat ENOTSUP like ENOTDIR in readdir 18 | 19 | ## 4.5 20 | 21 | - Add `options.follow` to always follow directory symlinks in globstar 22 | - Add `options.realpath` to call `fs.realpath` on all results 23 | - Always cache based on absolute path 24 | 25 | ## 4.4 26 | 27 | - Add `options.ignore` 28 | - Fix handling of broken symlinks 29 | 30 | ## 4.3 31 | 32 | - Bump minimatch to 2.x 33 | - Pass all tests on Windows 34 | 35 | ## 4.2 36 | 37 | - Add `glob.hasMagic` function 38 | - Add `options.nodir` flag 39 | 40 | ## 4.1 41 | 42 | - Refactor sync and async implementations for performance 43 | - Throw if callback provided to sync glob function 44 | - Treat symbolic links in globstar results the same as Bash 4.3 45 | 46 | ## 4.0 47 | 48 | - Use `^` for dependency versions (bumped major because this breaks 49 | older npm versions) 50 | - Ensure callbacks are only ever called once 51 | - switch to ISC license 52 | 53 | ## 3.x 54 | 55 | - Rewrite in JavaScript 56 | - Add support for setting root, cwd, and windows support 57 | - Cache many fs calls 58 | - Add globstar support 59 | - emit match events 60 | 61 | ## 2.x 62 | 63 | - Use `glob.h` and `fnmatch.h` from NetBSD 64 | 65 | ## 1.x 66 | 67 | - `glob.h` static binding. 68 | -------------------------------------------------------------------------------- /node_modules/inflight/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/inflight/README.md: -------------------------------------------------------------------------------- 1 | # inflight 2 | 3 | Add callbacks to requests in flight to avoid async duplication 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var inflight = require('inflight') 9 | 10 | // some request that does some stuff 11 | function req(key, callback) { 12 | // key is any random string. like a url or filename or whatever. 13 | // 14 | // will return either a falsey value, indicating that the 15 | // request for this key is already in flight, or a new callback 16 | // which when called will call all callbacks passed to inflightk 17 | // with the same key 18 | callback = inflight(key, callback) 19 | 20 | // If we got a falsey value back, then there's already a req going 21 | if (!callback) return 22 | 23 | // this is where you'd fetch the url or whatever 24 | // callback is also once()-ified, so it can safely be assigned 25 | // to multiple events etc. First call wins. 26 | setTimeout(function() { 27 | callback(null, key) 28 | }, 100) 29 | } 30 | 31 | // only assigns a single setTimeout 32 | // when it dings, all cbs get called 33 | req('foo', cb1) 34 | req('foo', cb2) 35 | req('foo', cb3) 36 | req('foo', cb4) 37 | ``` 38 | -------------------------------------------------------------------------------- /node_modules/inflight/inflight.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | var reqs = Object.create(null) 3 | var once = require('once') 4 | 5 | module.exports = wrappy(inflight) 6 | 7 | function inflight (key, cb) { 8 | if (reqs[key]) { 9 | reqs[key].push(cb) 10 | return null 11 | } else { 12 | reqs[key] = [cb] 13 | return makeres(key) 14 | } 15 | } 16 | 17 | function makeres (key) { 18 | return once(function RES () { 19 | var cbs = reqs[key] 20 | var len = cbs.length 21 | var args = slice(arguments) 22 | 23 | // XXX It's somewhat ambiguous whether a new callback added in this 24 | // pass should be queued for later execution if something in the 25 | // list of callbacks throws, or if it should just be discarded. 26 | // However, it's such an edge case that it hardly matters, and either 27 | // choice is likely as surprising as the other. 28 | // As it happens, we do go ahead and schedule it for later execution. 29 | try { 30 | for (var i = 0; i < len; i++) { 31 | cbs[i].apply(null, args) 32 | } 33 | } finally { 34 | if (cbs.length > len) { 35 | // added more in the interim. 36 | // de-zalgo, just in case, but don't call again. 37 | cbs.splice(0, len) 38 | process.nextTick(function () { 39 | RES.apply(null, args) 40 | }) 41 | } else { 42 | delete reqs[key] 43 | } 44 | } 45 | }) 46 | } 47 | 48 | function slice (args) { 49 | var length = args.length 50 | var array = [] 51 | 52 | for (var i = 0; i < length; i++) array[i] = args[i] 53 | return array 54 | } 55 | -------------------------------------------------------------------------------- /node_modules/inflight/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "inflight@^1.0.4", 3 | "_id": "inflight@1.0.6", 4 | "_inBundle": false, 5 | "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 6 | "_location": "/inflight", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "inflight@^1.0.4", 12 | "name": "inflight", 13 | "escapedName": "inflight", 14 | "rawSpec": "^1.0.4", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.4" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 22 | "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", 23 | "_spec": "inflight@^1.0.4", 24 | "_where": "/home/sg/git/typescript-in-the-browser/node_modules/glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/inflight/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": { 35 | "once": "^1.3.0", 36 | "wrappy": "1" 37 | }, 38 | "deprecated": false, 39 | "description": "Add callbacks to requests in flight to avoid async duplication", 40 | "devDependencies": { 41 | "tap": "^7.1.2" 42 | }, 43 | "files": [ 44 | "inflight.js" 45 | ], 46 | "homepage": "https://github.com/isaacs/inflight", 47 | "license": "ISC", 48 | "main": "inflight.js", 49 | "name": "inflight", 50 | "repository": { 51 | "type": "git", 52 | "url": "git+https://github.com/npm/inflight.git" 53 | }, 54 | "scripts": { 55 | "test": "tap test.js --100" 56 | }, 57 | "version": "1.0.6" 58 | } 59 | -------------------------------------------------------------------------------- /node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | try { 2 | var util = require('util'); 3 | if (typeof util.inherits !== 'function') throw ''; 4 | module.exports = util.inherits; 5 | } catch (e) { 6 | module.exports = require('./inherits_browser.js'); 7 | } 8 | -------------------------------------------------------------------------------- /node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "inherits@2", 3 | "_id": "inherits@2.0.3", 4 | "_inBundle": false, 5 | "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 6 | "_location": "/inherits", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "inherits@2", 12 | "name": "inherits", 13 | "escapedName": "inherits", 14 | "rawSpec": "2", 15 | "saveSpec": null, 16 | "fetchSpec": "2" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 22 | "_shasum": "633c2c83e3da42a502f52466022480f4208261de", 23 | "_spec": "inherits@2", 24 | "_where": "/home/sg/git/typescript-in-the-browser/node_modules/glob", 25 | "browser": "./inherits_browser.js", 26 | "bugs": { 27 | "url": "https://github.com/isaacs/inherits/issues" 28 | }, 29 | "bundleDependencies": false, 30 | "deprecated": false, 31 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 32 | "devDependencies": { 33 | "tap": "^7.1.0" 34 | }, 35 | "files": [ 36 | "inherits.js", 37 | "inherits_browser.js" 38 | ], 39 | "homepage": "https://github.com/isaacs/inherits#readme", 40 | "keywords": [ 41 | "inheritance", 42 | "class", 43 | "klass", 44 | "oop", 45 | "object-oriented", 46 | "inherits", 47 | "browser", 48 | "browserify" 49 | ], 50 | "license": "ISC", 51 | "main": "./inherits.js", 52 | "name": "inherits", 53 | "repository": { 54 | "type": "git", 55 | "url": "git://github.com/isaacs/inherits.git" 56 | }, 57 | "scripts": { 58 | "test": "node test" 59 | }, 60 | "version": "2.0.3" 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/interpret/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Tyler Kellen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/once/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/once/once.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | module.exports = wrappy(once) 3 | module.exports.strict = wrappy(onceStrict) 4 | 5 | once.proto = once(function () { 6 | Object.defineProperty(Function.prototype, 'once', { 7 | value: function () { 8 | return once(this) 9 | }, 10 | configurable: true 11 | }) 12 | 13 | Object.defineProperty(Function.prototype, 'onceStrict', { 14 | value: function () { 15 | return onceStrict(this) 16 | }, 17 | configurable: true 18 | }) 19 | }) 20 | 21 | function once (fn) { 22 | var f = function () { 23 | if (f.called) return f.value 24 | f.called = true 25 | return f.value = fn.apply(this, arguments) 26 | } 27 | f.called = false 28 | return f 29 | } 30 | 31 | function onceStrict (fn) { 32 | var f = function () { 33 | if (f.called) 34 | throw new Error(f.onceError) 35 | f.called = true 36 | return f.value = fn.apply(this, arguments) 37 | } 38 | var name = fn.name || 'Function wrapped with `once`' 39 | f.onceError = name + " shouldn't be called more than once" 40 | f.called = false 41 | return f 42 | } 43 | -------------------------------------------------------------------------------- /node_modules/once/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "once@^1.3.0", 3 | "_id": "once@1.4.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 6 | "_location": "/once", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "once@^1.3.0", 12 | "name": "once", 13 | "escapedName": "once", 14 | "rawSpec": "^1.3.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.3.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob", 20 | "/inflight" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 23 | "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", 24 | "_spec": "once@^1.3.0", 25 | "_where": "/home/sg/git/typescript-in-the-browser/node_modules/glob", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/isaacs/once/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": { 36 | "wrappy": "1" 37 | }, 38 | "deprecated": false, 39 | "description": "Run a function exactly one time", 40 | "devDependencies": { 41 | "tap": "^7.0.1" 42 | }, 43 | "directories": { 44 | "test": "test" 45 | }, 46 | "files": [ 47 | "once.js" 48 | ], 49 | "homepage": "https://github.com/isaacs/once#readme", 50 | "keywords": [ 51 | "once", 52 | "function", 53 | "one", 54 | "single" 55 | ], 56 | "license": "ISC", 57 | "main": "once.js", 58 | "name": "once", 59 | "repository": { 60 | "type": "git", 61 | "url": "git://github.com/isaacs/once.git" 62 | }, 63 | "scripts": { 64 | "test": "tap test/*.js" 65 | }, 66 | "version": "1.4.0" 67 | } 68 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function posix(path) { 4 | return path.charAt(0) === '/'; 5 | } 6 | 7 | function win32(path) { 8 | // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 9 | var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; 10 | var result = splitDeviceRe.exec(path); 11 | var device = result[1] || ''; 12 | var isUnc = Boolean(device && device.charAt(1) !== ':'); 13 | 14 | // UNC paths are always absolute 15 | return Boolean(result[2] || isUnc); 16 | } 17 | 18 | module.exports = process.platform === 'win32' ? win32 : posix; 19 | module.exports.posix = posix; 20 | module.exports.win32 = win32; 21 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /node_modules/path-is-absolute/readme.md: -------------------------------------------------------------------------------- 1 | # path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) 2 | 3 | > Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save path-is-absolute 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const pathIsAbsolute = require('path-is-absolute'); 17 | 18 | // Running on Linux 19 | pathIsAbsolute('/home/foo'); 20 | //=> true 21 | pathIsAbsolute('C:/Users/foo'); 22 | //=> false 23 | 24 | // Running on Windows 25 | pathIsAbsolute('C:/Users/foo'); 26 | //=> true 27 | pathIsAbsolute('/home/foo'); 28 | //=> false 29 | 30 | // Running on any OS 31 | pathIsAbsolute.posix('/home/foo'); 32 | //=> true 33 | pathIsAbsolute.posix('C:/Users/foo'); 34 | //=> false 35 | pathIsAbsolute.win32('C:/Users/foo'); 36 | //=> true 37 | pathIsAbsolute.win32('/home/foo'); 38 | //=> false 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). 45 | 46 | ### pathIsAbsolute(path) 47 | 48 | ### pathIsAbsolute.posix(path) 49 | 50 | POSIX specific version. 51 | 52 | ### pathIsAbsolute.win32(path) 53 | 54 | Windows specific version. 55 | 56 | 57 | ## License 58 | 59 | MIT © [Sindre Sorhus](https://sindresorhus.com) 60 | -------------------------------------------------------------------------------- /node_modules/path-parse/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "0.11" 5 | - "0.10" 6 | - "0.10.12" 7 | - "0.8" 8 | - "0.6" 9 | - "iojs" 10 | -------------------------------------------------------------------------------- /node_modules/path-parse/README.md: -------------------------------------------------------------------------------- 1 | # path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) 2 | 3 | > Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) ponyfill. 4 | 5 | > Ponyfill: A polyfill that doesn't overwrite the native method 6 | 7 | ## Install 8 | 9 | ``` 10 | $ npm install --save path-parse 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```js 16 | var pathParse = require('path-parse'); 17 | 18 | pathParse('/home/user/dir/file.txt'); 19 | //=> { 20 | // root : "/", 21 | // dir : "/home/user/dir", 22 | // base : "file.txt", 23 | // ext : ".txt", 24 | // name : "file" 25 | // } 26 | ``` 27 | 28 | ## API 29 | 30 | See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. 31 | 32 | ### pathParse(path) 33 | 34 | ### pathParse.posix(path) 35 | 36 | The Posix specific version. 37 | 38 | ### pathParse.win32(path) 39 | 40 | The Windows specific version. 41 | 42 | ## License 43 | 44 | MIT © [Javier Blanco](http://jbgutierrez.info) 45 | -------------------------------------------------------------------------------- /node_modules/path-parse/index.min.js: -------------------------------------------------------------------------------- 1 | "use strict";var isWindows=process.platform==="win32";var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var splitTailRe=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;var win32={};function win32SplitPath(b){var a=splitDeviceRe.exec(b),g=(a[1]||"")+(a[2]||""),e=a[3]||"";var d=splitTailRe.exec(e),c=d[1],h=d[2],f=d[3];return[g,c,h,f]}win32.parse=function(b){if(typeof b!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof b)}var a=win32SplitPath(b);if(!a||a.length!==4){throw new TypeError("Invalid path '"+b+"'")}return{root:a[0],dir:a[0]+a[1].slice(0,-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}};var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var posix={};function posixSplitPath(a){return splitPathRe.exec(a).slice(1)}posix.parse=function(b){if(typeof b!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof b)}var a=posixSplitPath(b);if(!a||a.length!==4){throw new TypeError("Invalid path '"+b+"'")}a[1]=a[1]||"";a[2]=a[2]||"";a[3]=a[3]||"";return{root:a[0],dir:a[0]+a[1].slice(0,-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}};if(isWindows){module.exports=win32.parse}else{module.exports=posix.parse}module.exports.posix=posix.parse;module.exports.win32=win32.parse; -------------------------------------------------------------------------------- /node_modules/path-parse/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "path-parse@^1.0.5", 3 | "_id": "path-parse@1.0.5", 4 | "_inBundle": false, 5 | "_integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", 6 | "_location": "/path-parse", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "path-parse@^1.0.5", 12 | "name": "path-parse", 13 | "escapedName": "path-parse", 14 | "rawSpec": "^1.0.5", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.5" 17 | }, 18 | "_requiredBy": [ 19 | "/resolve" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", 22 | "_shasum": "3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1", 23 | "_spec": "path-parse@^1.0.5", 24 | "_where": "/home/sg/git/typescript-in-the-browser/node_modules/resolve", 25 | "author": { 26 | "name": "Javier Blanco", 27 | "email": "http://jbgutierrez.info" 28 | }, 29 | "bugs": { 30 | "url": "https://github.com/jbgutierrez/path-parse/issues" 31 | }, 32 | "bundleDependencies": false, 33 | "deprecated": false, 34 | "description": "Node.js path.parse() ponyfill", 35 | "homepage": "https://github.com/jbgutierrez/path-parse#readme", 36 | "keywords": [ 37 | "path", 38 | "paths", 39 | "file", 40 | "dir", 41 | "parse", 42 | "built-in", 43 | "util", 44 | "utils", 45 | "core", 46 | "ponyfill", 47 | "polyfill", 48 | "shim" 49 | ], 50 | "license": "MIT", 51 | "main": "index.js", 52 | "name": "path-parse", 53 | "repository": { 54 | "type": "git", 55 | "url": "git+https://github.com/jbgutierrez/path-parse.git" 56 | }, 57 | "scripts": { 58 | "test": "node test.js" 59 | }, 60 | "version": "1.0.5" 61 | } 62 | -------------------------------------------------------------------------------- /node_modules/rechoir/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /node_modules/rechoir/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "0.10" 5 | - "0.12" 6 | env: 7 | global: 8 | - REMOVE_DEPS="" 9 | matrix: 10 | - "CUSTOM_DEPS=coffee-script@~1.3" 11 | - "CUSTOM_DEPS=coffee-script@~1.5" 12 | - "CUSTOM_DEPS=coffee-script@~1.7" 13 | - "CUSTOM_DEPS=coffee-script@latest" 14 | - "CUSTOM_DEPS=iced-coffee-script@1.6.3-j" 15 | - "CUSTOM_DEPS=iced-coffee-script@latest" 16 | - "CUSTOM_DEPS=LiveScript@1.3.1 REMOVE_DEPS=livescript" 17 | - "CUSTOM_DEPS=typescript-require REMOVE_DEPS=typescript-register" 18 | matrix: 19 | fast_finish: true 20 | before_install: 21 | - "npm install -g npm" # needs the newest version of npm 22 | before_script: 23 | - "[ \"${REMOVE_DEPS}\" == \"\" ] || npm rm $REMOVE_DEPS" 24 | - "npm install $CUSTOM_DEPS" # install a specific version of dependencies 25 | -------------------------------------------------------------------------------- /node_modules/rechoir/CHANGELOG: -------------------------------------------------------------------------------- 1 | v0.6.2: 2 | date: 2015-07-22 3 | changes: 4 | - Return `undefined` when an unknown extension is provided to prepare and 5 | the `nothrow` option is specified. 6 | v0.6.1: 7 | date: 2015-05-22 8 | changes: 9 | - Add option for not throwing. 10 | v0.6.0: 11 | date: 2015-05-20 12 | changes: 13 | - Include module name when prepare is successful. 14 | v0.5.0: 15 | date: 2015-05-20 16 | changes: 17 | - Overhaul to support interpret 0.6.0. 18 | v0.3.0: 19 | date: 2015-01-10 20 | changes: 21 | - Breaking: `load` method removed. 22 | - Improved extension recognition. 23 | - No longer fails upon dots in filenames. 24 | - Support confuration objects. 25 | - Support and test ES6. 26 | - Support legacy module loading. 27 | v0.2.2: 28 | date: 2014-12-17 29 | changes: 30 | - Expose interpret. 31 | v0.2.0: 32 | date: 2014-04-20 33 | changes: 34 | - Simplify loading of coffee-script and iced-coffee-script. 35 | v0.1.0: 36 | date: 2014-04-20 37 | changes: 38 | - Initial public release. 39 | -------------------------------------------------------------------------------- /node_modules/rechoir/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Tyler Kellen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /node_modules/rechoir/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const extension = require('./lib/extension'); 4 | const normalize = require('./lib/normalize'); 5 | const register = require('./lib/register'); 6 | 7 | exports.prepare = function (extensions, filepath, cwd, nothrow) { 8 | var option, attempt; 9 | var attempts = []; 10 | var err; 11 | var onlyErrors = false; 12 | var ext = extension(filepath); 13 | if (Object.keys(require.extensions).indexOf(ext) !== -1) { 14 | return true; 15 | } 16 | var config = normalize(extensions[ext]); 17 | if (!config) { 18 | if (nothrow) { 19 | return; 20 | } else { 21 | throw new Error('No module loader found for "'+ext+'".'); 22 | } 23 | } 24 | if (!cwd) { 25 | cwd = path.dirname(path.resolve(filepath)); 26 | } 27 | if (!Array.isArray(config)) { 28 | config = [config]; 29 | } 30 | for (var i in config) { 31 | option = config[i]; 32 | attempt = register(cwd, option.module, option.register); 33 | error = (attempt instanceof Error) ? attempt : null; 34 | if (error) { 35 | attempt = null; 36 | } 37 | attempts.push({ 38 | moduleName: option.module, 39 | module: attempt, 40 | error: error 41 | }); 42 | if (!error) { 43 | onlyErrors = false; 44 | break; 45 | } else { 46 | onlyErrors = true; 47 | } 48 | } 49 | if (onlyErrors) { 50 | err = new Error('Unable to use specified module loaders for "'+ext+'".'); 51 | err.failures = attempts; 52 | if (nothrow) { 53 | return err; 54 | } else { 55 | throw err; 56 | } 57 | } 58 | return attempts; 59 | }; 60 | -------------------------------------------------------------------------------- /node_modules/rechoir/lib/extension.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const EXTRE = /^[.]?[^.]+([.].*)$/; 4 | 5 | module.exports = function (input) { 6 | var extension = EXTRE.exec(path.basename(input)); 7 | if (!extension) { 8 | return; 9 | } 10 | return extension[1]; 11 | }; 12 | -------------------------------------------------------------------------------- /node_modules/rechoir/lib/normalize.js: -------------------------------------------------------------------------------- 1 | function normalizer (config) { 2 | if (typeof config === 'string') { 3 | return { 4 | module: config 5 | } 6 | } 7 | return config; 8 | }; 9 | 10 | module.exports = function (config) { 11 | if (Array.isArray(config)) { 12 | return config.map(normalizer); 13 | } 14 | return normalizer(config); 15 | }; 16 | -------------------------------------------------------------------------------- /node_modules/rechoir/lib/register.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const resolve = require('resolve'); 3 | 4 | module.exports = function (cwd, moduleName, register) { 5 | try { 6 | var modulePath = resolve.sync(moduleName, {basedir: cwd}); 7 | var result = require(modulePath); 8 | if (typeof register === 'function') { 9 | register(result); 10 | } 11 | } catch (e) { 12 | result = e; 13 | } 14 | return result; 15 | }; 16 | -------------------------------------------------------------------------------- /node_modules/resolve/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | max_line_length = 120 11 | 12 | [CHANGELOG.md] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.json] 17 | max_line_length = off 18 | 19 | [Makefile] 20 | max_line_length = off 21 | -------------------------------------------------------------------------------- /node_modules/resolve/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /node_modules/resolve/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@ljharb", 3 | "root": true, 4 | "rules": { 5 | "array-bracket-newline": 0, 6 | "array-element-newline": 0, 7 | "indent": [2, 4], 8 | "strict": 0, 9 | "complexity": 0, 10 | "consistent-return": 0, 11 | "curly": 0, 12 | "dot-notation": [2, { "allowKeywords": true }], 13 | "func-name-matching": 0, 14 | "func-style": 0, 15 | "global-require": 0, 16 | "id-length": [2, { "min": 1, "max": 30 }], 17 | "max-nested-callbacks": 0, 18 | "max-params": 0, 19 | "max-statements-per-line": [2, { "max": 2 }], 20 | "max-statements": 0, 21 | "no-magic-numbers": 0, 22 | "no-console": 0, 23 | "no-shadow": 0, 24 | "no-unused-vars": [2, { "vars": "all", "args": "none" }], 25 | "no-use-before-define": 0, 26 | "object-curly-newline": 0, 27 | "operator-linebreak": [2, "before"], 28 | "sort-keys": 0, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /node_modules/resolve/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /node_modules/resolve/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | skip_branch_with_pr: true 3 | build: off 4 | 5 | environment: 6 | matrix: 7 | - nodejs_version: "9" 8 | - nodejs_version: "8" 9 | - nodejs_version: "7" 10 | - nodejs_version: "6" 11 | - nodejs_version: "5" 12 | - nodejs_version: "4" 13 | - nodejs_version: "3" 14 | - nodejs_version: "2" 15 | - nodejs_version: "1" 16 | - nodejs_version: "0.12" 17 | - nodejs_version: "0.10" 18 | - nodejs_version: "0.8" 19 | - nodejs_version: "0.6" 20 | matrix: 21 | # fast_finish: true 22 | allow_failures: 23 | - nodejs_version: "0.8" 24 | - nodejs_version: "0.6" 25 | 26 | platform: 27 | - x86 28 | - x64 29 | 30 | # Install scripts. (runs after repo cloning) 31 | install: 32 | # Get the latest stable version of Node.js or io.js 33 | - ps: Install-Product node $env:nodejs_version $env:platform 34 | - IF %nodejs_version% EQU 0.6 npm config set strict-ssl false && npm -g install npm@1.3 35 | - IF %nodejs_version% EQU 0.8 npm config set strict-ssl false && npm -g install npm@1.4.28 && npm install -g npm@4.5 36 | - set PATH=%APPDATA%\npm;%PATH% 37 | #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm 38 | # install modules 39 | - npm install 40 | 41 | # Post-install test scripts. 42 | test_script: 43 | # Output useful info for debugging. 44 | - node --version 45 | - npm --version 46 | # run tests 47 | - npm run tests-only 48 | -------------------------------------------------------------------------------- /node_modules/resolve/example/async.js: -------------------------------------------------------------------------------- 1 | var resolve = require('../'); 2 | resolve('tap', { basedir: __dirname }, function (err, res) { 3 | if (err) console.error(err); 4 | else console.log(res); 5 | }); 6 | -------------------------------------------------------------------------------- /node_modules/resolve/example/sync.js: -------------------------------------------------------------------------------- 1 | var resolve = require('../'); 2 | var res = resolve.sync('tap', { basedir: __dirname }); 3 | console.log(res); 4 | -------------------------------------------------------------------------------- /node_modules/resolve/index.js: -------------------------------------------------------------------------------- 1 | var core = require('./lib/core'); 2 | var async = require('./lib/async'); 3 | async.core = core; 4 | async.isCore = function isCore(x) { return core[x]; }; 5 | async.sync = require('./lib/sync'); 6 | 7 | exports = async; 8 | module.exports = async; 9 | -------------------------------------------------------------------------------- /node_modules/resolve/lib/caller.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { 2 | // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi 3 | var origPrepareStackTrace = Error.prepareStackTrace; 4 | Error.prepareStackTrace = function (_, stack) { return stack; }; 5 | var stack = (new Error()).stack; 6 | Error.prepareStackTrace = origPrepareStackTrace; 7 | return stack[2].getFileName(); 8 | }; 9 | -------------------------------------------------------------------------------- /node_modules/resolve/lib/node-modules-paths.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | var parse = path.parse || require('path-parse'); 4 | 5 | module.exports = function nodeModulesPaths(start, opts) { 6 | var modules = opts && opts.moduleDirectory 7 | ? [].concat(opts.moduleDirectory) 8 | : ['node_modules']; 9 | 10 | // ensure that `start` is an absolute path at this point, 11 | // resolving against the process' current working directory 12 | var absoluteStart = path.resolve(start); 13 | 14 | if (opts && opts.preserveSymlinks === false) { 15 | try { 16 | absoluteStart = fs.realpathSync(absoluteStart); 17 | } catch (err) { 18 | if (err.code !== 'ENOENT') { 19 | throw err; 20 | } 21 | } 22 | } 23 | 24 | var prefix = '/'; 25 | if (/^([A-Za-z]:)/.test(absoluteStart)) { 26 | prefix = ''; 27 | } else if (/^\\\\/.test(absoluteStart)) { 28 | prefix = '\\\\'; 29 | } 30 | 31 | var paths = [absoluteStart]; 32 | var parsed = parse(absoluteStart); 33 | while (parsed.dir !== paths[paths.length - 1]) { 34 | paths.push(parsed.dir); 35 | parsed = parse(parsed.dir); 36 | } 37 | 38 | var dirs = paths.reduce(function (dirs, aPath) { 39 | return dirs.concat(modules.map(function (moduleDir) { 40 | return path.join(prefix, aPath, moduleDir); 41 | })); 42 | }, []); 43 | 44 | return opts && opts.paths ? dirs.concat(opts.paths) : dirs; 45 | }; 46 | -------------------------------------------------------------------------------- /node_modules/resolve/test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "max-lines": 0 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/resolve/test/dotdot.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('dotdot', function (t) { 6 | t.plan(4); 7 | var dir = path.join(__dirname, '/dotdot/abc'); 8 | 9 | resolve('..', { basedir: dir }, function (err, res, pkg) { 10 | t.ifError(err); 11 | t.equal(res, path.join(__dirname, 'dotdot/index.js')); 12 | }); 13 | 14 | resolve('.', { basedir: dir }, function (err, res, pkg) { 15 | t.ifError(err); 16 | t.equal(res, path.join(dir, 'index.js')); 17 | }); 18 | }); 19 | 20 | test('dotdot sync', function (t) { 21 | t.plan(2); 22 | var dir = path.join(__dirname, '/dotdot/abc'); 23 | 24 | var a = resolve.sync('..', { basedir: dir }); 25 | t.equal(a, path.join(__dirname, 'dotdot/index.js')); 26 | 27 | var b = resolve.sync('.', { basedir: dir }); 28 | t.equal(b, path.join(dir, 'index.js')); 29 | }); 30 | -------------------------------------------------------------------------------- /node_modules/resolve/test/dotdot/abc/index.js: -------------------------------------------------------------------------------- 1 | var x = require('..'); 2 | console.log(x); 3 | -------------------------------------------------------------------------------- /node_modules/resolve/test/dotdot/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'whatever'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/faulty_basedir.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var resolve = require('../'); 3 | 4 | test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { 5 | t.plan(1); 6 | 7 | var resolverDir = 'C:\\a\\b\\c\\d'; 8 | 9 | resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { 10 | t.equal(true, !!err); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /node_modules/resolve/test/filter.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('filter', function (t) { 6 | t.plan(4); 7 | var dir = path.join(__dirname, 'resolver'); 8 | var packageFilterArgs; 9 | resolve('./baz', { 10 | basedir: dir, 11 | packageFilter: function (pkg, pkgfile) { 12 | pkg.main = 'doom'; 13 | packageFilterArgs = [pkg, pkgfile]; 14 | return pkg; 15 | } 16 | }, function (err, res, pkg) { 17 | if (err) t.fail(err); 18 | 19 | t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); 20 | 21 | var packageData = packageFilterArgs[0]; 22 | t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); 23 | t.equal(packageData.main, 'doom', 'package "main" was altered'); 24 | 25 | var packageFile = packageFilterArgs[1]; 26 | t.equal( 27 | packageFile, 28 | path.join(dir, 'baz/package.json'), 29 | 'second packageFilter argument is "pkgfile"' 30 | ); 31 | 32 | t.end(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /node_modules/resolve/test/filter_sync.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('filter', function (t) { 6 | var dir = path.join(__dirname, 'resolver'); 7 | var packageFilterArgs; 8 | var res = resolve.sync('./baz', { 9 | basedir: dir, 10 | packageFilter: function (pkg, dir) { 11 | pkg.main = 'doom'; 12 | packageFilterArgs = [pkg, dir]; 13 | return pkg; 14 | } 15 | }); 16 | 17 | t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); 18 | 19 | var packageData = packageFilterArgs[0]; 20 | t.equal(packageData.main, 'doom', 'package "main" was altered'); 21 | 22 | var packageFile = packageFilterArgs[1]; 23 | t.equal(packageFile, path.join(dir, 'baz'), 'second packageFilter argument is "dir"'); 24 | 25 | t.end(); 26 | }); 27 | -------------------------------------------------------------------------------- /node_modules/resolve/test/module_dir/xmodules/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (x) { return x * 100; }; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/module_dir/ymodules/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (x) { return x + 100; }; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/module_dir/zmodules/bbb/main.js: -------------------------------------------------------------------------------- 1 | module.exports = function (n) { return n * 111; }; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/module_dir/zmodules/bbb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "main.js" 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/resolve/test/node_path.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('$NODE_PATH', function (t) { 6 | t.plan(4); 7 | 8 | resolve('aaa', { 9 | paths: [ 10 | path.join(__dirname, '/node_path/x'), 11 | path.join(__dirname, '/node_path/y') 12 | ], 13 | basedir: __dirname 14 | }, function (err, res) { 15 | t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js')); 16 | }); 17 | 18 | resolve('bbb', { 19 | paths: [ 20 | path.join(__dirname, '/node_path/x'), 21 | path.join(__dirname, '/node_path/y') 22 | ], 23 | basedir: __dirname 24 | }, function (err, res) { 25 | t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js')); 26 | }); 27 | 28 | resolve('ccc', { 29 | paths: [ 30 | path.join(__dirname, '/node_path/x'), 31 | path.join(__dirname, '/node_path/y') 32 | ], 33 | basedir: __dirname 34 | }, function (err, res) { 35 | t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js')); 36 | }); 37 | 38 | // ensure that relative paths still resolve against the 39 | // regular `node_modules` correctly 40 | resolve('tap', { 41 | paths: [ 42 | 'node_path' 43 | ], 44 | basedir: 'node_path/x' 45 | }, function (err, res) { 46 | var root = require('tap/package.json').main; 47 | t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root)); 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /node_modules/resolve/test/node_path/x/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'A'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/node_path/x/ccc/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'C'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/node_path/y/bbb/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'B'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/node_path/y/ccc/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'CY'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/nonstring.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var resolve = require('../'); 3 | 4 | test('nonstring', function (t) { 5 | t.plan(1); 6 | resolve(555, function (err, res, pkg) { 7 | t.ok(err); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /node_modules/resolve/test/pathfilter/deep_ref/main.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/pathfilter/deep_ref/main.js -------------------------------------------------------------------------------- /node_modules/resolve/test/precedence.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('precedence', function (t) { 6 | t.plan(3); 7 | var dir = path.join(__dirname, 'precedence/aaa'); 8 | 9 | resolve('./', { basedir: dir }, function (err, res, pkg) { 10 | t.ifError(err); 11 | t.equal(res, path.join(dir, 'index.js')); 12 | t.equal(pkg.name, 'resolve'); 13 | }); 14 | }); 15 | 16 | test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string 17 | t.plan(1); 18 | var dir = path.join(__dirname, 'precedence/bbb'); 19 | 20 | resolve('./', { basedir: dir }, function (err, res, pkg) { 21 | t.ok(err); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /node_modules/resolve/test/precedence/aaa.js: -------------------------------------------------------------------------------- 1 | module.exports = 'wtf'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/precedence/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'okok'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/precedence/aaa/main.js: -------------------------------------------------------------------------------- 1 | console.log(require('./')); 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/precedence/bbb.js: -------------------------------------------------------------------------------- 1 | module.exports = '>_<'; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/precedence/bbb/main.js: -------------------------------------------------------------------------------- 1 | console.log(require('./')); // should throw 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/baz/doom.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/baz/doom.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/baz/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "quux.js" 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/baz/quux.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/browser_field/a.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/browser_field/a.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/browser_field/b.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/browser_field/b.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/browser_field/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser_field", 3 | "main": "a", 4 | "browser": "b" 5 | } 6 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/cup.coffee: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/dot_main/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/dot_main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "." 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/dot_slash_main/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/dot_slash_main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "./" 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/foo.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/incorrect_main/index.js: -------------------------------------------------------------------------------- 1 | // this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate 2 | module.exports = 1; 3 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/incorrect_main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "wrong.js" 3 | } 4 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/mug.coffee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/mug.coffee -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/mug.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/mug.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/other_path/lib/other-lib.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/other_path/lib/other-lib.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/other_path/root.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/other_path/root.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/quux/foo/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/same_names/foo.js: -------------------------------------------------------------------------------- 1 | module.exports = 42; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/same_names/foo/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-in-the-browser/c3dbc2dbb3874245f4ec5764a046f05b2fb6c34f/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep -------------------------------------------------------------------------------- /node_modules/resolve/test/resolver/without_basedir/main.js: -------------------------------------------------------------------------------- 1 | var resolve = require('../../../'); 2 | 3 | module.exports = function (t, cb) { 4 | resolve('mymodule', null, cb); 5 | }; 6 | -------------------------------------------------------------------------------- /node_modules/resolve/test/subdirs.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var resolve = require('../'); 3 | var path = require('path'); 4 | 5 | test('subdirs', function (t) { 6 | t.plan(2); 7 | 8 | var dir = path.join(__dirname, '/subdirs'); 9 | resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { 10 | t.ifError(err); 11 | t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /node_modules/shelljs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Artur Adib 2 | All rights reserved. 3 | 4 | You may use this project under the terms of the New BSD license as follows: 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of Artur Adib nor the 14 | names of the contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /node_modules/shelljs/bin/shjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../global'); 3 | 4 | if (process.argv.length < 3) { 5 | console.log('ShellJS: missing argument (script name)'); 6 | console.log(); 7 | process.exit(1); 8 | } 9 | 10 | var args, 11 | scriptName = process.argv[2]; 12 | env['NODE_PATH'] = __dirname + '/../..'; 13 | 14 | if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { 15 | if (test('-f', scriptName + '.js')) 16 | scriptName += '.js'; 17 | if (test('-f', scriptName + '.coffee')) 18 | scriptName += '.coffee'; 19 | } 20 | 21 | if (!test('-f', scriptName)) { 22 | console.log('ShellJS: script not found ('+scriptName+')'); 23 | console.log(); 24 | process.exit(1); 25 | } 26 | 27 | args = process.argv.slice(3); 28 | 29 | for (var i = 0, l = args.length; i < l; i++) { 30 | if (args[i][0] !== "-"){ 31 | args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words 32 | } 33 | } 34 | 35 | var path = require('path'); 36 | var extensions = require('interpret').extensions; 37 | var rechoir = require('rechoir'); 38 | rechoir.prepare(extensions, scriptName); 39 | require(require.resolve(path.resolve(process.cwd(), scriptName))); 40 | -------------------------------------------------------------------------------- /node_modules/shelljs/commands.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | 'cat', 3 | 'cd', 4 | 'chmod', 5 | 'cp', 6 | 'dirs', 7 | 'echo', 8 | 'exec', 9 | 'find', 10 | 'grep', 11 | 'head', 12 | 'ln', 13 | 'ls', 14 | 'mkdir', 15 | 'mv', 16 | 'pwd', 17 | 'rm', 18 | 'sed', 19 | 'set', 20 | 'sort', 21 | 'tail', 22 | 'tempdir', 23 | 'test', 24 | 'to', 25 | 'toEnd', 26 | 'touch', 27 | 'uniq', 28 | 'which', 29 | ]; 30 | -------------------------------------------------------------------------------- /node_modules/shelljs/global.js: -------------------------------------------------------------------------------- 1 | /* eslint no-extend-native: 0 */ 2 | var shell = require('./shell.js'); 3 | var common = require('./src/common'); 4 | Object.keys(shell).forEach(function (cmd) { 5 | global[cmd] = shell[cmd]; 6 | }); 7 | 8 | var _to = require('./src/to'); 9 | String.prototype.to = common.wrap('to', _to); 10 | 11 | var _toEnd = require('./src/toEnd'); 12 | String.prototype.toEnd = common.wrap('toEnd', _toEnd); 13 | -------------------------------------------------------------------------------- /node_modules/shelljs/make.js: -------------------------------------------------------------------------------- 1 | require('./global'); 2 | 3 | global.config.fatal = true; 4 | global.target = {}; 5 | 6 | var args = process.argv.slice(2), 7 | targetArgs, 8 | dashesLoc = args.indexOf('--'); 9 | 10 | // split args, everything after -- if only for targets 11 | if (dashesLoc > -1) { 12 | targetArgs = args.slice(dashesLoc + 1, args.length); 13 | args = args.slice(0, dashesLoc); 14 | } 15 | 16 | // This ensures we only execute the script targets after the entire script has 17 | // been evaluated 18 | setTimeout(function() { 19 | var t; 20 | 21 | if (args.length === 1 && args[0] === '--help') { 22 | console.log('Available targets:'); 23 | for (t in global.target) 24 | console.log(' ' + t); 25 | return; 26 | } 27 | 28 | // Wrap targets to prevent duplicate execution 29 | for (t in global.target) { 30 | (function(t, oldTarget){ 31 | 32 | // Wrap it 33 | global.target[t] = function() { 34 | if (!oldTarget.done){ 35 | oldTarget.done = true; 36 | oldTarget.result = oldTarget.apply(oldTarget, arguments); 37 | } 38 | return oldTarget.result; 39 | }; 40 | 41 | })(t, global.target[t]); 42 | } 43 | 44 | // Execute desired targets 45 | if (args.length > 0) { 46 | args.forEach(function(arg) { 47 | if (arg in global.target) 48 | global.target[arg](targetArgs); 49 | else { 50 | console.log('no such target: ' + arg); 51 | } 52 | }); 53 | } else if ('all' in global.target) { 54 | global.target.all(targetArgs); 55 | } 56 | 57 | }, 0); 58 | -------------------------------------------------------------------------------- /node_modules/shelljs/plugin.js: -------------------------------------------------------------------------------- 1 | // Various utilties exposed to plugins 2 | 3 | require('./shell'); // Create the ShellJS instance (mandatory) 4 | 5 | var common = require('./src/common'); 6 | 7 | var exportedAttributes = [ 8 | 'error', // For signaling errors from within commands 9 | 'parseOptions', // For custom option parsing 10 | 'readFromPipe', // For commands with the .canReceivePipe attribute 11 | 'register', // For registering plugins 12 | ]; 13 | 14 | exportedAttributes.forEach(function (attr) { 15 | exports[attr] = common[attr]; 16 | }); 17 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/cd.js: -------------------------------------------------------------------------------- 1 | var os = require('os'); 2 | var common = require('./common'); 3 | 4 | common.register('cd', _cd, {}); 5 | 6 | //@ 7 | //@ ### cd([dir]) 8 | //@ 9 | //@ Changes to directory `dir` for the duration of the script. Changes to home 10 | //@ directory if no argument is supplied. 11 | function _cd(options, dir) { 12 | if (!dir) dir = os.homedir(); 13 | 14 | if (dir === '-') { 15 | if (!process.env.OLDPWD) { 16 | common.error('could not find previous directory'); 17 | } else { 18 | dir = process.env.OLDPWD; 19 | } 20 | } 21 | 22 | try { 23 | var curDir = process.cwd(); 24 | process.chdir(dir); 25 | process.env.OLDPWD = curDir; 26 | } catch (e) { 27 | // something went wrong, let's figure out the error 28 | var err; 29 | try { 30 | common.statFollowLinks(dir); // if this succeeds, it must be some sort of file 31 | err = 'not a directory: ' + dir; 32 | } catch (e2) { 33 | err = 'no such file or directory: ' + dir; 34 | } 35 | if (err) common.error(err); 36 | } 37 | return ''; 38 | } 39 | module.exports = _cd; 40 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/echo.js: -------------------------------------------------------------------------------- 1 | var format = require('util').format; 2 | 3 | var common = require('./common'); 4 | 5 | common.register('echo', _echo, { 6 | allowGlobbing: false, 7 | }); 8 | 9 | //@ 10 | //@ ### echo([options,] string [, string ...]) 11 | //@ 12 | //@ Available options: 13 | //@ 14 | //@ + `-e`: interpret backslash escapes (default) 15 | //@ + `-n`: remove trailing newline from output 16 | //@ 17 | //@ Examples: 18 | //@ 19 | //@ ```javascript 20 | //@ echo('hello world'); 21 | //@ var str = echo('hello world'); 22 | //@ echo('-n', 'no newline at end'); 23 | //@ ``` 24 | //@ 25 | //@ Prints `string` to stdout, and returns string with additional utility methods 26 | //@ like `.to()`. 27 | function _echo(opts) { 28 | // allow strings starting with '-', see issue #20 29 | var messages = [].slice.call(arguments, opts ? 0 : 1); 30 | var options = {}; 31 | 32 | // If the first argument starts with '-', parse it as options string. 33 | // If parseOptions throws, it wasn't an options string. 34 | try { 35 | options = common.parseOptions(messages[0], { 36 | 'e': 'escapes', 37 | 'n': 'no_newline', 38 | }, { 39 | silent: true, 40 | }); 41 | 42 | // Allow null to be echoed 43 | if (messages[0]) { 44 | messages.shift(); 45 | } 46 | } catch (_) { 47 | // Clear out error if an error occurred 48 | common.state.error = null; 49 | } 50 | 51 | var output = format.apply(null, messages); 52 | 53 | // Add newline if -n is not passed. 54 | if (!options.no_newline) { 55 | output += '\n'; 56 | } 57 | 58 | process.stdout.write(output); 59 | 60 | return output; 61 | } 62 | 63 | module.exports = _echo; 64 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/error.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | 3 | //@ 4 | //@ ### error() 5 | //@ 6 | //@ Tests if error occurred in the last command. Returns a truthy value if an 7 | //@ error returned, or a falsy value otherwise. 8 | //@ 9 | //@ **Note**: do not rely on the 10 | //@ return value to be an error message. If you need the last error message, use 11 | //@ the `.stderr` attribute from the last command's return value instead. 12 | function error() { 13 | return common.state.error; 14 | } 15 | module.exports = error; 16 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/exec-child.js: -------------------------------------------------------------------------------- 1 | if (require.main !== module) { 2 | throw new Error('This file should not be required'); 3 | } 4 | 5 | var childProcess = require('child_process'); 6 | var fs = require('fs'); 7 | 8 | var paramFilePath = process.argv[2]; 9 | 10 | var serializedParams = fs.readFileSync(paramFilePath, 'utf8'); 11 | var params = JSON.parse(serializedParams); 12 | 13 | var cmd = params.command; 14 | var execOptions = params.execOptions; 15 | var pipe = params.pipe; 16 | var stdoutFile = params.stdoutFile; 17 | var stderrFile = params.stderrFile; 18 | 19 | var c = childProcess.exec(cmd, execOptions, function (err) { 20 | if (!err) { 21 | process.exitCode = 0; 22 | } else if (err.code === undefined) { 23 | process.exitCode = 1; 24 | } else { 25 | process.exitCode = err.code; 26 | } 27 | }); 28 | 29 | var stdoutStream = fs.createWriteStream(stdoutFile); 30 | var stderrStream = fs.createWriteStream(stderrFile); 31 | 32 | c.stdout.pipe(stdoutStream); 33 | c.stderr.pipe(stderrStream); 34 | c.stdout.pipe(process.stdout); 35 | c.stderr.pipe(process.stderr); 36 | 37 | if (pipe) { 38 | c.stdin.end(pipe); 39 | } 40 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/popd.js: -------------------------------------------------------------------------------- 1 | // see dirs.js 2 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/pushd.js: -------------------------------------------------------------------------------- 1 | // see dirs.js 2 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/pwd.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var common = require('./common'); 3 | 4 | common.register('pwd', _pwd, { 5 | allowGlobbing: false, 6 | }); 7 | 8 | //@ 9 | //@ ### pwd() 10 | //@ 11 | //@ Returns the current directory. 12 | function _pwd() { 13 | var pwd = path.resolve(process.cwd()); 14 | return pwd; 15 | } 16 | module.exports = _pwd; 17 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/set.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | 3 | common.register('set', _set, { 4 | allowGlobbing: false, 5 | wrapOutput: false, 6 | }); 7 | 8 | //@ 9 | //@ ### set(options) 10 | //@ 11 | //@ Available options: 12 | //@ 13 | //@ + `+/-e`: exit upon error (`config.fatal`) 14 | //@ + `+/-v`: verbose: show all commands (`config.verbose`) 15 | //@ + `+/-f`: disable filename expansion (globbing) 16 | //@ 17 | //@ Examples: 18 | //@ 19 | //@ ```javascript 20 | //@ set('-e'); // exit upon first error 21 | //@ set('+e'); // this undoes a "set('-e')" 22 | //@ ``` 23 | //@ 24 | //@ Sets global configuration variables. 25 | function _set(options) { 26 | if (!options) { 27 | var args = [].slice.call(arguments, 0); 28 | if (args.length < 2) common.error('must provide an argument'); 29 | options = args[1]; 30 | } 31 | var negate = (options[0] === '+'); 32 | if (negate) { 33 | options = '-' + options.slice(1); // parseOptions needs a '-' prefix 34 | } 35 | options = common.parseOptions(options, { 36 | 'e': 'fatal', 37 | 'v': 'verbose', 38 | 'f': 'noglob', 39 | }); 40 | 41 | if (negate) { 42 | Object.keys(options).forEach(function (key) { 43 | options[key] = !options[key]; 44 | }); 45 | } 46 | 47 | Object.keys(options).forEach(function (key) { 48 | // Only change the global config if `negate` is false and the option is true 49 | // or if `negate` is true and the option is false (aka negate !== option) 50 | if (negate !== options[key]) { 51 | common.config[key] = options[key]; 52 | } 53 | }); 54 | return; 55 | } 56 | module.exports = _set; 57 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/to.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | 5 | common.register('to', _to, { 6 | pipeOnly: true, 7 | wrapOutput: false, 8 | }); 9 | 10 | //@ 11 | //@ ### ShellString.prototype.to(file) 12 | //@ 13 | //@ Examples: 14 | //@ 15 | //@ ```javascript 16 | //@ cat('input.txt').to('output.txt'); 17 | //@ ``` 18 | //@ 19 | //@ Analogous to the redirection operator `>` in Unix, but works with 20 | //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix 21 | //@ redirections, `to()` will overwrite any existing file!_ 22 | function _to(options, file) { 23 | if (!file) common.error('wrong arguments'); 24 | 25 | if (!fs.existsSync(path.dirname(file))) { 26 | common.error('no such file or directory: ' + path.dirname(file)); 27 | } 28 | 29 | try { 30 | fs.writeFileSync(file, this.stdout || this.toString(), 'utf8'); 31 | return this; 32 | } catch (e) { 33 | /* istanbul ignore next */ 34 | common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true }); 35 | } 36 | } 37 | module.exports = _to; 38 | -------------------------------------------------------------------------------- /node_modules/shelljs/src/toEnd.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | 5 | common.register('toEnd', _toEnd, { 6 | pipeOnly: true, 7 | wrapOutput: false, 8 | }); 9 | 10 | //@ 11 | //@ ### ShellString.prototype.toEnd(file) 12 | //@ 13 | //@ Examples: 14 | //@ 15 | //@ ```javascript 16 | //@ cat('input.txt').toEnd('output.txt'); 17 | //@ ``` 18 | //@ 19 | //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with 20 | //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). 21 | function _toEnd(options, file) { 22 | if (!file) common.error('wrong arguments'); 23 | 24 | if (!fs.existsSync(path.dirname(file))) { 25 | common.error('no such file or directory: ' + path.dirname(file)); 26 | } 27 | 28 | try { 29 | fs.appendFileSync(file, this.stdout || this.toString(), 'utf8'); 30 | return this; 31 | } catch (e) { 32 | /* istanbul ignore next */ 33 | common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true }); 34 | } 35 | } 36 | module.exports = _toEnd; 37 | -------------------------------------------------------------------------------- /node_modules/wrappy/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /node_modules/wrappy/README.md: -------------------------------------------------------------------------------- 1 | # wrappy 2 | 3 | Callback wrapping utility 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var wrappy = require("wrappy") 9 | 10 | // var wrapper = wrappy(wrapperFunction) 11 | 12 | // make sure a cb is called only once 13 | // See also: http://npm.im/once for this specific use case 14 | var once = wrappy(function (cb) { 15 | var called = false 16 | return function () { 17 | if (called) return 18 | called = true 19 | return cb.apply(this, arguments) 20 | } 21 | }) 22 | 23 | function printBoo () { 24 | console.log('boo') 25 | } 26 | // has some rando property 27 | printBoo.iAmBooPrinter = true 28 | 29 | var onlyPrintOnce = once(printBoo) 30 | 31 | onlyPrintOnce() // prints 'boo' 32 | onlyPrintOnce() // does nothing 33 | 34 | // random property is retained! 35 | assert.equal(onlyPrintOnce.iAmBooPrinter, true) 36 | ``` 37 | -------------------------------------------------------------------------------- /node_modules/wrappy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "wrappy@1", 3 | "_id": "wrappy@1.0.2", 4 | "_inBundle": false, 5 | "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 6 | "_location": "/wrappy", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "wrappy@1", 12 | "name": "wrappy", 13 | "escapedName": "wrappy", 14 | "rawSpec": "1", 15 | "saveSpec": null, 16 | "fetchSpec": "1" 17 | }, 18 | "_requiredBy": [ 19 | "/inflight", 20 | "/once" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 23 | "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", 24 | "_spec": "wrappy@1", 25 | "_where": "/home/sg/git/typescript-in-the-browser/node_modules/inflight", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/npm/wrappy/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": {}, 36 | "deprecated": false, 37 | "description": "Callback wrapping utility", 38 | "devDependencies": { 39 | "tap": "^2.3.1" 40 | }, 41 | "directories": { 42 | "test": "test" 43 | }, 44 | "files": [ 45 | "wrappy.js" 46 | ], 47 | "homepage": "https://github.com/npm/wrappy", 48 | "license": "ISC", 49 | "main": "wrappy.js", 50 | "name": "wrappy", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/npm/wrappy.git" 54 | }, 55 | "scripts": { 56 | "test": "tap --coverage test/*.js" 57 | }, 58 | "version": "1.0.2" 59 | } 60 | -------------------------------------------------------------------------------- /node_modules/wrappy/wrappy.js: -------------------------------------------------------------------------------- 1 | // Returns a wrapper function that returns a wrapped callback 2 | // The wrapper function should do some stuff, and return a 3 | // presumably different callback function. 4 | // This makes sure that own properties are retained, so that 5 | // decorations and such are not lost along the way. 6 | module.exports = wrappy 7 | function wrappy (fn, cb) { 8 | if (fn && cb) return wrappy(fn)(cb) 9 | 10 | if (typeof fn !== 'function') 11 | throw new TypeError('need wrapper function') 12 | 13 | Object.keys(fn).forEach(function (k) { 14 | wrapper[k] = fn[k] 15 | }) 16 | 17 | return wrapper 18 | 19 | function wrapper() { 20 | var args = new Array(arguments.length) 21 | for (var i = 0; i < args.length; i++) { 22 | args[i] = arguments[i] 23 | } 24 | var ret = fn.apply(this, args) 25 | var cb = args[args.length-1] 26 | if (typeof ret === 'function' && ret !== cb) { 27 | Object.keys(cb).forEach(function (k) { 28 | ret[k] = cb[k] 29 | }) 30 | } 31 | return ret 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/yamat/Changelog.md: -------------------------------------------------------------------------------- 1 | ## 0.0.11 2 | 3 | * run final report fix 4 | 5 | ## 0.0.13 6 | 7 | * fix --break-on-error no impl and docs 8 | * yamat forceDependenciesLatest 9 | * yamat help 10 | 11 | ## 0.0.14 -------------------------------------------------------------------------------- /node_modules/yamat/bin/yamat.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../dist/src/cli').main() -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/cli.d.ts: -------------------------------------------------------------------------------- 1 | export declare function main(): Promise; 2 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/cli.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const shelljs_1 = require("shelljs"); 4 | const force_dependency_1 = require("./force-dependency"); 5 | const link_1 = require("./link"); 6 | const run_1 = require("./run"); 7 | const unlink_1 = require("./unlink"); 8 | const util_1 = require("./util"); 9 | const help_1 = require("./help"); 10 | const args = require('yargs-parser')(process.argv.slice(2)); 11 | async function main() { 12 | const config = { 13 | rootPath: args.rootPath || shelljs_1.pwd().toString(), 14 | yamatJsonFile: args.yamatJsonFile 15 | }; 16 | config.yamatJsonFile = util_1.getConfigPath(config); 17 | const firstArg = args._[0]; 18 | // console.log(`yamat command "${firstArg}" called with config: ${JSON.stringify(config)}`) 19 | if (args.help) { 20 | help_1.helpAndExit(0); 21 | } 22 | else if (firstArg === 'unlink') { 23 | return unlink_1.unlink(Object.assign({}, config, { version: args.version || unlink_1.UnlinkVersion.local })); 24 | } 25 | else if (firstArg === 'run') { 26 | const cmd = [].concat(args._).slice(1).join(' '); 27 | return run_1.run(Object.assign({}, config, { cmd, breakOnError: args.breakOnError !== 'no' })); 28 | } 29 | else if (firstArg === 'forceDependenciesLatest') { 30 | return await force_dependency_1.forceLatestDependencies(Object.assign({}, config, { exclude: args.exclude || 'none' })); 31 | } 32 | else if (firstArg === 'link') { 33 | return link_1.link(config); 34 | } 35 | else 36 | throw new Error('Incorrect call. TODO: usage instructions'); 37 | } 38 | exports.main = main; 39 | //# sourceMappingURL=cli.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/force-dependency.d.ts: -------------------------------------------------------------------------------- 1 | import { YamatConfig } from "./types"; 2 | export interface ForceLatestDependenciesConfig extends YamatConfig { 3 | exclude: 'dependencies' | 'dev-dependencies' | 'none'; 4 | } 5 | export declare function forceLatestDependencies(forceConfig: ForceLatestDependenciesConfig): Promise; 6 | export interface ForceLatestDependenciesResult { 7 | errorCause?: string; 8 | package: string; 9 | newVersion?: string; 10 | oldVersion?: string; 11 | cmd?: string; 12 | } 13 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/help.d.ts: -------------------------------------------------------------------------------- 1 | export declare function helpAndExit(code?: number): void; 2 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/help.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | function helpAndExit(code = 0) { 4 | help(); 5 | process.exit(code); 6 | } 7 | exports.helpAndExit = helpAndExit; 8 | function help() { 9 | console.log(` 10 | Usage examples: 11 | 12 | yamat link 13 | 14 | yamat unlink [--version pack] 15 | 16 | Runs "npm run build" command on all packages. Don't break if there's an error and prints a final report 17 | 18 | yamat run npm run build 19 | 20 | Runs "npm run build" command on all packages. Stop executing in the rest of the packages if there's an error and prints a final report: 21 | 22 | yamat --break-on-error no run npm run build 23 | 24 | Upgrade all dependencies in al packages to latest version found in npmjs.org: 25 | 26 | yamat forceDependenciesLatest 27 | 28 | `); 29 | } 30 | //# sourceMappingURL=help.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './types'; 2 | export * from './unlink'; 3 | export * from './link'; 4 | export * from './run'; 5 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // just exports all public types for typings 3 | function __export(m) { 4 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 5 | } 6 | Object.defineProperty(exports, "__esModule", { value: true }); 7 | __export(require("./unlink")); 8 | __export(require("./link")); 9 | __export(require("./run")); 10 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/link.d.ts: -------------------------------------------------------------------------------- 1 | import { YamatConfig } from "./types"; 2 | export declare function link(yamatConfig: YamatConfig): void; 3 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/link.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const util_1 = require("./util"); 4 | const path_1 = require("path"); 5 | function link(yamatConfig) { 6 | yamatConfig.rootPath = yamatConfig.rootPath || '.'; 7 | yamatConfig.rootPath = path_1.resolve(yamatConfig.rootPath); 8 | const config = util_1.getConfig(yamatConfig); 9 | config.forEach(c => { 10 | const pj = util_1.parsePackageJson(yamatConfig, c.path); 11 | modifyJSONDeps(pj, 'dependencies', config, c); 12 | modifyJSONDeps(pj, 'devDependencies', config, c); 13 | util_1.writePackageJson(yamatConfig, c.path, pj); 14 | }); 15 | console.log('Packages successfully linked!'); 16 | } 17 | exports.link = link; 18 | function modifyJSONDeps(pj, propertyName, config, c) { 19 | Object.keys(pj[propertyName] || {}) 20 | .filter(d => config.find(c => c.name === d)) 21 | .forEach(d => { 22 | const found = config.find(c => c.name === d); 23 | if (found) { 24 | pj[propertyName][d] = 'file:' + path_1.relative(c.path, found.path); 25 | } 26 | }); 27 | } 28 | //# sourceMappingURL=link.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/pack.d.ts: -------------------------------------------------------------------------------- 1 | import { ConfigEntry, UnlinkConfig } from "."; 2 | /** 3 | * creates the pack file for given targetConfig and return the path to the tgz 4 | */ 5 | export declare function newone(config: UnlinkConfig, targetConfig: ConfigEntry): string; 6 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/pack.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const shelljs_1 = require("shelljs"); 4 | const util_1 = require("./util"); 5 | const assert_1 = require("assert"); 6 | const path_1 = require("path"); 7 | /** 8 | * creates the pack file for given targetConfig and return the path to the tgz 9 | */ 10 | function newone(config, targetConfig) { 11 | const cwd = shelljs_1.pwd(); 12 | shelljs_1.cd(util_1.getInternalFolder(config)); 13 | shelljs_1.rm('-rf', targetConfig.name + '-*.tgz'); 14 | const p = shelljs_1.exec('npm pack ' + util_1.getPackagePath(config, targetConfig.path)); 15 | assert_1.ok(p.code === 0); 16 | const tgzs = shelljs_1.ls(targetConfig.name + '-*.tgz'); 17 | assert_1.ok(tgzs.length === 1); 18 | shelljs_1.cd(cwd); 19 | return path_1.join(util_1.getInternalFolder(config), tgzs[0]); 20 | } 21 | exports.newone = newone; 22 | //# sourceMappingURL=pack.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/run.d.ts: -------------------------------------------------------------------------------- 1 | import { YamatConfig } from "."; 2 | /** 3 | * Runs given command on each package serially. 4 | * 5 | * By default it will run them all no matter if there are errors (some command ends with exit code 6 | * different than zero) and list each commend errors in a final report. If --breakOnError is passed 7 | * in which case it will break on first commend error and exit with the same command exit code. 8 | */ 9 | export declare function run(runConfig: RunConfig): void; 10 | export interface RunConfig extends YamatConfig { 11 | cmd: string; 12 | breakOnError: boolean; 13 | } 14 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/types.d.ts: -------------------------------------------------------------------------------- 1 | export interface YamatConfig { 2 | /** path to root project by default it is pwd() */ 3 | rootPath?: string; 4 | /** path to of yamat.json file. by default is pwd()+'yamat.json' */ 5 | yamatJsonFile?: string; 6 | } 7 | /** one entry in the array in yamat.json */ 8 | export interface ConfigEntry { 9 | name: string; 10 | path: string; 11 | } 12 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/types.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | //# sourceMappingURL=types.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | export * from './types'; 2 | export * from './link'; 3 | export * from './unlink'; 4 | export * from './run'; 5 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/typings.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function __export(m) { 3 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 4 | } 5 | Object.defineProperty(exports, "__esModule", { value: true }); 6 | __export(require("./link")); 7 | __export(require("./unlink")); 8 | __export(require("./run")); 9 | //# sourceMappingURL=typings.js.map -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/unlink.d.ts: -------------------------------------------------------------------------------- 1 | import { YamatConfig } from "./types"; 2 | export declare enum UnlinkVersion { 3 | /** put te version from local package.json. Default */ 4 | local = "local", 5 | /** build current package with npm pack and point the version to that .tgz */ 6 | pack = "pack", 7 | /** put the version of latest version of package in npm */ 8 | npm = "npm" 9 | } 10 | export interface UnlinkConfig extends YamatConfig { 11 | version?: UnlinkVersion; 12 | } 13 | export declare function unlink(unlinkConfig: UnlinkConfig): void; 14 | -------------------------------------------------------------------------------- /node_modules/yamat/dist/src/util.d.ts: -------------------------------------------------------------------------------- 1 | import { ConfigEntry } from "."; 2 | import { YamatConfig } from "./types"; 3 | export declare function getConfig(config: YamatConfig): Array; 4 | export declare function getConfigPath(config: YamatConfig): string; 5 | export declare function writeFile(file: string, data: string): void; 6 | export declare function getPackageJsonPath(config: YamatConfig, packagePath: string): string; 7 | export declare function getPackagePath(config: YamatConfig, packagePath: string): string; 8 | export declare function parsePackageJson(config: YamatConfig, path: string): any; 9 | export declare function writePackageJson(config: YamatConfig, path: string, data: any): void; 10 | export declare function getInternalFolder(config: YamatConfig): string; 11 | export declare function parseJSON(s: string): any; 12 | -------------------------------------------------------------------------------- /node_modules/yargs-parser/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Contributors 2 | 3 | Permission to use, copy, modify, and/or distribute this software 4 | for any purpose with or without fee is hereby granted, provided 5 | that the above copyright notice and this permission notice 6 | appear in all copies. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 10 | OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 11 | LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 12 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 13 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 14 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | -------------------------------------------------------------------------------- /node_modules/yargs-parser/lib/tokenize-arg-string.js: -------------------------------------------------------------------------------- 1 | // take an un-split argv string and tokenize it. 2 | module.exports = function (argString) { 3 | if (Array.isArray(argString)) return argString 4 | 5 | argString = argString.trim() 6 | 7 | var i = 0 8 | var prevC = null 9 | var c = null 10 | var opening = null 11 | var args = [] 12 | 13 | for (var ii = 0; ii < argString.length; ii++) { 14 | prevC = c 15 | c = argString.charAt(ii) 16 | 17 | // split on spaces unless we're in quotes. 18 | if (c === ' ' && !opening) { 19 | if (!(prevC === ' ')) { 20 | i++ 21 | } 22 | continue 23 | } 24 | 25 | // don't split the string if we're in matching 26 | // opening or closing single and double quotes. 27 | if (c === opening) { 28 | opening = null 29 | continue 30 | } else if ((c === "'" || c === '"') && !opening) { 31 | opening = c 32 | continue 33 | } 34 | 35 | if (!args[i]) args[i] = '' 36 | args[i] += c 37 | } 38 | 39 | return args 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-in-the-browser", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "doc": "docs" 8 | }, 9 | "scripts": { 10 | "all": "export NODE_ENV=\"production\" && rm -rf docs && yamat run npm run all", 11 | "all-no-minify": "rm -rf docs && yamat run npm run all-no-minify", 12 | "clean": "find . -name \"node_modules\" -exec rm -rf '{}' +; find . -name \"package-lock.json\" -exec rm -rf '{}' +; ", 13 | "all-clean": "npm run clean && npm i && yamat run npm i && npm run all" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/cancerberoSgx/typescript-in-the-browser.git" 18 | }, 19 | "keywords": [ 20 | "monaco-editor", 21 | "monaco editor", 22 | "monaco", 23 | "online editor", 24 | "TypeScript", 25 | "TypeScript Compiler", 26 | "TypeScript API" 27 | ], 28 | "author": "Sebastian Gurin", 29 | "license": "MIT", 30 | "bugs": { 31 | "url": "https://github.com/cancerberoSgx/typescript-in-the-browser/issues" 32 | }, 33 | "homepage": "https://github.com/cancerberoSgx/typescript-in-the-browser#readme", 34 | "devDependencies": { 35 | "yamat": "0.0.14" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | .yamat 6 | *.tgz 7 | .idea 8 | /static 9 | /docs -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/scripts/copy-static.ts: -------------------------------------------------------------------------------- 1 | 2 | const copies = [ 3 | { source: 'src/static/*', dest: 'static' }, 4 | { source: 'node_modules/bootstrap/dist/css/bootstrap.min.css', dest: 'static' }, 5 | { source: 'node_modules/jquery/dist/jquery.slim.min.js', dest: 'static' }, 6 | { source: 'node_modules/bootstrap/dist/js/bootstrap.min.js', dest: 'static' }, 7 | { source: 'node_modules/monaco-editor/min/vs/base/*', dest: 'static/monaco-editor/min/vs/base' }, 8 | { source: 'node_modules/monaco-editor/min/vs/editor/*', dest: 'static/monaco-editor/min/vs/editor' }, 9 | { source: 'node_modules/monaco-editor/min/vs/language/typescript/*', dest: 'static/monaco-editor/min/vs/language/typescript' }, 10 | { source: 'node_modules/monaco-editor/min/vs/basic-languages/markdown/*', dest: 'static/monaco-editor/min/vs/basic-languages/markdown' }, 11 | { source: 'node_modules/monaco-editor/min/vs/language/json/*', dest: 'static/monaco-editor/min/vs/language/json' }, 12 | { source: 'node_modules/monaco-editor/min/vs/loader.js', dest: 'static/monaco-editor/min/vs' }, 13 | { source: 'node_modules/vscode-languageserver-types/lib/umd/main.js', dest: 'static/monaco-editor/min/vscode-languageserver-types/' }, 14 | { source: 'node_modules/jsonc-parser/lib/umd/main.js', dest: 'static/jsonc-parser' } 15 | 16 | ] 17 | 18 | 19 | import { cp, mkdir } from 'shelljs' 20 | export function copy() { 21 | copies.forEach(c => { 22 | mkdir('-p', c.dest); 23 | cp('-rf', c.source, c.dest) 24 | }) 25 | } 26 | copy() 27 | 28 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/scripts/watch-static.ts: -------------------------------------------------------------------------------- 1 | import { watch } from 'fs'; 2 | import { copy } from './copy-static'; 3 | 4 | watch('src/static', ()=>{ 5 | copy() 6 | }) 7 | 8 | watch('src/static/examples', ()=>{ 9 | copy() 10 | }) -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.json" { 2 | const value: any; 3 | export default value; 4 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/languageServiceProvider/index.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as ts from "typescript"; 3 | 4 | 5 | export interface LanguageServiceProvider { 6 | createLanguageService(files: any[], compilerOptions: ts.CompilerOptions): ts.LanguageService 7 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/languageServiceProvider/languageServiceProviderFactory.ts: -------------------------------------------------------------------------------- 1 | import { LanguageServiceProviderDummy1 } from './dummy1'; 2 | 3 | export function getDefaultLanguageServiceProvider() { 4 | return new LanguageServiceProviderDummy1() 5 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/programProvider/index.ts: -------------------------------------------------------------------------------- 1 | 2 | // interfaces that define basic File types, createProgram() ad createCompilerHost to isolate this part allowing execution in the browser. 3 | // initial IDEA / design 4 | 5 | // WIP 6 | 7 | import * as ts from "typescript"; 8 | import { AbstractFile } from 'monaco-typescript-project-util'; 9 | /** very simple type representing data files - previously to any parsing for now just a fileName and content */ 10 | export interface ProgramFile extends AbstractFile { 11 | isLink?: boolean 12 | } 13 | 14 | 15 | export interface ProgramProvider { 16 | createProgram(files?: ProgramFile[], compilerOptions?: ts.CompilerOptions): ts.Program 17 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/programProvider/programProviderFactory.ts: -------------------------------------------------------------------------------- 1 | import { ProgramProviderVeryDummyImpl } from './dummy1/programProviderVeryDummyImpl'; 2 | 3 | export function getDefaultProgramProvider() { 4 | return new ProgramProviderVeryDummyImpl() 5 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/types.ts: -------------------------------------------------------------------------------- 1 | import * as ts from 'typescript'; 2 | import { ProgramFile } from './programProvider'; 3 | import { AbstractProject } from 'monaco-typescript-project-util'; 4 | 5 | export interface ExampleExecutionOptions { 6 | program: ts.Program 7 | languageService: ts.LanguageService 8 | } 9 | 10 | export interface ExampleExecutionResult { 11 | } 12 | 13 | export type ExampleExecute = (config: ExampleExecutionOptions) => (ExampleExecutionResult | undefined | void) 14 | 15 | export interface Example extends AbstractProject{ 16 | 17 | id: string 18 | 19 | description: string 20 | 21 | execute: ExampleExecute 22 | 23 | exampleSource: ProgramFile 24 | 25 | // because monaco-editor and browserify / commonsjs don't play nice together, we are hacking ike the 26 | // following so we are able to eval() user's modifications. in this member we store the current example 27 | // execution context require function which we need to pass to the eval() 28 | __require: any 29 | } 30 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/forkRibbon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default ()=> 4 |
5 | 6 | function getRibbonHtml(){ 7 | return {__html: 'Fork me on GitHub'} 8 | 9 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/iuSettingsState.ts: -------------------------------------------------------------------------------- 1 | const config: UIConfig = { 2 | editorKind: 'monaco', 3 | mainContentKind: 'project' 4 | } 5 | export function getUIConfig(): UIConfig{ 6 | return config 7 | } 8 | export function set(key: keyof UIConfig, value: any): UIConfig{ 9 | return config 10 | } 11 | export function setEditorKind(value: EditorKind){ 12 | config.editorKind = value 13 | } 14 | export function setMainContentKind(value: MainContentKind){ 15 | config.mainContentKind = value 16 | } 17 | export interface UIConfig{ 18 | editorKind: EditorKind 19 | mainContentKind: MainContentKind 20 | } 21 | export type EditorKind = 'monaco'|'pre' 22 | export type MainContentKind = 'simple1'|'project' -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/layout.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import navbar from './navbar/navbar'; 3 | import mainContentSimple1 from './mainContentSimple1/mainContentSimple1'; 4 | import forkRibbon from './forkRibbon'; 5 | import whatsThisModal from './navbar/whatsThisModal'; 6 | import mainContentProjectEditor from './mainContentProjectEditor/mainContentProjectEditor'; 7 | import {getUIConfig} from './iuSettingsState' 8 | import dropTsProjectFolder from './navbar/dropTsProjectFolderModal'; 9 | import saveProjectModal from './navbar/saveProjectModal'; 10 | import loadProjectModal from './navbar/loadProjectModal'; 11 | 12 | export default ()=> 13 |
14 | {navbar()} 15 | {getUIConfig().mainContentKind==='project' ? mainContentProjectEditor() : mainContentSimple1()} 16 | {forkRibbon()} 17 | {whatsThisModal()} 18 | {dropTsProjectFolder()} 19 | {saveProjectModal()} 20 | {loadProjectModal()} 21 | 22 |
23 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentProjectEditor/CompilerEditor.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { editor } from 'monaco-editor' 3 | import { Editor } from 'monaco-typescript-project-util'; 4 | import { getUIConfig } from '../iuSettingsState'; 5 | 6 | export class CompilerEditor extends Editor { 7 | editor: editor.IStandaloneCodeEditor; 8 | render() { 9 | if (getUIConfig().editorKind === 'monaco') { 10 | return super.render() 11 | } else { 12 | return ( 13 |
{this.props.file.content}
14 | ) 15 | } 16 | } 17 | installMonaco(){ 18 | if (getUIConfig().editorKind === 'monaco') { 19 | return super.installMonaco() 20 | } 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentProjectEditor/CompilerFileTree.tsx: -------------------------------------------------------------------------------- 1 | import { FileTree, TreeNode } from 'monaco-typescript-project-util'; 2 | import { render } from '../../main'; 3 | import { Example } from '../../types'; 4 | import { setSelectedFile } from './projectState'; 5 | 6 | export class CompilerFileTree extends FileTree<{ project: Example }> { 7 | private addExampleSource(){ 8 | this.props.state.project.files = [this.props.state.project.exampleSource].concat(this.props.state.project.files||[]) 9 | } 10 | componentWillUpdate() { 11 | this.addExampleSource() 12 | } 13 | componentWillMount() { 14 | this.addExampleSource() 15 | } 16 | setSelectedFile(node: TreeNode) { 17 | setSelectedFile(this.props.state.project.files.find(f => node.fileName === f.fileName)) 18 | render() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentProjectEditor/mainContentProjectEditor.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { getCurrentExample } from '../../manager'; 3 | import exampleOutput from '../mainContentSimple1/exampleOutput'; 4 | import { CompilerFileTree } from './CompilerFileTree'; 5 | import { CompilerEditor } from './CompilerEditor'; 6 | import { getSelectedFile } from './projectState'; 7 | 8 | export default () => { 9 | const example = getCurrentExample() 10 | return (
11 |
12 |
13 |

{example.name}

14 |

{example.description}

15 |
16 |
17 |
18 |
19 | 20 |
21 |
22 | 23 |
24 |
25 |
26 |
27 | {exampleOutput()} 28 |
29 |
30 |
) 31 | } 32 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentProjectEditor/projectState.ts: -------------------------------------------------------------------------------- 1 | import { ProgramFile } from '../../programProvider'; 2 | import { getCurrentExample } from '../../manager'; 3 | 4 | let selectedFile:ProgramFile 5 | 6 | export function getSelectedFile():ProgramFile{ 7 | return selectedFile || getCurrentExample().exampleSource 8 | } 9 | 10 | export function setSelectedFile(f: ProgramFile){ 11 | selectedFile=f 12 | } 13 | 14 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentSimple1/currentExample.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { getCurrentExample } from '../../manager'; 3 | import { CompilerEditor } from '../mainContentProjectEditor/CompilerEditor'; 4 | 5 | export default () => { 6 | const example = getCurrentExample() 7 | return ( 8 |
9 |

{example.name}

10 |

{example.description}

11 |

Example source:

12 | 13 |

Example project source files:

14 |
    15 | {example.files.map((f, i) => 16 |
  • 17 |
    {f.fileName.replace('examples/files/', '')}
    18 | 19 |
  • 20 | )} 21 |
22 |
23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentSimple1/exampleOutput.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { lastExampleExecutionTime } from '../../manager'; 3 | import { getLogLines } from '../../util/uiUtil'; 4 | 5 | export default () => 6 |
7 |

Example output

8 | (Execution time: {lastExampleExecutionTime && lastExampleExecutionTime.toLocaleString(undefined, { maximumFractionDigits: 0 })}ms) 9 |

10 |
{getLogLines().join('')}
11 |
-------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/mainContentSimple1/mainContentSimple1.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import exampleOutput from './exampleOutput' 3 | import currentExample from './currentExample'; 4 | export default ()=> 5 |
6 |
7 |
8 | {currentExample()} 9 |
10 |
11 | {exampleOutput()} 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/navbar/dropTsProjectFolderModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | export default () => { 3 | return () 28 | } 29 | 30 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/navbar/loadProjectModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export default ()=>{ 4 | 5 | return ( 6 | 7 | 27 | 28 | 29 | )} -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/navbar/saveProjectModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { projectToJson } from 'monaco-typescript-project-util'; 3 | import { getCurrentExample } from '../../manager'; 4 | 5 | export default ()=>{ 6 | 7 | return ( 8 | 9 | 32 | 33 | 34 | )} -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/ui/navbar/uiSettings.tsx: -------------------------------------------------------------------------------- 1 | import React, { ChangeEvent } from 'react'; 2 | import { render } from '../../main'; 3 | import { getUIConfig, setEditorKind, setMainContentKind } from '../iuSettingsState'; 4 | 5 | export default () => 6 |
7 |
8 | 10 | 11 |
12 |
13 | 15 | 16 |
17 |
18 | 19 | 20 | function toggleMainContentKindChanged(e: ChangeEvent) { 21 | setMainContentKind(e.target.checked ? 'project' : 'simple1') 22 | render() 23 | } 24 | 25 | function toggleEditorKindChanged(e: ChangeEvent) { 26 | setEditorKind(e.target.checked ? 'monaco' : 'pre') 27 | render() 28 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/util/libraries.ts: -------------------------------------------------------------------------------- 1 | import { readFileSync } from 'fs'; 2 | import { resolve } from 'path'; 3 | import { ProgramFile } from '../programProvider'; 4 | 5 | const libraries = [ 6 | { 7 | fileName: 'node_modules/typescript/lib/lib.d.ts', 8 | content: ' '//readFileSync(resolve('.')+'/node_modules/typescript/lib/lib.d.ts').toString() 9 | } 10 | ] 11 | 12 | export function getLibraries():ProgramFile[]{ 13 | return libraries 14 | } 15 | // const libDTs = readFileSync(resolve('.')+'node_modules/typescript/lib/lib.d.ts').toString() -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/compiler/util/uiUtil.ts: -------------------------------------------------------------------------------- 1 | 2 | // log 3 | 4 | const lines:string[] = [] 5 | export function log(...args:any[]){ 6 | const line = args.join(' ') + '\n' 7 | lines.push(line) 8 | } 9 | export function resetLog(){ 10 | lines.length = 0 11 | } 12 | export function getLogLines():string[]{ 13 | return lines 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/exampleUtil.ts: -------------------------------------------------------------------------------- 1 | 2 | import { log } from '../compiler/util/uiUtil'; 3 | import * as ts from 'typescript' 4 | 5 | export function printNode(n: ts.Node, level: number = 0): string { 6 | const text = n.getText().replace(/[\\n\\s]+/gm, ' ') 7 | return `${new Array(level * 2).fill(' ').join('')}${getKindName(n.kind)} - "${text.substring(0, Math.min(text.length, 20))}` 8 | } 9 | 10 | export function visit(node: ts.Node, visitor: (node: ts.Node, level: number) => void, level: number = 0) { 11 | if (!node) { 12 | return; 13 | } 14 | visitor(node, level); 15 | node.forEachChild(child => visit(child, visitor, level + 1)); 16 | } 17 | 18 | export function getKindName(kind: ts.SyntaxKind) { 19 | return (ts as any).SyntaxKind[kind]; 20 | } 21 | export function printAllSourceFileAst(program: ts.Program, l: typeof log = log) { 22 | program.getSourceFiles().forEach(sourceFile => { 23 | l(`=== AST of ${sourceFile.isDeclarationFile ? 'Declaration File' : 'Source File'} ${sourceFile.fileName} ==`) 24 | visit(sourceFile, (n, level) => l(printNode(n, level))) 25 | }) 26 | } 27 | 28 | // export const defaultFormatDiagnosticHost: ts.FormatDiagnosticsHost = defaultFormatDiagnosticHost -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/files/transformation1/test1.ts: -------------------------------------------------------------------------------- 1 | class Foo { 2 | magic2(s: number) { 3 | return s + 5 + 50 + 11 + 99 * 8 * 7 / s 4 | } 5 | } 6 | const value = new Foo().magic2(1 + 2 + 3) -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/files/tsSimpleAst1/toRename.ts: -------------------------------------------------------------------------------- 1 | class Animal implements Living { 2 | energy: number 3 | constructor(public name: string) { } 4 | move(distanceInMeters: number = 0) { 5 | console.log(`${this.name} moved ${distanceInMeters}m.`) 6 | } 7 | } 8 | interface Living { 9 | energy: number 10 | } 11 | class Snake extends Animal { 12 | constructor(name: string) { super(name); } 13 | move(distanceInMeters = 5) { 14 | console.log("Slithering..."); 15 | super.move(distanceInMeters); 16 | } 17 | } 18 | const words: string[] = [] 19 | function randomIdentifier(what: 'variable' | 'class' = 'variable', amountOfWords: number = 2): string { 20 | let w = words[random(0, words.length - 1)] 21 | return what === 'class' ? camel(w) : w 22 | } 23 | function random(a: number, b: number):number { 24 | return Math.floor(Math.random() * b) + a 25 | } 26 | function camel(w: string):string { 27 | return w.substring(0, 1).toUpperCase() + w.substring(1, w.length) 28 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/files/tsTranspilingProject1/someImpl.ts: -------------------------------------------------------------------------------- 1 | import { Fruit } from "./someModel"; 2 | 3 | class Suite implements Fruit{ 4 | parentTree: number[][]; 5 | energy: number; 6 | constructor(private howmuch: Date[]){} 7 | grab(): this{return this} 8 | } 9 | 10 | const thing = new Suite([]) 11 | console.log(thing as any); 12 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/files/tsTranspilingProject1/someModel.ts: -------------------------------------------------------------------------------- 1 | export interface Fruit extends Eatable { 2 | parentTree: number[][] 3 | } 4 | /** 5 | * an eatable can be eaten 6 | */ 7 | export interface Eatable { 8 | energy: number 9 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/files/tsTranspilingProject1/someUI.tsx: -------------------------------------------------------------------------------- 1 | declare namespace JSX { 2 | interface IntrinsicElements { 3 | [elemName: string]: any 4 | } 5 | } 6 | interface FooProp { 7 | name: string 8 | X: number 9 | Y: number 10 | } 11 | const amorphus = (a:string, arr: string[], b=)=> () 12 | const AnotherComponent = (params : {name: string}) =>() 13 | function ComponentFoo(prop: FooProp) { 14 | return 15 | } 16 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/files/tsquery1/sample1.ts: -------------------------------------------------------------------------------- 1 | class Animal { 2 | constructor(public name: string) { } 3 | move(distanceInMeters: number = 0) { 4 | console.log( `${this.name} moved ${distanceInMeters}m.`) 5 | } 6 | } 7 | class Snake extends Animal { 8 | constructor(name: string) { super(name); } 9 | move(distanceInMeters = 5) { 10 | console.log("Slithering..."); 11 | super.move(distanceInMeters); 12 | } 13 | } -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/loadProjectJsonTest1.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Example , ExampleExecutionOptions } from '../compiler/types'; 3 | import { log } from '../compiler/util/uiUtil'; 4 | import { getFiles } from './exampleFilesManager'; 5 | import * as tsSampleProjectFiles from './projectsJson/ts-sample-project.json' 6 | 7 | export default class implements Example { 8 | id = 'loadProjectJsonTest1' 9 | name = 'loadProjectJsonTest1' 10 | description = 'Loading a whole project folder previously serialized with fs-to-json tool' 11 | files = (tsSampleProjectFiles as any).files 12 | exampleSource = getFiles().find(f => f.fileName.includes(`examples/${this.id}`)) 13 | execute = (options: ExampleExecutionOptions) => { 14 | log('Nothing special, just checking how well monaco-editor handle the files as a project...') 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/examples/tsquery1.ts: -------------------------------------------------------------------------------- 1 | import { Example, ExampleExecutionOptions } from '../compiler/types'; 2 | import { log } from '../compiler/util/uiUtil'; 3 | import { getFiles } from './exampleFilesManager'; 4 | import { tsquery } from '@phenomnomnominal/tsquery'; 5 | 6 | 7 | (window as any).__require_before_monaco = require 8 | 9 | export default class implements Example { 10 | 11 | execute = (options: ExampleExecutionOptions) => { 12 | options.program.getSourceFiles().forEach(sourceFile => { 13 | const ast = tsquery.ast(sourceFile.getText()) 14 | const nodes = tsquery(ast, 'Identifier[name="Animal"]') 15 | log(`Identifier[name="Animal"] count: ${nodes.length}`) 16 | }) 17 | } 18 | 19 | id = 'tsquery1' 20 | name = 'tsquery example 1' 21 | description = 'Example of using tsquery: https://github.com/phenomnomnominal/tsquery' 22 | files = getFiles().filter(f => f.fileName.includes(`files/${this.id}`)) 23 | exampleSource = getFiles().find(f => f.fileName.includes(`examples/${this.id}`)) 24 | } 25 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/src/static/examples/ts-browser-create-program-fails.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TypeScript Compiler API very simple example - transpiling code 8 | 9 | 10 | 11 | 12 | 13 |

In this example we just load typescript.js as it is, creating a Program fails because it tries to access the native filesystem (ts.sys is undefined in the browser). So we need to provide a custom CompilerHost and LanguageServiceHost and that's what this project is all about. 14 |

15 | 16 | 17 |

TypeScript Program:

18 |
19 | log = function (s) { document.getElementById('output').innerText += s + '\n' }
20 | const program = ts.createProgram(['test1.ts'], {})
21 | const sourceFile = ts.getSourceFile('test1.ts')
22 | log(sourceFile.getText())
23 |   
24 |

Output:

25 |

26 | 
27 | 
28 |   
29 | 
30 |   
40 | 
41 | 
42 | 
43 | 


--------------------------------------------------------------------------------
/typescript-compiler-in-the-browser/src/static/index.css:
--------------------------------------------------------------------------------
 1 | .editor{
 2 |   resize: vertical;
 3 |   overflow: auto;
 4 | }
 5 | 
 6 | 
 7 | #tsProjectFolderDropArea {
 8 |   width: 300px; 
 9 |   height: 150px; 
10 |   border: 3px solid pink; 
11 |   background-color: darkolivegreen
12 | }
13 | 
14 | #saveProjectJsonTextarea{
15 |   width: 100%
16 | }
17 | .rstcustom__rowWrapper{
18 | cursor: pointer
19 | }
20 | .rstcustom__node .selected {
21 |   background-color: #edaaaa
22 | }
23 | .examples-menu-item{
24 |   font-weight: bolder;
25 |   color: white !important;
26 |   text-decoration: underline
27 | }


--------------------------------------------------------------------------------
/typescript-compiler-in-the-browser/src/static/index.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |   
 5 |   
 6 |   TypeScript Compiler in the browser
 7 |   
 8 |   
 9 |   
10 | 
11 | 
12 |   
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 40 | 41 | -------------------------------------------------------------------------------- /typescript-compiler-in-the-browser/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "jsx": "react", 7 | "jsxFactory": "React.createElement", 8 | "lib": ["es2018", "dom"], 9 | "outDir": "./dist", 10 | "rootDir": ".", 11 | "strict": true, 12 | "pretty": false, 13 | "strictNullChecks": false, 14 | // "noImplicitAny": false, 15 | "sourceMap": true, 16 | "esModuleInterop": true, 17 | "declaration": true, 18 | "skipLibCheck": true 19 | }, 20 | "include": [ 21 | "src" 22 | ], 23 | "exclude": [ 24 | "src/examples" 25 | ] 26 | } -------------------------------------------------------------------------------- /yamat.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "monaco-typescript-project-util", 4 | "path": "monaco-typescript-project-util" 5 | }, 6 | { 7 | "name": "monaco-typescript-project-util-cli", 8 | "path": "monaco-typescript-project-util-cli" 9 | }, 10 | { 11 | "name": "monaco-typescript-project-util-sample-project", 12 | "path": "monaco-typescript-project-util-sample-project" 13 | }, 14 | { 15 | "name": "typescript-compiler-in-the-browser", 16 | "path": "typescript-compiler-in-the-browser" 17 | }, 18 | { 19 | "name": "candombed", 20 | "path": "candombed" 21 | } 22 | ] --------------------------------------------------------------------------------