jass 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +47 -0
- data/README.md +45 -0
- data/lib/jass.rb +55 -0
- data/lib/jass/base.rb +141 -0
- data/lib/jass/bundle_processor.rb +28 -0
- data/lib/jass/compiler.rb +112 -0
- data/lib/jass/dependency.rb +14 -0
- data/lib/jass/errors.rb +29 -0
- data/lib/jass/es6_processor.rb +17 -0
- data/lib/jass/function.rb +13 -0
- data/lib/jass/global_directive_processor.rb +12 -0
- data/lib/jass/plugin.rb +13 -0
- data/lib/jass/railtie.rb +12 -0
- data/lib/jass/version.rb +3 -0
- data/vendor/node_modules/@types/acorn/index.d.ts +256 -0
- data/vendor/node_modules/@types/acorn/package.json +29 -0
- data/vendor/node_modules/@types/estree/index.d.ts +546 -0
- data/vendor/node_modules/@types/estree/package.json +22 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/index.js +17 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/inject.js +72 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/walk.js +22 -0
- data/vendor/node_modules/acorn-dynamic-import/package.json +45 -0
- data/vendor/node_modules/acorn-dynamic-import/src/index.js +4 -0
- data/vendor/node_modules/acorn-dynamic-import/src/inject.js +52 -0
- data/vendor/node_modules/acorn-dynamic-import/src/walk.js +12 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-es7-plugin.js +17 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-v3.js +333 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-v4.js +194 -0
- data/vendor/node_modules/acorn-es7-plugin/package.json +29 -0
- data/vendor/node_modules/acorn-jsx/index.js +3 -0
- data/vendor/node_modules/acorn-jsx/inject.js +449 -0
- data/vendor/node_modules/acorn-jsx/package.json +28 -0
- data/vendor/node_modules/acorn-jsx/xhtml.js +255 -0
- data/vendor/node_modules/acorn/bin/_acorn.js +69 -0
- data/vendor/node_modules/acorn/bin/acorn +4 -0
- data/vendor/node_modules/acorn/bin/run_test262.js +22 -0
- data/vendor/node_modules/acorn/bin/test262.whitelist +409 -0
- data/vendor/node_modules/acorn/dist/acorn.es.js +5305 -0
- data/vendor/node_modules/acorn/dist/acorn.js +5336 -0
- data/vendor/node_modules/acorn/dist/acorn_loose.es.js +1412 -0
- data/vendor/node_modules/acorn/dist/acorn_loose.js +1422 -0
- data/vendor/node_modules/acorn/dist/walk.es.js +419 -0
- data/vendor/node_modules/acorn/dist/walk.js +439 -0
- data/vendor/node_modules/acorn/package.json +56 -0
- data/vendor/node_modules/ansi-styles/index.js +165 -0
- data/vendor/node_modules/ansi-styles/package.json +56 -0
- data/vendor/node_modules/arr-diff/index.js +58 -0
- data/vendor/node_modules/arr-diff/package.json +49 -0
- data/vendor/node_modules/arr-flatten/index.js +22 -0
- data/vendor/node_modules/arr-flatten/package.json +76 -0
- data/vendor/node_modules/array-unique/index.js +28 -0
- data/vendor/node_modules/array-unique/package.json +37 -0
- data/vendor/node_modules/braces/index.js +399 -0
- data/vendor/node_modules/braces/package.json +83 -0
- data/vendor/node_modules/buble/bin/buble +24 -0
- data/vendor/node_modules/buble/bin/handleError.js +58 -0
- data/vendor/node_modules/buble/bin/runBuble.js +150 -0
- data/vendor/node_modules/buble/bin/showHelp.js +16 -0
- data/vendor/node_modules/buble/dist/buble-browser-deps.umd.js +14857 -0
- data/vendor/node_modules/buble/dist/buble-browser.cjs.js +9941 -0
- data/vendor/node_modules/buble/dist/buble-browser.es.js +9933 -0
- data/vendor/node_modules/buble/dist/buble.cjs.js +9433 -0
- data/vendor/node_modules/buble/dist/buble.es.js +9425 -0
- data/vendor/node_modules/buble/package.json +74 -0
- data/vendor/node_modules/buble/register.js +90 -0
- data/vendor/node_modules/buble/src/index.js +98 -0
- data/vendor/node_modules/buble/src/program/BlockStatement.js +373 -0
- data/vendor/node_modules/buble/src/program/Node.js +112 -0
- data/vendor/node_modules/buble/src/program/Program.js +74 -0
- data/vendor/node_modules/buble/src/program/Scope.js +116 -0
- data/vendor/node_modules/buble/src/program/extractNames.js +35 -0
- data/vendor/node_modules/buble/src/program/keys.js +4 -0
- data/vendor/node_modules/buble/src/program/types/ArrayExpression.js +70 -0
- data/vendor/node_modules/buble/src/program/types/ArrowFunctionExpression.js +52 -0
- data/vendor/node_modules/buble/src/program/types/AssignmentExpression.js +185 -0
- data/vendor/node_modules/buble/src/program/types/BinaryExpression.js +12 -0
- data/vendor/node_modules/buble/src/program/types/BreakStatement.js +26 -0
- data/vendor/node_modules/buble/src/program/types/CallExpression.js +104 -0
- data/vendor/node_modules/buble/src/program/types/ClassBody.js +237 -0
- data/vendor/node_modules/buble/src/program/types/ClassDeclaration.js +79 -0
- data/vendor/node_modules/buble/src/program/types/ClassExpression.js +51 -0
- data/vendor/node_modules/buble/src/program/types/ContinueStatement.js +17 -0
- data/vendor/node_modules/buble/src/program/types/ExportDefaultDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ExportNamedDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ForInStatement.js +76 -0
- data/vendor/node_modules/buble/src/program/types/ForOfStatement.js +89 -0
- data/vendor/node_modules/buble/src/program/types/ForStatement.js +54 -0
- data/vendor/node_modules/buble/src/program/types/FunctionDeclaration.js +25 -0
- data/vendor/node_modules/buble/src/program/types/FunctionExpression.js +74 -0
- data/vendor/node_modules/buble/src/program/types/Identifier.js +54 -0
- data/vendor/node_modules/buble/src/program/types/IfStatement.js +29 -0
- data/vendor/node_modules/buble/src/program/types/ImportDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ImportDefaultSpecifier.js +8 -0
- data/vendor/node_modules/buble/src/program/types/ImportSpecifier.js +8 -0
- data/vendor/node_modules/buble/src/program/types/JSXAttribute.js +20 -0
- data/vendor/node_modules/buble/src/program/types/JSXClosingElement.js +27 -0
- data/vendor/node_modules/buble/src/program/types/JSXClosingFragment.js +22 -0
- data/vendor/node_modules/buble/src/program/types/JSXElement.js +57 -0
- data/vendor/node_modules/buble/src/program/types/JSXExpressionContainer.js +10 -0
- data/vendor/node_modules/buble/src/program/types/JSXFragment.js +4 -0
- data/vendor/node_modules/buble/src/program/types/JSXOpeningElement.js +93 -0
- data/vendor/node_modules/buble/src/program/types/JSXOpeningFragment.js +7 -0
- data/vendor/node_modules/buble/src/program/types/JSXSpreadAttribute.js +10 -0
- data/vendor/node_modules/buble/src/program/types/Literal.js +43 -0
- data/vendor/node_modules/buble/src/program/types/MemberExpression.js +13 -0
- data/vendor/node_modules/buble/src/program/types/NewExpression.js +55 -0
- data/vendor/node_modules/buble/src/program/types/ObjectExpression.js +250 -0
- data/vendor/node_modules/buble/src/program/types/Property.js +52 -0
- data/vendor/node_modules/buble/src/program/types/ReturnStatement.js +32 -0
- data/vendor/node_modules/buble/src/program/types/SpreadElement.js +12 -0
- data/vendor/node_modules/buble/src/program/types/Super.js +88 -0
- data/vendor/node_modules/buble/src/program/types/TaggedTemplateExpression.js +63 -0
- data/vendor/node_modules/buble/src/program/types/TemplateElement.js +7 -0
- data/vendor/node_modules/buble/src/program/types/TemplateLiteral.js +80 -0
- data/vendor/node_modules/buble/src/program/types/ThisExpression.js +31 -0
- data/vendor/node_modules/buble/src/program/types/UpdateExpression.js +32 -0
- data/vendor/node_modules/buble/src/program/types/VariableDeclaration.js +101 -0
- data/vendor/node_modules/buble/src/program/types/VariableDeclarator.js +43 -0
- data/vendor/node_modules/buble/src/program/types/index.js +98 -0
- data/vendor/node_modules/buble/src/program/types/shared/LoopStatement.js +105 -0
- data/vendor/node_modules/buble/src/program/types/shared/ModuleDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/wrap.js +68 -0
- data/vendor/node_modules/buble/src/support.js +97 -0
- data/vendor/node_modules/buble/src/utils/CompileError.js +30 -0
- data/vendor/node_modules/buble/src/utils/array.js +11 -0
- data/vendor/node_modules/buble/src/utils/checkConst.js +8 -0
- data/vendor/node_modules/buble/src/utils/deindent.js +30 -0
- data/vendor/node_modules/buble/src/utils/destructure.js +377 -0
- data/vendor/node_modules/buble/src/utils/getSnippet.js +30 -0
- data/vendor/node_modules/buble/src/utils/isReference.js +41 -0
- data/vendor/node_modules/buble/src/utils/locate.js +20 -0
- data/vendor/node_modules/buble/src/utils/patterns.js +1 -0
- data/vendor/node_modules/buble/src/utils/removeTrailingComma.js +13 -0
- data/vendor/node_modules/buble/src/utils/reserved.js +6 -0
- data/vendor/node_modules/buble/src/utils/spread.js +70 -0
- data/vendor/node_modules/builtin-modules/builtin-modules.json +39 -0
- data/vendor/node_modules/builtin-modules/index.js +10 -0
- data/vendor/node_modules/builtin-modules/package.json +40 -0
- data/vendor/node_modules/builtin-modules/static.js +2 -0
- data/vendor/node_modules/chalk/index.js +228 -0
- data/vendor/node_modules/chalk/package.json +66 -0
- data/vendor/node_modules/chalk/templates.js +128 -0
- data/vendor/node_modules/chalk/types/index.d.ts +97 -0
- data/vendor/node_modules/color-convert/conversions.js +861 -0
- data/vendor/node_modules/color-convert/index.js +78 -0
- data/vendor/node_modules/color-convert/package.json +46 -0
- data/vendor/node_modules/color-convert/route.js +97 -0
- data/vendor/node_modules/color-name/index.js +152 -0
- data/vendor/node_modules/color-name/package.json +25 -0
- data/vendor/node_modules/color-name/test.js +7 -0
- data/vendor/node_modules/date-time/index.js +33 -0
- data/vendor/node_modules/date-time/package.json +39 -0
- data/vendor/node_modules/escape-string-regexp/index.js +11 -0
- data/vendor/node_modules/escape-string-regexp/package.json +41 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.es.js +57 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.umd.js +68 -0
- data/vendor/node_modules/estree-walker/package.json +34 -0
- data/vendor/node_modules/estree-walker/src/estree-walker.js +51 -0
- data/vendor/node_modules/expand-brackets/index.js +163 -0
- data/vendor/node_modules/expand-brackets/package.json +62 -0
- data/vendor/node_modules/expand-range/index.js +43 -0
- data/vendor/node_modules/expand-range/package.json +73 -0
- data/vendor/node_modules/extglob/index.js +178 -0
- data/vendor/node_modules/extglob/package.json +60 -0
- data/vendor/node_modules/filename-regex/index.js +10 -0
- data/vendor/node_modules/filename-regex/package.json +50 -0
- data/vendor/node_modules/fill-range/index.js +408 -0
- data/vendor/node_modules/fill-range/package.json +61 -0
- data/vendor/node_modules/for-in/index.js +16 -0
- data/vendor/node_modules/for-in/package.json +68 -0
- data/vendor/node_modules/for-own/index.js +19 -0
- data/vendor/node_modules/for-own/package.json +70 -0
- data/vendor/node_modules/glob-base/index.js +51 -0
- data/vendor/node_modules/glob-base/package.json +52 -0
- data/vendor/node_modules/glob-parent/index.js +10 -0
- data/vendor/node_modules/glob-parent/package.json +35 -0
- data/vendor/node_modules/glob-parent/test.js +28 -0
- data/vendor/node_modules/has-flag/index.js +8 -0
- data/vendor/node_modules/has-flag/package.json +44 -0
- data/vendor/node_modules/irregular-plurals/irregular-plurals.json +146 -0
- data/vendor/node_modules/irregular-plurals/package.json +39 -0
- data/vendor/node_modules/is-buffer/index.js +21 -0
- data/vendor/node_modules/is-buffer/package.json +51 -0
- data/vendor/node_modules/is-dotfile/index.js +14 -0
- data/vendor/node_modules/is-dotfile/package.json +69 -0
- data/vendor/node_modules/is-equal-shallow/index.js +27 -0
- data/vendor/node_modules/is-equal-shallow/package.json +54 -0
- data/vendor/node_modules/is-extendable/index.js +13 -0
- data/vendor/node_modules/is-extendable/package.json +51 -0
- data/vendor/node_modules/is-extglob/index.js +11 -0
- data/vendor/node_modules/is-extglob/package.json +48 -0
- data/vendor/node_modules/is-glob/index.js +14 -0
- data/vendor/node_modules/is-glob/package.json +60 -0
- data/vendor/node_modules/is-module/index.js +11 -0
- data/vendor/node_modules/is-module/package.json +20 -0
- data/vendor/node_modules/is-number/index.js +19 -0
- data/vendor/node_modules/is-number/package.json +59 -0
- data/vendor/node_modules/is-posix-bracket/index.js +10 -0
- data/vendor/node_modules/is-posix-bracket/package.json +64 -0
- data/vendor/node_modules/is-primitive/index.js +13 -0
- data/vendor/node_modules/is-primitive/package.json +46 -0
- data/vendor/node_modules/is-reference/dist/is-reference.es.js +26 -0
- data/vendor/node_modules/is-reference/dist/is-reference.js +34 -0
- data/vendor/node_modules/is-reference/dist/types/index.d.ts +2 -0
- data/vendor/node_modules/is-reference/package.json +47 -0
- data/vendor/node_modules/isarray/index.js +5 -0
- data/vendor/node_modules/isarray/package.json +45 -0
- data/vendor/node_modules/isarray/test.js +20 -0
- data/vendor/node_modules/isobject/index.js +14 -0
- data/vendor/node_modules/isobject/package.json +67 -0
- data/vendor/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/locate-character/dist/locate-character.es.js +43 -0
- data/vendor/node_modules/locate-character/dist/locate-character.umd.js +54 -0
- data/vendor/node_modules/locate-character/dist/types/index.d.ts +17 -0
- data/vendor/node_modules/locate-character/package.json +41 -0
- data/vendor/node_modules/magic-string/dist/magic-string.cjs.js +1300 -0
- data/vendor/node_modules/magic-string/dist/magic-string.es.js +1296 -0
- data/vendor/node_modules/magic-string/dist/magic-string.umd.js +1352 -0
- data/vendor/node_modules/magic-string/index.d.ts +83 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/dist/vlq.js +91 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/package.json +27 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/src/vlq.js +78 -0
- data/vendor/node_modules/magic-string/package.json +55 -0
- data/vendor/node_modules/micromatch/index.js +431 -0
- data/vendor/node_modules/micromatch/lib/chars.js +67 -0
- data/vendor/node_modules/micromatch/lib/expand.js +304 -0
- data/vendor/node_modules/micromatch/lib/glob.js +193 -0
- data/vendor/node_modules/micromatch/lib/utils.js +149 -0
- data/vendor/node_modules/micromatch/package.json +114 -0
- data/vendor/node_modules/minimist/index.js +236 -0
- data/vendor/node_modules/minimist/package.json +45 -0
- data/vendor/node_modules/nodent-compiler/compiler.js +171 -0
- data/vendor/node_modules/nodent-compiler/lib/arboriculture.js +2694 -0
- data/vendor/node_modules/nodent-compiler/lib/output.js +934 -0
- data/vendor/node_modules/nodent-compiler/lib/parser.js +291 -0
- data/vendor/node_modules/nodent-compiler/package.json +37 -0
- data/vendor/node_modules/normalize-path/index.js +19 -0
- data/vendor/node_modules/normalize-path/package.json +78 -0
- data/vendor/node_modules/object.omit/index.js +40 -0
- data/vendor/node_modules/object.omit/package.json +67 -0
- data/vendor/node_modules/os-homedir/index.js +24 -0
- data/vendor/node_modules/os-homedir/package.json +41 -0
- data/vendor/node_modules/parse-glob/index.js +156 -0
- data/vendor/node_modules/parse-glob/package.json +62 -0
- data/vendor/node_modules/parse-ms/index.js +16 -0
- data/vendor/node_modules/parse-ms/package.json +34 -0
- data/vendor/node_modules/path-parse/index.js +93 -0
- data/vendor/node_modules/path-parse/index.min.js +1 -0
- data/vendor/node_modules/path-parse/package.json +33 -0
- data/vendor/node_modules/path-parse/test.js +77 -0
- data/vendor/node_modules/path-parse/test.min.js +1 -0
- data/vendor/node_modules/plur/index.js +20 -0
- data/vendor/node_modules/plur/package.json +42 -0
- data/vendor/node_modules/preserve/index.js +54 -0
- data/vendor/node_modules/preserve/package.json +48 -0
- data/vendor/node_modules/preserve/test.js +48 -0
- data/vendor/node_modules/pretty-ms/index.js +48 -0
- data/vendor/node_modules/pretty-ms/package.json +48 -0
- data/vendor/node_modules/randomatic/index.js +82 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/index.js +22 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/package.json +83 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/index.js +119 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/package.json +78 -0
- data/vendor/node_modules/regex-cache/index.js +68 -0
- data/vendor/node_modules/regex-cache/package.json +64 -0
- data/vendor/node_modules/remove-trailing-separator/index.js +17 -0
- data/vendor/node_modules/remove-trailing-separator/package.json +37 -0
- data/vendor/node_modules/repeat-element/index.js +18 -0
- data/vendor/node_modules/repeat-element/package.json +44 -0
- data/vendor/node_modules/repeat-string/index.js +70 -0
- data/vendor/node_modules/repeat-string/package.json +77 -0
- data/vendor/node_modules/require-relative/index.js +33 -0
- data/vendor/node_modules/require-relative/package.json +22 -0
- data/vendor/node_modules/resolve/index.js +8 -0
- data/vendor/node_modules/resolve/lib/async.js +203 -0
- data/vendor/node_modules/resolve/lib/caller.js +8 -0
- data/vendor/node_modules/resolve/lib/core.js +53 -0
- data/vendor/node_modules/resolve/lib/core.json +69 -0
- data/vendor/node_modules/resolve/lib/node-modules-paths.js +45 -0
- data/vendor/node_modules/resolve/lib/sync.js +93 -0
- data/vendor/node_modules/resolve/package.json +40 -0
- data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js +804 -0
- data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js +800 -0
- data/vendor/node_modules/rollup-plugin-commonjs/package.json +52 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/ast-utils.js +104 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/defaultResolver.js +39 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/helpers.js +19 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/index.js +198 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/transform.js +431 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/utils.js +13 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js +218 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es.js +214 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/package.json +51 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/src/empty.js +1 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/src/index.js +205 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.cjs.js +223 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es.js +214 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es6.js +217 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es.js +55 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es6.js +59 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.umd.js +65 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/package.json +33 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/src/estree-walker.js +49 -0
- data/vendor/node_modules/rollup-pluginutils/package.json +40 -0
- data/vendor/node_modules/rollup-pluginutils/src/addExtension.js +6 -0
- data/vendor/node_modules/rollup-pluginutils/src/attachScopes.js +147 -0
- data/vendor/node_modules/rollup-pluginutils/src/createFilter.js +33 -0
- data/vendor/node_modules/rollup-pluginutils/src/index.js +4 -0
- data/vendor/node_modules/rollup-pluginutils/src/makeLegalIdentifier.js +15 -0
- data/vendor/node_modules/rollup-pluginutils/src/utils/ensureArray.js +5 -0
- data/vendor/node_modules/rollup/bin/rollup +4085 -0
- data/vendor/node_modules/rollup/dist/rollup.browser.js +19829 -0
- data/vendor/node_modules/rollup/dist/rollup.es.js +23586 -0
- data/vendor/node_modules/rollup/dist/rollup.js +23597 -0
- data/vendor/node_modules/rollup/dist/typings/Chunk.d.ts +85 -0
- data/vendor/node_modules/rollup/dist/typings/ExternalModule.d.ts +30 -0
- data/vendor/node_modules/rollup/dist/typings/Graph.d.ts +47 -0
- data/vendor/node_modules/rollup/dist/typings/Module.d.ts +130 -0
- data/vendor/node_modules/rollup/dist/typings/ast/CallOptions.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/Entity.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/ExecutionPathOptions.d.ts +57 -0
- data/vendor/node_modules/rollup/dist/typings/ast/clone.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/ast/enhance.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/ast/keys.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayExpression.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayPattern.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrowFunctionExpression.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentPattern.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentProperty.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AwaitExpression.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BinaryExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BlockStatement.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BreakStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/CallExpression.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/CatchClause.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassBody.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassDeclaration.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassExpression.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ConditionalExpression.d.ts +28 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/DoWhileStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/EmptyStatement.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportAllDeclaration.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportDefaultDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportNamedDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportSpecifier.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExpressionStatement.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForInStatement.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForOfStatement.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForStatement.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionDeclaration.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionExpression.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Identifier.d.ts +29 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/IfStatement.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Import.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDeclaration.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDefaultSpecifier.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportNamespaceSpecifier.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportSpecifier.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/LabeledStatement.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Literal.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/LogicalExpression.d.ts +23 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/MemberExpression.d.ts +34 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/MethodDefinition.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/NewExpression.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/NodeType.d.ts +64 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectExpression.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectPattern.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Program.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Property.d.ts +30 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/RestElement.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ReturnStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SequenceExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SpreadElement.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchCase.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchStatement.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TaggedTemplateExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateElement.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateLiteral.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThisExpression.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThrowStatement.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnaryExpression.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnknownNode.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UpdateExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclarator.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/WhileStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/YieldExpression.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/index.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/ClassNode.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Expression.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/FunctionNode.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Node.d.ts +133 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Pattern.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/pureFunctions.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/BlockScope.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/CatchScope.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/FunctionScope.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/GlobalScope.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ModuleScope.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ParameterScope.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ReturnValueScope.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/Scope.d.ts +42 -0
- data/vendor/node_modules/rollup/dist/typings/ast/utils/extractNames.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/ast/values.d.ts +31 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ArgumentsVariable.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ExportDefaultVariable.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ExternalVariable.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/GlobalVariable.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/LocalVariable.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/NamespaceVariable.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ParameterVariable.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ReplaceableInitializationVariable.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ThisVariable.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/Variable.d.ts +43 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/VariableReassignmentTracker.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/amd.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/cjs.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/es.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/iife.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/index.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/esModuleExport.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getExportBlock.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getGlobalNameMaker.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getInteropBlock.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/sanitize.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/setupNamespace.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/trimEmptyImports.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/warnOnBuiltins.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/system.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/umd.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/node-entry.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/rollup/index.d.ts +167 -0
- data/vendor/node_modules/rollup/dist/typings/utils/callIfFunction.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/collapseSourcemaps.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/utils/commondir.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/defaults.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/deprecateOptions.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/ensureArray.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/utils/entryHashing.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/error.d.ts +18 -0
- data/vendor/node_modules/rollup/dist/typings/utils/first-sync.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/first.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/flushTime.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/utils/fs.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getCodeFrame.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getExportMode.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getIndentString.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/utils/identifierHelpers.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/mergeOptions.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/utils/object.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/utils/path.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/promise.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/utils/relativeId.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/renderHelpers.d.ts +26 -0
- data/vendor/node_modules/rollup/dist/typings/utils/sourceMappingURL.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/timers.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/utils/transform.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/utils/transformBundle.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/watch/chokidar.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/watch/fileWatchers.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/watch/index.d.ts +47 -0
- data/vendor/node_modules/rollup/package.json +122 -0
- data/vendor/node_modules/rollup/typings/package.json.d.ts +3 -0
- data/vendor/node_modules/signal-exit/index.js +157 -0
- data/vendor/node_modules/signal-exit/package.json +38 -0
- data/vendor/node_modules/signal-exit/signals.js +53 -0
- data/vendor/node_modules/source-map/dist/source-map.debug.js +3091 -0
- data/vendor/node_modules/source-map/dist/source-map.js +3090 -0
- data/vendor/node_modules/source-map/dist/source-map.min.js +2 -0
- data/vendor/node_modules/source-map/lib/array-set.js +121 -0
- data/vendor/node_modules/source-map/lib/base64-vlq.js +140 -0
- data/vendor/node_modules/source-map/lib/base64.js +67 -0
- data/vendor/node_modules/source-map/lib/binary-search.js +111 -0
- data/vendor/node_modules/source-map/lib/mapping-list.js +79 -0
- data/vendor/node_modules/source-map/lib/quick-sort.js +114 -0
- data/vendor/node_modules/source-map/lib/source-map-consumer.js +1082 -0
- data/vendor/node_modules/source-map/lib/source-map-generator.js +416 -0
- data/vendor/node_modules/source-map/lib/source-node.js +413 -0
- data/vendor/node_modules/source-map/lib/util.js +417 -0
- data/vendor/node_modules/source-map/package.json +72 -0
- data/vendor/node_modules/source-map/source-map.js +8 -0
- data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js +129 -0
- data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js +140 -0
- data/vendor/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
- data/vendor/node_modules/sourcemap-codec/package.json +52 -0
- data/vendor/node_modules/supports-color/browser.js +5 -0
- data/vendor/node_modules/supports-color/index.js +135 -0
- data/vendor/node_modules/supports-color/package.json +53 -0
- data/vendor/node_modules/time-zone/index.js +10 -0
- data/vendor/node_modules/time-zone/package.json +35 -0
- data/vendor/node_modules/vlq/dist/types/vlq.d.ts +2 -0
- data/vendor/node_modules/vlq/dist/vlq.es.js +64 -0
- data/vendor/node_modules/vlq/dist/vlq.js +75 -0
- data/vendor/node_modules/vlq/package.json +30 -0
- data/vendor/package.json +15 -0
- data/vendor/yarn.lock +453 -0
- metadata +641 -0
@@ -0,0 +1 @@
|
|
1
|
+
export default {};
|
@@ -0,0 +1,205 @@
|
|
1
|
+
import { dirname, resolve, extname, normalize, sep } from 'path';
|
2
|
+
import builtins from 'builtin-modules';
|
3
|
+
import resolveId from 'resolve';
|
4
|
+
import isModule from 'is-module';
|
5
|
+
import fs from 'fs';
|
6
|
+
|
7
|
+
const ES6_BROWSER_EMPTY = resolve( __dirname, '../src/empty.js' );
|
8
|
+
const CONSOLE_WARN = ( ...args ) => console.warn( ...args ); // eslint-disable-line no-console
|
9
|
+
const exts = [ '.js', '.json', '.node' ];
|
10
|
+
|
11
|
+
let readFileCache = {};
|
12
|
+
const readFileAsync = file => new Promise((fulfil, reject) => fs.readFile(file, (err, contents) => err ? reject(err) : fulfil(contents)));
|
13
|
+
const statAsync = file => new Promise((fulfil, reject) => fs.stat(file, (err, contents) => err ? reject(err) : fulfil(contents)));
|
14
|
+
function cachedReadFile (file, cb) {
|
15
|
+
if (file in readFileCache === false) {
|
16
|
+
readFileCache[file] = readFileAsync(file).catch(err => {
|
17
|
+
delete readFileCache[file];
|
18
|
+
throw err;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
readFileCache[file].then(contents => cb(null, contents), cb);
|
22
|
+
}
|
23
|
+
|
24
|
+
let isFileCache = {};
|
25
|
+
function cachedIsFile (file, cb) {
|
26
|
+
if (file in isFileCache === false) {
|
27
|
+
isFileCache[file] = statAsync(file)
|
28
|
+
.then(
|
29
|
+
stat => stat.isFile(),
|
30
|
+
err => {
|
31
|
+
if (err.code == 'ENOENT') return false;
|
32
|
+
delete isFileCache[file];
|
33
|
+
throw err;
|
34
|
+
});
|
35
|
+
}
|
36
|
+
isFileCache[file].then(contents => cb(null, contents), cb);
|
37
|
+
}
|
38
|
+
|
39
|
+
export default function nodeResolve ( options = {} ) {
|
40
|
+
const useModule = options.module !== false;
|
41
|
+
const useMain = options.main !== false;
|
42
|
+
const useJsnext = options.jsnext === true;
|
43
|
+
const isPreferBuiltinsSet = options.preferBuiltins === true || options.preferBuiltins === false;
|
44
|
+
const preferBuiltins = isPreferBuiltinsSet ? options.preferBuiltins : true;
|
45
|
+
const customResolveOptions = options.customResolveOptions || {};
|
46
|
+
const jail = options.jail;
|
47
|
+
const only = Array.isArray(options.only)
|
48
|
+
? options.only.map(o => o instanceof RegExp
|
49
|
+
? o
|
50
|
+
: new RegExp('^' + String(o).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&') + '$')
|
51
|
+
)
|
52
|
+
: null;
|
53
|
+
const browserMapCache = {};
|
54
|
+
|
55
|
+
const onwarn = options.onwarn || CONSOLE_WARN;
|
56
|
+
|
57
|
+
if ( options.skip ) {
|
58
|
+
throw new Error( 'options.skip is no longer supported — you should use the main Rollup `external` option instead' );
|
59
|
+
}
|
60
|
+
|
61
|
+
if ( !useModule && !useMain && !useJsnext ) {
|
62
|
+
throw new Error( `At least one of options.module, options.main or options.jsnext must be true` );
|
63
|
+
}
|
64
|
+
|
65
|
+
let preserveSymlinks;
|
66
|
+
|
67
|
+
return {
|
68
|
+
name: 'node-resolve',
|
69
|
+
|
70
|
+
options ( options ) {
|
71
|
+
preserveSymlinks = options.preserveSymlinks;
|
72
|
+
},
|
73
|
+
|
74
|
+
onwrite () {
|
75
|
+
isFileCache = {};
|
76
|
+
readFileCache = {};
|
77
|
+
},
|
78
|
+
|
79
|
+
resolveId ( importee, importer ) {
|
80
|
+
if ( /\0/.test( importee ) ) return null; // ignore IDs with null character, these belong to other plugins
|
81
|
+
|
82
|
+
// disregard entry module
|
83
|
+
if ( !importer ) return null;
|
84
|
+
|
85
|
+
if (options.browser && browserMapCache[importer]) {
|
86
|
+
const resolvedImportee = resolve( dirname( importer ), importee );
|
87
|
+
const browser = browserMapCache[importer];
|
88
|
+
if (browser[importee] === false || browser[resolvedImportee] === false) {
|
89
|
+
return ES6_BROWSER_EMPTY;
|
90
|
+
}
|
91
|
+
if (browser[importee] || browser[resolvedImportee] || browser[resolvedImportee + '.js'] || browser[resolvedImportee + '.json']) {
|
92
|
+
importee = browser[importee] || browser[resolvedImportee] || browser[resolvedImportee + '.js'] || browser[resolvedImportee + '.json'];
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
|
97
|
+
const parts = importee.split( /[/\\]/ );
|
98
|
+
let id = parts.shift();
|
99
|
+
|
100
|
+
if ( id[0] === '@' && parts.length ) {
|
101
|
+
// scoped packages
|
102
|
+
id += `/${parts.shift()}`;
|
103
|
+
} else if ( id[0] === '.' ) {
|
104
|
+
// an import relative to the parent dir of the importer
|
105
|
+
id = resolve( importer, '..', importee );
|
106
|
+
}
|
107
|
+
|
108
|
+
if (only && !only.some(pattern => pattern.test(id))) return null;
|
109
|
+
|
110
|
+
return new Promise( ( fulfil, reject ) => {
|
111
|
+
let disregardResult = false;
|
112
|
+
let packageBrowserField = false;
|
113
|
+
|
114
|
+
const resolveOptions = {
|
115
|
+
basedir: dirname( importer ),
|
116
|
+
packageFilter ( pkg, pkgPath ) {
|
117
|
+
const pkgRoot = dirname( pkgPath );
|
118
|
+
if (options.browser && typeof pkg[ 'browser' ] === 'object') {
|
119
|
+
packageBrowserField = Object.keys(pkg[ 'browser' ]).reduce((browser, key) => {
|
120
|
+
const resolved = pkg[ 'browser' ][ key ] === false ? false : resolve( pkgRoot, pkg[ 'browser' ][ key ] );
|
121
|
+
browser[ key ] = resolved;
|
122
|
+
if ( key[0] === '.' ) {
|
123
|
+
const absoluteKey = resolve( pkgRoot, key );
|
124
|
+
browser[ absoluteKey ] = resolved;
|
125
|
+
if ( !extname(key) ) {
|
126
|
+
exts.reduce( ( browser, ext ) => {
|
127
|
+
browser[ absoluteKey + ext ] = browser[ key ];
|
128
|
+
return browser;
|
129
|
+
}, browser );
|
130
|
+
}
|
131
|
+
}
|
132
|
+
return browser;
|
133
|
+
}, {});
|
134
|
+
}
|
135
|
+
|
136
|
+
if (options.browser && typeof pkg[ 'browser' ] === 'string') {
|
137
|
+
pkg[ 'main' ] = pkg[ 'browser' ];
|
138
|
+
} else if ( useModule && pkg[ 'module' ] ) {
|
139
|
+
pkg[ 'main' ] = pkg[ 'module' ];
|
140
|
+
} else if ( useJsnext && pkg[ 'jsnext:main' ] ) {
|
141
|
+
pkg[ 'main' ] = pkg[ 'jsnext:main' ];
|
142
|
+
} else if ( ( useJsnext || useModule ) && !useMain ) {
|
143
|
+
disregardResult = true;
|
144
|
+
}
|
145
|
+
return pkg;
|
146
|
+
},
|
147
|
+
readFile: cachedReadFile,
|
148
|
+
isFile: cachedIsFile,
|
149
|
+
extensions: options.extensions
|
150
|
+
};
|
151
|
+
|
152
|
+
if (preserveSymlinks !== undefined) {
|
153
|
+
resolveOptions.preserveSymlinks = preserveSymlinks;
|
154
|
+
}
|
155
|
+
|
156
|
+
resolveId(
|
157
|
+
importee,
|
158
|
+
Object.assign( resolveOptions, customResolveOptions ),
|
159
|
+
( err, resolved ) => {
|
160
|
+
if (options.browser && packageBrowserField) {
|
161
|
+
if (packageBrowserField[ resolved ]) {
|
162
|
+
resolved = packageBrowserField[ resolved ];
|
163
|
+
}
|
164
|
+
browserMapCache[resolved] = packageBrowserField;
|
165
|
+
}
|
166
|
+
|
167
|
+
if ( !disregardResult && !err ) {
|
168
|
+
if ( !preserveSymlinks && resolved && fs.existsSync( resolved ) ) {
|
169
|
+
resolved = fs.realpathSync( resolved );
|
170
|
+
}
|
171
|
+
|
172
|
+
if ( ~builtins.indexOf( resolved ) ) {
|
173
|
+
fulfil( null );
|
174
|
+
} else if ( ~builtins.indexOf( importee ) && preferBuiltins ) {
|
175
|
+
if ( !isPreferBuiltinsSet ) {
|
176
|
+
onwarn(
|
177
|
+
`preferring built-in module '${importee}' over local alternative ` +
|
178
|
+
`at '${resolved}', pass 'preferBuiltins: false' to disable this ` +
|
179
|
+
`behavior or 'preferBuiltins: true' to disable this warning`
|
180
|
+
);
|
181
|
+
}
|
182
|
+
fulfil( null );
|
183
|
+
} else if ( jail && resolved.indexOf( normalize( jail.trim( sep ) ) ) !== 0 ) {
|
184
|
+
fulfil( null );
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
if ( resolved && options.modulesOnly ) {
|
189
|
+
fs.readFile( resolved, 'utf-8', ( err, code ) => {
|
190
|
+
if ( err ) {
|
191
|
+
reject( err );
|
192
|
+
} else {
|
193
|
+
const valid = isModule( code );
|
194
|
+
fulfil( valid ? resolved : null );
|
195
|
+
}
|
196
|
+
});
|
197
|
+
} else {
|
198
|
+
fulfil( resolved );
|
199
|
+
}
|
200
|
+
}
|
201
|
+
);
|
202
|
+
});
|
203
|
+
}
|
204
|
+
};
|
205
|
+
}
|
@@ -0,0 +1,223 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
6
|
+
|
7
|
+
var path = require('path');
|
8
|
+
var estreeWalker = require('estree-walker');
|
9
|
+
var mm = _interopDefault(require('micromatch'));
|
10
|
+
|
11
|
+
function addExtension ( filename, ext ) {
|
12
|
+
if ( ext === void 0 ) ext = '.js';
|
13
|
+
|
14
|
+
if ( !path.extname( filename ) ) { filename += ext; }
|
15
|
+
return filename;
|
16
|
+
}
|
17
|
+
|
18
|
+
var blockDeclarations = {
|
19
|
+
'const': true,
|
20
|
+
'let': true
|
21
|
+
};
|
22
|
+
|
23
|
+
var extractors = {
|
24
|
+
Identifier: function Identifier ( names, param ) {
|
25
|
+
names.push( param.name );
|
26
|
+
},
|
27
|
+
|
28
|
+
ObjectPattern: function ObjectPattern ( names, param ) {
|
29
|
+
param.properties.forEach( function (prop) {
|
30
|
+
extractors[ prop.key.type ]( names, prop.key );
|
31
|
+
});
|
32
|
+
},
|
33
|
+
|
34
|
+
ArrayPattern: function ArrayPattern ( names, param ) {
|
35
|
+
param.elements.forEach( function (element) {
|
36
|
+
if ( element ) { extractors[ element.type ]( names, element ); }
|
37
|
+
});
|
38
|
+
},
|
39
|
+
|
40
|
+
RestElement: function RestElement ( names, param ) {
|
41
|
+
extractors[ param.argument.type ]( names, param.argument );
|
42
|
+
},
|
43
|
+
|
44
|
+
AssignmentPattern: function AssignmentPattern ( names, param ) {
|
45
|
+
return extractors[ param.left.type ]( names, param.left );
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
function extractNames ( param ) {
|
50
|
+
var names = [];
|
51
|
+
|
52
|
+
extractors[ param.type ]( names, param );
|
53
|
+
return names;
|
54
|
+
}
|
55
|
+
|
56
|
+
var Scope = function Scope ( options ) {
|
57
|
+
var this$1 = this;
|
58
|
+
|
59
|
+
options = options || {};
|
60
|
+
|
61
|
+
this.parent = options.parent;
|
62
|
+
this.isBlockScope = !!options.block;
|
63
|
+
|
64
|
+
this.declarations = Object.create( null );
|
65
|
+
|
66
|
+
if ( options.params ) {
|
67
|
+
options.params.forEach( function (param) {
|
68
|
+
extractNames( param ).forEach( function (name) {
|
69
|
+
this$1.declarations[ name ] = true;
|
70
|
+
});
|
71
|
+
});
|
72
|
+
}
|
73
|
+
};
|
74
|
+
|
75
|
+
Scope.prototype.addDeclaration = function addDeclaration ( node, isBlockDeclaration, isVar ) {
|
76
|
+
var this$1 = this;
|
77
|
+
|
78
|
+
if ( !isBlockDeclaration && this.isBlockScope ) {
|
79
|
+
// it's a `var` or function node, and this
|
80
|
+
// is a block scope, so we need to go up
|
81
|
+
this.parent.addDeclaration( node, isBlockDeclaration, isVar );
|
82
|
+
} else {
|
83
|
+
extractNames( node.id ).forEach( function (name) {
|
84
|
+
this$1.declarations[ name ] = true;
|
85
|
+
});
|
86
|
+
}
|
87
|
+
};
|
88
|
+
|
89
|
+
Scope.prototype.contains = function contains ( name ) {
|
90
|
+
return this.declarations[ name ] ||
|
91
|
+
( this.parent ? this.parent.contains( name ) : false );
|
92
|
+
};
|
93
|
+
|
94
|
+
|
95
|
+
function attachScopes ( ast, propertyName ) {
|
96
|
+
if ( propertyName === void 0 ) propertyName = 'scope';
|
97
|
+
|
98
|
+
var scope = new Scope();
|
99
|
+
|
100
|
+
estreeWalker.walk( ast, {
|
101
|
+
enter: function enter ( node, parent ) {
|
102
|
+
// function foo () {...}
|
103
|
+
// class Foo {...}
|
104
|
+
if ( /(Function|Class)Declaration/.test( node.type ) ) {
|
105
|
+
scope.addDeclaration( node, false, false );
|
106
|
+
}
|
107
|
+
|
108
|
+
// var foo = 1
|
109
|
+
if ( node.type === 'VariableDeclaration' ) {
|
110
|
+
var isBlockDeclaration = blockDeclarations[ node.kind ];
|
111
|
+
|
112
|
+
node.declarations.forEach( function (declaration) {
|
113
|
+
scope.addDeclaration( declaration, isBlockDeclaration, true );
|
114
|
+
});
|
115
|
+
}
|
116
|
+
|
117
|
+
var newScope;
|
118
|
+
|
119
|
+
// create new function scope
|
120
|
+
if ( /Function/.test( node.type ) ) {
|
121
|
+
newScope = new Scope({
|
122
|
+
parent: scope,
|
123
|
+
block: false,
|
124
|
+
params: node.params
|
125
|
+
});
|
126
|
+
|
127
|
+
// named function expressions - the name is considered
|
128
|
+
// part of the function's scope
|
129
|
+
if ( node.type === 'FunctionExpression' && node.id ) {
|
130
|
+
newScope.addDeclaration( node, false, false );
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
// create new block scope
|
135
|
+
if ( node.type === 'BlockStatement' && !/Function/.test( parent.type ) ) {
|
136
|
+
newScope = new Scope({
|
137
|
+
parent: scope,
|
138
|
+
block: true
|
139
|
+
});
|
140
|
+
}
|
141
|
+
|
142
|
+
// catch clause has its own block scope
|
143
|
+
if ( node.type === 'CatchClause' ) {
|
144
|
+
newScope = new Scope({
|
145
|
+
parent: scope,
|
146
|
+
params: [ node.param ],
|
147
|
+
block: true
|
148
|
+
});
|
149
|
+
}
|
150
|
+
|
151
|
+
if ( newScope ) {
|
152
|
+
Object.defineProperty( node, propertyName, {
|
153
|
+
value: newScope,
|
154
|
+
configurable: true
|
155
|
+
});
|
156
|
+
|
157
|
+
scope = newScope;
|
158
|
+
}
|
159
|
+
},
|
160
|
+
leave: function leave ( node ) {
|
161
|
+
if ( node[ propertyName ] ) { scope = scope.parent; }
|
162
|
+
}
|
163
|
+
});
|
164
|
+
|
165
|
+
return scope;
|
166
|
+
}
|
167
|
+
|
168
|
+
function ensureArray ( thing ) {
|
169
|
+
if ( Array.isArray( thing ) ) { return thing; }
|
170
|
+
if ( thing == undefined ) { return []; }
|
171
|
+
return [ thing ];
|
172
|
+
}
|
173
|
+
|
174
|
+
function createFilter ( include, exclude ) {
|
175
|
+
var getMatcher = function (id) { return ( isRegexp( id ) ? id : { test: mm.matcher( path.resolve( id ) ) } ); };
|
176
|
+
include = ensureArray( include ).map( getMatcher );
|
177
|
+
exclude = ensureArray( exclude ).map( getMatcher );
|
178
|
+
|
179
|
+
return function ( id ) {
|
180
|
+
|
181
|
+
if ( typeof id !== 'string' ) { return false; }
|
182
|
+
if ( /\0/.test( id ) ) { return false; }
|
183
|
+
|
184
|
+
id = id.split( path.sep ).join( '/' );
|
185
|
+
|
186
|
+
for ( var i = 0; i < exclude.length; ++i ) {
|
187
|
+
var matcher = exclude[i];
|
188
|
+
if ( matcher.test( id ) ) { return false; }
|
189
|
+
}
|
190
|
+
|
191
|
+
for ( var i$1 = 0; i$1 < include.length; ++i$1 ) {
|
192
|
+
var matcher$1 = include[i$1];
|
193
|
+
if ( matcher$1.test( id ) ) { return true; }
|
194
|
+
}
|
195
|
+
|
196
|
+
return !include.length;
|
197
|
+
};
|
198
|
+
}
|
199
|
+
|
200
|
+
function isRegexp ( val ) {
|
201
|
+
return val instanceof RegExp;
|
202
|
+
}
|
203
|
+
|
204
|
+
var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split( ' ' );
|
205
|
+
var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split( ' ' );
|
206
|
+
|
207
|
+
var blacklisted = Object.create( null );
|
208
|
+
reservedWords.concat( builtins ).forEach( function (word) { return blacklisted[ word ] = true; } );
|
209
|
+
|
210
|
+
function makeLegalIdentifier ( str ) {
|
211
|
+
str = str
|
212
|
+
.replace( /-(\w)/g, function ( _, letter ) { return letter.toUpperCase(); } )
|
213
|
+
.replace( /[^$_a-zA-Z0-9]/g, '_' );
|
214
|
+
|
215
|
+
if ( /\d/.test( str[0] ) || blacklisted[ str ] ) { str = "_" + str; }
|
216
|
+
|
217
|
+
return str;
|
218
|
+
}
|
219
|
+
|
220
|
+
exports.addExtension = addExtension;
|
221
|
+
exports.attachScopes = attachScopes;
|
222
|
+
exports.createFilter = createFilter;
|
223
|
+
exports.makeLegalIdentifier = makeLegalIdentifier;
|
@@ -0,0 +1,214 @@
|
|
1
|
+
import { extname, resolve, sep } from 'path';
|
2
|
+
import { walk } from 'estree-walker';
|
3
|
+
import mm from 'micromatch';
|
4
|
+
|
5
|
+
function addExtension ( filename, ext ) {
|
6
|
+
if ( ext === void 0 ) ext = '.js';
|
7
|
+
|
8
|
+
if ( !extname( filename ) ) { filename += ext; }
|
9
|
+
return filename;
|
10
|
+
}
|
11
|
+
|
12
|
+
var blockDeclarations = {
|
13
|
+
'const': true,
|
14
|
+
'let': true
|
15
|
+
};
|
16
|
+
|
17
|
+
var extractors = {
|
18
|
+
Identifier: function Identifier ( names, param ) {
|
19
|
+
names.push( param.name );
|
20
|
+
},
|
21
|
+
|
22
|
+
ObjectPattern: function ObjectPattern ( names, param ) {
|
23
|
+
param.properties.forEach( function (prop) {
|
24
|
+
extractors[ prop.key.type ]( names, prop.key );
|
25
|
+
});
|
26
|
+
},
|
27
|
+
|
28
|
+
ArrayPattern: function ArrayPattern ( names, param ) {
|
29
|
+
param.elements.forEach( function (element) {
|
30
|
+
if ( element ) { extractors[ element.type ]( names, element ); }
|
31
|
+
});
|
32
|
+
},
|
33
|
+
|
34
|
+
RestElement: function RestElement ( names, param ) {
|
35
|
+
extractors[ param.argument.type ]( names, param.argument );
|
36
|
+
},
|
37
|
+
|
38
|
+
AssignmentPattern: function AssignmentPattern ( names, param ) {
|
39
|
+
return extractors[ param.left.type ]( names, param.left );
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
function extractNames ( param ) {
|
44
|
+
var names = [];
|
45
|
+
|
46
|
+
extractors[ param.type ]( names, param );
|
47
|
+
return names;
|
48
|
+
}
|
49
|
+
|
50
|
+
var Scope = function Scope ( options ) {
|
51
|
+
var this$1 = this;
|
52
|
+
|
53
|
+
options = options || {};
|
54
|
+
|
55
|
+
this.parent = options.parent;
|
56
|
+
this.isBlockScope = !!options.block;
|
57
|
+
|
58
|
+
this.declarations = Object.create( null );
|
59
|
+
|
60
|
+
if ( options.params ) {
|
61
|
+
options.params.forEach( function (param) {
|
62
|
+
extractNames( param ).forEach( function (name) {
|
63
|
+
this$1.declarations[ name ] = true;
|
64
|
+
});
|
65
|
+
});
|
66
|
+
}
|
67
|
+
};
|
68
|
+
|
69
|
+
Scope.prototype.addDeclaration = function addDeclaration ( node, isBlockDeclaration, isVar ) {
|
70
|
+
var this$1 = this;
|
71
|
+
|
72
|
+
if ( !isBlockDeclaration && this.isBlockScope ) {
|
73
|
+
// it's a `var` or function node, and this
|
74
|
+
// is a block scope, so we need to go up
|
75
|
+
this.parent.addDeclaration( node, isBlockDeclaration, isVar );
|
76
|
+
} else {
|
77
|
+
extractNames( node.id ).forEach( function (name) {
|
78
|
+
this$1.declarations[ name ] = true;
|
79
|
+
});
|
80
|
+
}
|
81
|
+
};
|
82
|
+
|
83
|
+
Scope.prototype.contains = function contains ( name ) {
|
84
|
+
return this.declarations[ name ] ||
|
85
|
+
( this.parent ? this.parent.contains( name ) : false );
|
86
|
+
};
|
87
|
+
|
88
|
+
|
89
|
+
function attachScopes ( ast, propertyName ) {
|
90
|
+
if ( propertyName === void 0 ) propertyName = 'scope';
|
91
|
+
|
92
|
+
var scope = new Scope();
|
93
|
+
|
94
|
+
walk( ast, {
|
95
|
+
enter: function enter ( node, parent ) {
|
96
|
+
// function foo () {...}
|
97
|
+
// class Foo {...}
|
98
|
+
if ( /(Function|Class)Declaration/.test( node.type ) ) {
|
99
|
+
scope.addDeclaration( node, false, false );
|
100
|
+
}
|
101
|
+
|
102
|
+
// var foo = 1
|
103
|
+
if ( node.type === 'VariableDeclaration' ) {
|
104
|
+
var isBlockDeclaration = blockDeclarations[ node.kind ];
|
105
|
+
|
106
|
+
node.declarations.forEach( function (declaration) {
|
107
|
+
scope.addDeclaration( declaration, isBlockDeclaration, true );
|
108
|
+
});
|
109
|
+
}
|
110
|
+
|
111
|
+
var newScope;
|
112
|
+
|
113
|
+
// create new function scope
|
114
|
+
if ( /Function/.test( node.type ) ) {
|
115
|
+
newScope = new Scope({
|
116
|
+
parent: scope,
|
117
|
+
block: false,
|
118
|
+
params: node.params
|
119
|
+
});
|
120
|
+
|
121
|
+
// named function expressions - the name is considered
|
122
|
+
// part of the function's scope
|
123
|
+
if ( node.type === 'FunctionExpression' && node.id ) {
|
124
|
+
newScope.addDeclaration( node, false, false );
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
// create new block scope
|
129
|
+
if ( node.type === 'BlockStatement' && !/Function/.test( parent.type ) ) {
|
130
|
+
newScope = new Scope({
|
131
|
+
parent: scope,
|
132
|
+
block: true
|
133
|
+
});
|
134
|
+
}
|
135
|
+
|
136
|
+
// catch clause has its own block scope
|
137
|
+
if ( node.type === 'CatchClause' ) {
|
138
|
+
newScope = new Scope({
|
139
|
+
parent: scope,
|
140
|
+
params: [ node.param ],
|
141
|
+
block: true
|
142
|
+
});
|
143
|
+
}
|
144
|
+
|
145
|
+
if ( newScope ) {
|
146
|
+
Object.defineProperty( node, propertyName, {
|
147
|
+
value: newScope,
|
148
|
+
configurable: true
|
149
|
+
});
|
150
|
+
|
151
|
+
scope = newScope;
|
152
|
+
}
|
153
|
+
},
|
154
|
+
leave: function leave ( node ) {
|
155
|
+
if ( node[ propertyName ] ) { scope = scope.parent; }
|
156
|
+
}
|
157
|
+
});
|
158
|
+
|
159
|
+
return scope;
|
160
|
+
}
|
161
|
+
|
162
|
+
function ensureArray ( thing ) {
|
163
|
+
if ( Array.isArray( thing ) ) { return thing; }
|
164
|
+
if ( thing == undefined ) { return []; }
|
165
|
+
return [ thing ];
|
166
|
+
}
|
167
|
+
|
168
|
+
function createFilter ( include, exclude ) {
|
169
|
+
var getMatcher = function (id) { return ( isRegexp( id ) ? id : { test: mm.matcher( resolve( id ) ) } ); };
|
170
|
+
include = ensureArray( include ).map( getMatcher );
|
171
|
+
exclude = ensureArray( exclude ).map( getMatcher );
|
172
|
+
|
173
|
+
return function ( id ) {
|
174
|
+
|
175
|
+
if ( typeof id !== 'string' ) { return false; }
|
176
|
+
if ( /\0/.test( id ) ) { return false; }
|
177
|
+
|
178
|
+
id = id.split( sep ).join( '/' );
|
179
|
+
|
180
|
+
for ( var i = 0; i < exclude.length; ++i ) {
|
181
|
+
var matcher = exclude[i];
|
182
|
+
if ( matcher.test( id ) ) { return false; }
|
183
|
+
}
|
184
|
+
|
185
|
+
for ( var i$1 = 0; i$1 < include.length; ++i$1 ) {
|
186
|
+
var matcher$1 = include[i$1];
|
187
|
+
if ( matcher$1.test( id ) ) { return true; }
|
188
|
+
}
|
189
|
+
|
190
|
+
return !include.length;
|
191
|
+
};
|
192
|
+
}
|
193
|
+
|
194
|
+
function isRegexp ( val ) {
|
195
|
+
return val instanceof RegExp;
|
196
|
+
}
|
197
|
+
|
198
|
+
var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split( ' ' );
|
199
|
+
var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split( ' ' );
|
200
|
+
|
201
|
+
var blacklisted = Object.create( null );
|
202
|
+
reservedWords.concat( builtins ).forEach( function (word) { return blacklisted[ word ] = true; } );
|
203
|
+
|
204
|
+
function makeLegalIdentifier ( str ) {
|
205
|
+
str = str
|
206
|
+
.replace( /-(\w)/g, function ( _, letter ) { return letter.toUpperCase(); } )
|
207
|
+
.replace( /[^$_a-zA-Z0-9]/g, '_' );
|
208
|
+
|
209
|
+
if ( /\d/.test( str[0] ) || blacklisted[ str ] ) { str = "_" + str; }
|
210
|
+
|
211
|
+
return str;
|
212
|
+
}
|
213
|
+
|
214
|
+
export { addExtension, attachScopes, createFilter, makeLegalIdentifier };
|