From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- .../babel-plugin-dynamic-import-node/.babelrc | 5 ++ .../babel-plugin-dynamic-import-node/.editorconfig | 20 +++++++ .../babel-plugin-dynamic-import-node/.eslintignore | 2 + .../babel-plugin-dynamic-import-node/.eslintrc | 5 ++ .../babel-plugin-dynamic-import-node/.travis.yml | 42 ++++++++++++++ .../babel-plugin-dynamic-import-node/CHANGELOG.md | 31 +++++++++++ .../babel-plugin-dynamic-import-node/LICENSE | 21 +++++++ .../babel-plugin-dynamic-import-node/README.md | 37 ++++++++++++ .../babel-plugin-dynamic-import-node/lib/index.js | 38 +++++++++++++ .../babel-plugin-dynamic-import-node/package.json | 65 ++++++++++++++++++++++ 10 files changed, 266 insertions(+) create mode 100644 node_modules/babel-plugin-dynamic-import-node/.babelrc create mode 100644 node_modules/babel-plugin-dynamic-import-node/.editorconfig create mode 100644 node_modules/babel-plugin-dynamic-import-node/.eslintignore create mode 100644 node_modules/babel-plugin-dynamic-import-node/.eslintrc create mode 100644 node_modules/babel-plugin-dynamic-import-node/.travis.yml create mode 100644 node_modules/babel-plugin-dynamic-import-node/CHANGELOG.md create mode 100644 node_modules/babel-plugin-dynamic-import-node/LICENSE create mode 100644 node_modules/babel-plugin-dynamic-import-node/README.md create mode 100644 node_modules/babel-plugin-dynamic-import-node/lib/index.js create mode 100644 node_modules/babel-plugin-dynamic-import-node/package.json (limited to 'node_modules/babel-plugin-dynamic-import-node') diff --git a/node_modules/babel-plugin-dynamic-import-node/.babelrc b/node_modules/babel-plugin-dynamic-import-node/.babelrc new file mode 100644 index 00000000..b96ead2b --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "airbnb" + ], +} diff --git a/node_modules/babel-plugin-dynamic-import-node/.editorconfig b/node_modules/babel-plugin-dynamic-import-node/.editorconfig new file mode 100644 index 00000000..ac29adef --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/babel-plugin-dynamic-import-node/.eslintignore b/node_modules/babel-plugin-dynamic-import-node/.eslintignore new file mode 100644 index 00000000..051cd482 --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/.eslintignore @@ -0,0 +1,2 @@ +test/fixtures +lib/ diff --git a/node_modules/babel-plugin-dynamic-import-node/.eslintrc b/node_modules/babel-plugin-dynamic-import-node/.eslintrc new file mode 100644 index 00000000..391ada0a --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/.eslintrc @@ -0,0 +1,5 @@ +{ + "parser": "babel-eslint", + "extends": "airbnb-base", + "root": true +} diff --git a/node_modules/babel-plugin-dynamic-import-node/.travis.yml b/node_modules/babel-plugin-dynamic-import-node/.travis.yml new file mode 100644 index 00000000..64e195a6 --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/.travis.yml @@ -0,0 +1,42 @@ +language: node_js +os: + - linux +node_js: + - "9" + - "8" + - "7" + - "6" + - "5" + - "4" + - "iojs-v3" + - "iojs-v2" + - "iojs-v1" + - "0.12" +before_install: + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + allow_failures: + - node_js: "9" + - node_js: "7" + - node_js: "5" + - node_js: "iojs-v3" + - node_js: "iojs-v2" + - node_js: "iojs-v1" + - node_js: "0.12" + - os: osx + - env: TEST=true ALLOW_FAILURE=true + - env: COVERAGE=true diff --git a/node_modules/babel-plugin-dynamic-import-node/CHANGELOG.md b/node_modules/babel-plugin-dynamic-import-node/CHANGELOG.md new file mode 100644 index 00000000..eb94057d --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/CHANGELOG.md @@ -0,0 +1,31 @@ +## Unreleased + +## v1.2.0 +- [New] support comments (#37) +- [Refactor] Use template and types from the babel object (#32) +- [Tests] on `node` `v9`; pin included builds to LTS +- [Dev Deps] update `eslint`, `eslint-config-airbnb-base`, `mocha`, `rimraf` + +## v1.1.0 +- Visit Import nodes instead of CallExpressions (#30) +- [Deps] update `babel-template`, `babel-types` +- [Dev Deps] update `airbnb-js-shims`, `babel-cli`, `babel-core`, `babel-preset-airbnb`, `babel-register`, `chai`, `eslint`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `mocha` +- [Tests] on `node` `v8` +- [Tests] use `nvm install-latest-npm` so newer npm doesn’t break older node + +## v1.0.2 +- [Fix] Ensure it works with the ES2015 preset too (#12, #16) +- [Deps] update `babel-template`, `babel-types` +- [Dev Deps] update `babel-cli`, `babel-core`, `babel-eslint`, `babel-register`, `eslint`, `eslint-config-airbnb-base`, `mocha` + +## v1.0.1 +- [Fix] Move `in-publish` to devDeps (#11) +- [Fix] ensure dynamic `import()` input is properly stringified (#2) +- [Fix] async timing of dynamic import to match spec (#3) +- [Fix] Remove spaces in template strings and update Babel (#10) +- [Deps] update `babel-template`, `babel-types` +- [Deps] update `babel-types` (#4, #5, #6) +- [Dev Deps] update `babel-cli`, `babel-core`, `babel-eslint`, `babel-register`, `eslint`, `eslint-config-airbnb-base`, `eslint-plugin-import`, `mocha`, `rimraf` + +## v1.0.0 +- Initial full release. diff --git a/node_modules/babel-plugin-dynamic-import-node/LICENSE b/node_modules/babel-plugin-dynamic-import-node/LICENSE new file mode 100644 index 00000000..87081c13 --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Airbnb + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/babel-plugin-dynamic-import-node/README.md b/node_modules/babel-plugin-dynamic-import-node/README.md new file mode 100644 index 00000000..273327d0 --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/README.md @@ -0,0 +1,37 @@ +# babel-plugin-dynamic-import-node + +Babel plugin to transpile `import()` to a deferred `require()`, for node. Matches the [proposed spec](https://github.com/domenic/proposal-import-function). + +**NOTE:** Babylon >= v6.12.0 is required to correct parse dynamic imports. + +## Installation + +```sh +$ npm install babel-plugin-dynamic-import-node --save-dev +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```json +{ + "plugins": ["dynamic-import-node"] +} +``` + +### Via CLI + +```sh +$ babel --plugins dynamic-import-node script.js +``` + +### Via Node API + +```javascript +require('babel-core').transform('code', { + plugins: ['dynamic-import-node'] +}); +``` diff --git a/node_modules/babel-plugin-dynamic-import-node/lib/index.js b/node_modules/babel-plugin-dynamic-import-node/lib/index.js new file mode 100644 index 00000000..0254cc9d --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/lib/index.js @@ -0,0 +1,38 @@ +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports['default'] = function (_ref) { + var template = _ref.template, + t = _ref.types; + + var buildImport = template('\n Promise.resolve().then(() => require(SOURCE))\n '); + + return { + inherits: _babelPluginSyntaxDynamicImport2['default'], + + visitor: { + Import: function () { + function Import(path) { + var importArguments = path.parentPath.node.arguments; + var isString = t.isStringLiteral(importArguments[0]) || t.isTemplateLiteral(importArguments[0]); + if (isString) { + t.removeComments(importArguments[0]); + } + var newImport = buildImport({ + SOURCE: isString ? importArguments : t.templateLiteral([t.templateElement({ raw: '', cooked: '' }), t.templateElement({ raw: '', cooked: '' }, true)], importArguments) + }); + path.parentPath.replaceWith(newImport); + } + + return Import; + }() + } + }; +}; + +var _babelPluginSyntaxDynamicImport = require('babel-plugin-syntax-dynamic-import'); + +var _babelPluginSyntaxDynamicImport2 = _interopRequireDefault(_babelPluginSyntaxDynamicImport); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } \ No newline at end of file diff --git a/node_modules/babel-plugin-dynamic-import-node/package.json b/node_modules/babel-plugin-dynamic-import-node/package.json new file mode 100644 index 00000000..b1c22cf1 --- /dev/null +++ b/node_modules/babel-plugin-dynamic-import-node/package.json @@ -0,0 +1,65 @@ +{ + "name": "babel-plugin-dynamic-import-node", + "version": "1.2.0", + "description": "Babel plugin to transpile import() to a deferred require(), for node", + "main": "lib/index.js", + "directories": { + "test": "test" + }, + "scripts": { + "clean": "rimraf lib", + "prebuild": "npm run clean", + "build": "babel src --out-dir lib", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "mocha", + "lint": "eslint .", + "prepublish": "not-in-publish || (safe-publish-latest && npm run build)", + "check-changelog": "expr $(git status --porcelain 2>/dev/null| grep \"^\\s*M.*CHANGELOG.md\" | wc -l) >/dev/null || (echo 'Please edit CHANGELOG.md' && exit 1)", + "check-only-changelog-changed": "(expr $(git status --porcelain 2>/dev/null| grep -v \"CHANGELOG.md\" | wc -l) >/dev/null && echo 'Only CHANGELOG.md may have uncommitted changes' && exit 1) || exit 0", + "version:major": "npm --no-git-tag-version version major", + "version:minor": "npm --no-git-tag-version version minor", + "version:patch": "npm --no-git-tag-version version patch", + "postversion": "git commit package.json CHANGELOG.md -m \"v$npm_package_version\" && npm run tag && git push && git push --tags", + "preversion": "npm run test && npm run check-changelog && npm run check-only-changelog-changed", + "tag": "git tag v$npm_package_version" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/airbnb/babel-plugin-dynamic-import-node.git" + }, + "keywords": [ + "babel", + "plugin", + "dynamic", + "import", + "node" + ], + "author": "Jordan Gensler ", + "license": "MIT", + "bugs": { + "url": "https://github.com/airbnb/babel-plugin-dynamic-import-node/issues" + }, + "homepage": "https://github.com/airbnb/babel-plugin-dynamic-import-node#readme", + "devDependencies": { + "airbnb-js-shims": "^1.3.0", + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-eslint": "^7.2.3", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-preset-airbnb": "^2.4.0", + "babel-preset-es2015": "^6.24.1", + "babel-register": "^6.26.0", + "chai": "^4.1.2", + "eslint": "^4.11.0", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-plugin-import": "^2.8.0", + "in-publish": "^2.0.0", + "mocha": "^3.5.3", + "rimraf": "^2.6.2", + "safe-publish-latest": "^1.1.1" + }, + "dependencies": { + "babel-plugin-syntax-dynamic-import": "^6.18.0" + } +} -- cgit v1.2.3