Izmjenjena struktura, dodan backand

This commit is contained in:
GotPPay
2017-10-16 11:19:46 +02:00
parent 1ec88afacb
commit 048e32c4aa
37153 changed files with 2975854 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
{
"presets": [
"airbnb"
],
}

View File

@@ -0,0 +1,2 @@
test/fixtures
lib/

View File

@@ -0,0 +1,5 @@
{
"parser": "babel-eslint",
"extends": "airbnb-base",
"root": true
}

View File

@@ -0,0 +1,2 @@
src/
test/

View File

@@ -0,0 +1,28 @@
language: node_js
node_js:
- "7"
- "6"
- "5"
- "4"
- "iojs-v3"
- "iojs-v2"
- "iojs-v1"
- "0.12"
before_install:
- 'npm install -g npm'
script:
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
sudo: false
env:
- TEST=true
matrix:
fast_finish: true
include:
- node_js: "node"
env: LINT=true
allow_failures:
- node_js: "iojs-v3"
- node_js: "iojs-v2"
- node_js: "iojs-v1"
- node_js: "0.12"

View File

@@ -0,0 +1,18 @@
## Unreleased
## 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.

View File

@@ -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.

View File

@@ -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']
});
```

View File

@@ -0,0 +1,45 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
var _babelTemplate = require('babel-template');
var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
var _babelPluginSyntaxDynamicImport = require('babel-plugin-syntax-dynamic-import');
var _babelPluginSyntaxDynamicImport2 = _interopRequireDefault(_babelPluginSyntaxDynamicImport);
var _babelTypes = require('babel-types');
var t = _interopRequireWildcard(_babelTypes);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var TYPE_IMPORT = 'Import';
var buildImport = (0, _babelTemplate2['default'])('\n Promise.resolve().then(() => require(SOURCE))\n');
exports['default'] = function () {
return {
inherits: _babelPluginSyntaxDynamicImport2['default'],
visitor: {
CallExpression: function () {
function CallExpression(path) {
if (path.node.callee.type === TYPE_IMPORT) {
var importArgument = path.node.arguments[0];
var newImport = buildImport({
SOURCE: t.isStringLiteral(importArgument) || t.isTemplateLiteral(importArgument) ? path.node.arguments : t.templateLiteral([t.templateElement({ raw: '', cooked: '' }), t.templateElement({ raw: '', cooked: '' }, true)], path.node.arguments)
});
path.replaceWith(newImport);
}
}
return CallExpression;
}()
}
};
};

View File

@@ -0,0 +1,92 @@
{
"_from": "babel-plugin-dynamic-import-node@1.0.2",
"_id": "babel-plugin-dynamic-import-node@1.0.2",
"_inBundle": false,
"_integrity": "sha1-rbW8j0iokxFUA5WunwzD7UsQuy4=",
"_location": "/babel-plugin-dynamic-import-node",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "babel-plugin-dynamic-import-node@1.0.2",
"name": "babel-plugin-dynamic-import-node",
"escapedName": "babel-plugin-dynamic-import-node",
"rawSpec": "1.0.2",
"saveSpec": null,
"fetchSpec": "1.0.2"
},
"_requiredBy": [
"/babel-preset-react-app"
],
"_resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-1.0.2.tgz",
"_shasum": "adb5bc8f48a89311540395ae9f0cc3ed4b10bb2e",
"_spec": "babel-plugin-dynamic-import-node@1.0.2",
"_where": "/home/bilal/Saburly/slucajna-televizija/node_modules/babel-preset-react-app",
"author": {
"name": "Jordan Gensler",
"email": "jordan.gensler@airbnb.com"
},
"bugs": {
"url": "https://github.com/airbnb/babel-plugin-dynamic-import-node/issues"
},
"bundleDependencies": false,
"dependencies": {
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-template": "^6.24.1",
"babel-types": "^6.24.1"
},
"deprecated": false,
"description": "Babel plugin to transpile import() to a deferred require(), for node",
"devDependencies": {
"airbnb-js-shims": "^1.1.1",
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-plugin-transform-es2015-template-literals": "^6.22.0",
"babel-preset-airbnb": "^2.2.3",
"babel-register": "^6.24.1",
"chai": "^3.5.0",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.1.3",
"eslint-plugin-import": "^2.2.0",
"in-publish": "^2.0.0",
"mocha": "^3.3.0",
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
},
"directories": {
"test": "test"
},
"homepage": "https://github.com/airbnb/babel-plugin-dynamic-import-node#readme",
"keywords": [
"babel",
"plugin",
"dynamic",
"import",
"node"
],
"license": "MIT",
"main": "lib/index.js",
"name": "babel-plugin-dynamic-import-node",
"repository": {
"type": "git",
"url": "git+https://github.com/airbnb/babel-plugin-dynamic-import-node.git"
},
"scripts": {
"build": "babel src --out-dir lib",
"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",
"clean": "rimraf lib",
"lint": "eslint .",
"postversion": "git commit package.json CHANGELOG.md -m \"v$npm_package_version\" && npm run tag && git push && git push --tags",
"prepublish": "in-publish && safe-publish-latest && npm run build || not-in-publish",
"preversion": "npm run test && npm run check-changelog && npm run check-only-changelog-changed",
"tag": "git tag v$npm_package_version",
"test": "npm run lint && npm run tests-only",
"tests-only": "mocha",
"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"
},
"version": "1.0.2"
}