From c9f262e2703ea5c03b6fc4e9bc32eb0b8e138662 Mon Sep 17 00:00:00 2001 From: ZSUU Date: Mon, 25 Sep 2017 21:17:18 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=BD=BF=E7=94=A8=20j?= =?UTF-8?q?sx=20=E6=97=B6=E6=8C=89=E9=9C=80=E5=8A=A0=E8=BD=BD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/core.js b/src/core.js index 4b2ff108..386df447 100644 --- a/src/core.js +++ b/src/core.js @@ -27,7 +27,7 @@ export default function (defaultLibraryName) { if (Array.isArray(opts)) { options = opts.find(option => moduleArr[methodName] === option.libraryName || - libraryObjs[methodName] === option.libraryName + libraryObjs[methodName] === option.libraryName ); // eslint-disable-line } options = options || opts; @@ -71,16 +71,16 @@ export default function (defaultLibraryName) { if (!cachePath[libraryName]) { const themeName = styleLibraryName.replace(/^~/, ''); cachePath[libraryName] = styleLibraryName.indexOf('~') === 0 - ? resolve(process.cwd(), themeName) - : `${libraryName}/${libDir}/${themeName}`; + ? resolve(process.cwd(), themeName) + : `${libraryName}/${libDir}/${themeName}`; } if (libraryObjs[methodName]) { /* istanbul ingore next */ if (cache[libraryName] === 2) { throw Error('[babel-plugin-component] If you are using both' + - 'on-demand and importing all, make sure to invoke the' + - ' importing all first.'); + 'on-demand and importing all, make sure to invoke the' + + ' importing all first.'); } path = `${cachePath[libraryName]}${_root || '/index'}.css`; cache[libraryName] = 1; @@ -128,7 +128,9 @@ export default function (defaultLibraryName) { function buildDeclaratorHandler(node, prop, path, opts) { const { file } = path.hub; - if (!types.isIdentifier(node[prop])) return; + + if (!types.isIdentifier(node[prop]) && !types.isJSXIdentifier(node[prop])) return + if (specified[node[prop].name]) { node[prop] = importMethod(node[prop].name, file, opts); // eslint-disable-line } @@ -230,6 +232,16 @@ export default function (defaultLibraryName) { buildDeclaratorHandler(node, 'init', path, opts); }, + JSXOpeningElement(path, { opts }) { + const { node } = path + buildDeclaratorHandler(node, 'name', path, opts) + }, + + JSXClosingElement(path, { opts }) { + const { node } = path + buildDeclaratorHandler(node, 'name', path, opts) + }, + LogicalExpression(path, { opts }) { const { node } = path; buildExpressionHandler(node, ['left', 'right'], path, opts); From ab040674bb0aae29a36e10544eab19bb817df04d Mon Sep 17 00:00:00 2001 From: ZSUU Date: Fri, 13 Oct 2017 20:20:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=9C=AC=E5=9C=B0=20d?= =?UTF-8?q?ebug=20=E6=A8=A1=E5=BC=8F=20=E7=9B=B4=E6=8E=A5=E5=9C=A8=20debug?= =?UTF-8?q?=20=E7=9B=AE=E5=BD=95=E4=B8=8B=E7=BC=96=E8=BE=91=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E4=BB=B6,=20=E4=BD=BF=E7=94=A8Chrome?= =?UTF-8?q?=E8=B0=83=E8=AF=95,=20=E6=9C=80=E5=90=8E=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 - .eslintrc | 6 -- .projectile | 17 ++++ README.org | 5 ++ debug/index.js | 28 +++++++ debug/origin/test.jsx | 24 ++++++ debug/origin/testUseInJsx_index.jsx | 24 ++++++ debug/output/output.js | 57 +++++++++++++ package.json | 119 ++++++++++++++-------------- src/index.js | 2 +- 10 files changed, 217 insertions(+), 66 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 .projectile create mode 100644 README.org create mode 100644 debug/index.js create mode 100644 debug/origin/test.jsx create mode 100644 debug/origin/testUseInJsx_index.jsx create mode 100644 debug/output/output.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 89767bb0..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/*/__tests__ diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 4320ecae..00000000 --- a/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "eslint-config-airbnb/base", - "rules": { - "no-console": [0] - } -} diff --git a/.projectile b/.projectile new file mode 100644 index 00000000..57ac26e7 --- /dev/null +++ b/.projectile @@ -0,0 +1,17 @@ +;; projectile configure file +;; - means ignore this pattern, must has a leading "/", using the regexp rule. +;; + means add this subdir, it will block the root dir. +-/GTAGS$ +-/GPATH$ +-/GRTAGS$ +-/.*.svn +-/.*.git +-/icons +-/.*images/ +-/.*imgs/ +-/.*image/ +-/libs/encoding +-/.*.dll$ +-/node_modules +-/coverage +-/test \ No newline at end of file diff --git a/README.org b/README.org new file mode 100644 index 00000000..43b8af92 --- /dev/null +++ b/README.org @@ -0,0 +1,5 @@ +* TEST +istanbul -> macha -> "./test/index-test.js" -> babel + plugin("./src/index.js") -> debugcase +* DEBUG +test/index-test.js" -> babel + plugin("./src/index.js") -> debugcase + diff --git a/debug/index.js b/debug/index.js new file mode 100644 index 00000000..3575e62f --- /dev/null +++ b/debug/index.js @@ -0,0 +1,28 @@ +import { transformFileSync } from 'babel-core' +import { join } from 'path' +import { writeFileSync } from 'fs' +import plugin from '../src/index' + +let originFile = join(__dirname, 'origin', 'test.jsx') +let outputFile = join(__dirname, 'output', 'output.js') + +let outputText = transformFileSync(originFile, { + "presets": [ + ["env", { + "targets": { + "browsers": ["last 2 versions", "safari >= 7", "ie >= 10"] + } + }] + ], + "plugins": [ + ["transform-vue-jsx"], + [plugin, [ + { + "libraryName": "element-ui", + "styleLibraryName": "theme-default" + } + ]] + ] +}).code + +writeFileSync(outputFile, outputText) \ No newline at end of file diff --git a/debug/origin/test.jsx b/debug/origin/test.jsx new file mode 100644 index 00000000..f6a7dda0 --- /dev/null +++ b/debug/origin/test.jsx @@ -0,0 +1,24 @@ +import { Button as MyBu } from 'element-ui'; + +console.log(MyBu); + +const Bt2 = MyBu + +const LeftBar = { + data() { + return { + firstName: 'Wfghjfghjghjalter11', + lastName: 'ghjkhbnhWhitesdfghjkdfghjkl;', + alias: 'jkhkhhlkhHeisenberg' + }; + }, + render() { + console.log(MyBu); + let Bt = MyBu; + return (
+
{this.firstName}
+ ClickMe +
); + } +}; +export default LeftBar; diff --git a/debug/origin/testUseInJsx_index.jsx b/debug/origin/testUseInJsx_index.jsx new file mode 100644 index 00000000..243d4c6b --- /dev/null +++ b/debug/origin/testUseInJsx_index.jsx @@ -0,0 +1,24 @@ +import { Button } from 'element-ui'; + +console.log(Button); + +const Bt2 = Button + +const LeftBar = { + data() { + return { + firstName: 'Wfghjfghjghjalter11', + lastName: 'ghjkhbnhWhitesdfghjkdfghjkl;', + alias: 'jkhkhhlkhHeisenberg' + }; + }, + render() { + console.log(Button); + let Bt = Button; + return (
+
{this.firstName}
+ +
); + } +}; +export default LeftBar; diff --git a/debug/output/output.js b/debug/output/output.js new file mode 100644 index 00000000..37ab5b1f --- /dev/null +++ b/debug/output/output.js @@ -0,0 +1,57 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _myBu = require('antd/lib/my-bu'); + +var _myBu2 = _interopRequireDefault(_myBu); + +var _button = require('element-ui/lib/theme-default/button.css'); + +var _button2 = _interopRequireDefault(_button); + +var _base = require('element-ui/lib/theme-default/base.css'); + +var _base2 = _interopRequireDefault(_base); + +var _button3 = require('element-ui/lib/button'); + +var _button4 = _interopRequireDefault(_button3); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +console.log(_button4.default); + +var Bt2 = _myBu2.default; + +var LeftBar = { + data: function data() { + return { + firstName: 'Wfghjfghjghjalter11', + lastName: 'ghjkhbnhWhitesdfghjkdfghjkl;', + alias: 'jkhkhhlkhHeisenberg' + }; + }, + render: function render() { + var h = arguments[0]; + + console.log(_button4.default); + var Bt = _myBu2.default; + return h( + 'div', + null, + [h( + 'div', + null, + [' ', this.firstName, ' '] + ), h( + _myBu2.default, + null, + ['ClickMe'] + )] + ); + } +}; +exports.default = LeftBar; \ No newline at end of file diff --git a/package.json b/package.json index 8a21cad3..96364330 100644 --- a/package.json +++ b/package.json @@ -1,62 +1,65 @@ { - "name": "babel-plugin-component", - "version": "0.10.1", - "description": "Modular build plugin for babel.", - "main": "lib/index.js", - "scripts": { - "build": "rm -rf lib && babel src --out-dir lib --ignore __tests__", - "test": "babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha --no-timeouts", - "debug": "mocha --require babel-core/register --require babel-polyfill --no-timeouts", - "lint": "eslint --ext .js src", - "coveralls": "cat ./coverage/lcov.info | coveralls", - "prepublish": "npm run build" - }, - "pre-commit": [ - "lint" - ], - "keywords": [ - "babel-plugin" - ], - "author": [ - "chencheng ", - "qingwei-li " - ], - "license": "MIT", - "devDependencies": { - "babel-cli": "^6.3.13", - "babel-core": "^6.7.4", - "babel-istanbul": "^0.7.0", - "babel-plugin-add-module-exports": "^0.1.2", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", - "babel-preset-stage-0": "^6.3.13", - "coveralls": "^2.11.6", - "eslint": "^2.7.0", - "eslint-config-airbnb": "^6.2.0", - "expect": "^1.13.4", - "mocha": "^2.3.4", - "pre-commit": "~1.1.2" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/qingwei-li/babel-plugin-component.git" - }, - "homepage": "https://github.com/qingwei-li/babel-plugin-component#readme", - "bugs": { - "url": "https://github.com/qingwei-li/babel-plugin-component/issues" - }, - "babel": { - "presets": [ - "es2015", - "stage-0" + "name": "babel-plugin-import-vue", + "version": "0.0.1", + "description": "Modular build plugin for babel. compatible with element and so on", + "main": "lib/index.js", + "scripts": { + "build": "rimraf lib && babel src --out-dir lib --ignore __tests__", + "debug": "node --inspect-brk --require ./node_modules/babel-core/register.js ./debug/index.js", + "testalls": "babel-node node_modules/babel-istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha --no-timeouts", + "debugalls": "mocha --require babel-core/register --require babel-polyfill --no-timeouts", + "coveralls": "cat ./coverage/lcov.info | coveralls" + }, + "keywords": [ + "babel-plugin", + "vue", + "element", + "babel-plugin-import" ], - "plugins": [ - "add-module-exports" + "author": [ + "chencheng ", + "qingwei-li ", + "zhongshu ", + "zhongshu " + ], + "license": "MIT", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-helper-vue-jsx-merge-props": "^2.0.2", + "babel-istanbul": "^0.7.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.6.0", + "coveralls": "^2.13.3", + "expect": "^1.20.2", + "mocha": "^2.5.3", + "rimraf": "^2.6.2" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/qingwei-li/babel-plugin-component.git" + }, + "homepage": "https://github.com/qingwei-li/babel-plugin-component#readme", + "bugs": { + "url": "https://github.com/qingwei-li/babel-plugin-component/issues" + }, + "babel": { + "presets": [ + [ + "env", + { + "targets": { + "node": "current" + } + } + ] + ] + }, + "files": [ + "lib", + "package.json", + "README.md" ] - }, - "files": [ - "lib", - "package.json", - "README.md" - ] } diff --git a/src/index.js b/src/index.js index 0912b5b2..e409dbbe 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1 @@ -export default require('./core')('antd'); +export default require('./core').default('antd') From 389352f0ac4b802205c032b928442957b63af2da Mon Sep 17 00:00:00 2001 From: ZSUU Date: Fri, 13 Oct 2017 20:56:58 +0800 Subject: [PATCH 3/5] update --- debug/{index.js => debug.js} | 2 +- debug/{origin/test.jsx => input.jsx} | 0 debug/{output => }/output.js | 0 package.json | 13 +++++-------- 4 files changed, 6 insertions(+), 9 deletions(-) rename debug/{index.js => debug.js} (92%) rename debug/{origin/test.jsx => input.jsx} (100%) rename debug/{output => }/output.js (100%) diff --git a/debug/index.js b/debug/debug.js similarity index 92% rename from debug/index.js rename to debug/debug.js index 3575e62f..95d6bad3 100644 --- a/debug/index.js +++ b/debug/debug.js @@ -3,7 +3,7 @@ import { join } from 'path' import { writeFileSync } from 'fs' import plugin from '../src/index' -let originFile = join(__dirname, 'origin', 'test.jsx') +let originFile = join(__dirname, 'origin', 'input.jsx') let outputFile = join(__dirname, 'output', 'output.js') let outputText = transformFileSync(originFile, { diff --git a/debug/origin/test.jsx b/debug/input.jsx similarity index 100% rename from debug/origin/test.jsx rename to debug/input.jsx diff --git a/debug/output/output.js b/debug/output.js similarity index 100% rename from debug/output/output.js rename to debug/output.js diff --git a/package.json b/package.json index 96364330..f7f38aec 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "scripts": { "build": "rimraf lib && babel src --out-dir lib --ignore __tests__", - "debug": "node --inspect-brk --require ./node_modules/babel-core/register.js ./debug/index.js", + "debug": "node --inspect-brk --require ./node_modules/babel-core/register.js ./debug/debug.js", "testalls": "babel-node node_modules/babel-istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha --no-timeouts", "debugalls": "mocha --require babel-core/register --require babel-polyfill --no-timeouts", "coveralls": "cat ./coverage/lcov.info | coveralls" @@ -47,14 +47,11 @@ }, "babel": { "presets": [ - [ - "env", - { - "targets": { - "node": "current" - } + ["env", { + "targets": { + "node": "current" } - ] + }] ] }, "files": [ From 35336313d3a83ab2e0d8dae93eea2b0aa3ad2f2c Mon Sep 17 00:00:00 2001 From: ZSUU Date: Fri, 13 Oct 2017 20:59:45 +0800 Subject: [PATCH 4/5] update debug.js --- .projectile | 3 +-- debug/debug.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.projectile b/.projectile index 57ac26e7..13cb2636 100644 --- a/.projectile +++ b/.projectile @@ -13,5 +13,4 @@ -/libs/encoding -/.*.dll$ -/node_modules --/coverage --/test \ No newline at end of file +-/coverage \ No newline at end of file diff --git a/debug/debug.js b/debug/debug.js index 95d6bad3..ebce1202 100644 --- a/debug/debug.js +++ b/debug/debug.js @@ -3,8 +3,8 @@ import { join } from 'path' import { writeFileSync } from 'fs' import plugin from '../src/index' -let originFile = join(__dirname, 'origin', 'input.jsx') -let outputFile = join(__dirname, 'output', 'output.js') +let originFile = join(__dirname, 'input.jsx') +let outputFile = join(__dirname, 'output.js') let outputText = transformFileSync(originFile, { "presets": [ From d2ff9234194e63e274ed21da8977f0eb4ab7d4f6 Mon Sep 17 00:00:00 2001 From: ZSUU Date: Sat, 28 Oct 2017 20:14:24 +0800 Subject: [PATCH 5/5] up --- debug/{origin => case}/testUseInJsx_index.jsx | 0 debug/debug.js | 2 +- test/{index-test.js => test.js} | 0 test/{fixtures => testcase}/array/actual.js | 0 test/{fixtures => testcase}/array/expected.js | 0 test/{fixtures => testcase}/as-arguments/actual.js | 0 test/{fixtures => testcase}/as-arguments/expected.js | 0 test/{fixtures => testcase}/assignment-expression/actual.js | 0 test/{fixtures => testcase}/assignment-expression/expected.js | 0 test/{fixtures => testcase}/camel-to-dash-option/actual.js | 0 test/{fixtures => testcase}/camel-to-dash-option/expected.js | 0 test/{fixtures => testcase}/conditions/actual.js | 0 test/{fixtures => testcase}/conditions/expected.js | 0 test/{fixtures => testcase}/custom-css-filename/actual.js | 0 test/{fixtures => testcase}/custom-css-filename/expected.js | 0 test/{fixtures => testcase}/execute-direct/actual.js | 0 test/{fixtures => testcase}/execute-direct/expected.js | 0 test/{fixtures => testcase}/execute-member/actual.js | 0 test/{fixtures => testcase}/execute-member/expected.js | 0 test/{fixtures => testcase}/import-all-css/actual.js | 0 test/{fixtures => testcase}/import-all-css/expected.js | 0 test/{fixtures => testcase}/import-css/actual.js | 0 test/{fixtures => testcase}/import-css/expected.js | 0 test/{fixtures => testcase}/import-module/actual.js | 0 test/{fixtures => testcase}/import-module/expected.js | 0 test/{fixtures => testcase}/import-theme-all-compo/actual.js | 0 test/{fixtures => testcase}/import-theme-all-compo/expected.js | 0 test/{fixtures => testcase}/import-theme-custom-path/actual.js | 0 .../{fixtures => testcase}/import-theme-custom-path/expected.js | 0 test/{fixtures => testcase}/import-theme-custom/actual.js | 0 test/{fixtures => testcase}/import-theme-custom/expected.js | 0 test/{fixtures => testcase}/import-theme/actual.js | 0 test/{fixtures => testcase}/import-theme/expected.js | 0 .../independent-theme-package-custom/actual.js | 0 .../independent-theme-package-custom/expected.js | 0 .../independent-theme-package-mixin/actual.js | 0 .../independent-theme-package-mixin/expected.js | 0 test/{fixtures => testcase}/independent-theme-package/actual.js | 0 .../independent-theme-package/expected.js | 0 test/{fixtures => testcase}/multiple-module/actual.js | 0 test/{fixtures => testcase}/multiple-module/expected.js | 0 test/{fixtures => testcase}/multiple-words/actual.js | 0 test/{fixtures => testcase}/multiple-words/expected.js | 0 test/{fixtures => testcase}/property/actual.js | 0 test/{fixtures => testcase}/property/expected.js | 0 test/{fixtures => testcase}/react-element/actual.js | 0 test/{fixtures => testcase}/react-element/expected.js | 0 test/{fixtures => testcase}/specifier-alias/actual.js | 0 test/{fixtures => testcase}/specifier-alias/expected.js | 0 test/{fixtures => testcase}/variable-declarator/actual.js | 0 test/{fixtures => testcase}/variable-declarator/expected.js | 0 51 files changed, 1 insertion(+), 1 deletion(-) rename debug/{origin => case}/testUseInJsx_index.jsx (100%) rename test/{index-test.js => test.js} (100%) rename test/{fixtures => testcase}/array/actual.js (100%) rename test/{fixtures => testcase}/array/expected.js (100%) rename test/{fixtures => testcase}/as-arguments/actual.js (100%) rename test/{fixtures => testcase}/as-arguments/expected.js (100%) rename test/{fixtures => testcase}/assignment-expression/actual.js (100%) rename test/{fixtures => testcase}/assignment-expression/expected.js (100%) rename test/{fixtures => testcase}/camel-to-dash-option/actual.js (100%) rename test/{fixtures => testcase}/camel-to-dash-option/expected.js (100%) rename test/{fixtures => testcase}/conditions/actual.js (100%) rename test/{fixtures => testcase}/conditions/expected.js (100%) rename test/{fixtures => testcase}/custom-css-filename/actual.js (100%) rename test/{fixtures => testcase}/custom-css-filename/expected.js (100%) rename test/{fixtures => testcase}/execute-direct/actual.js (100%) rename test/{fixtures => testcase}/execute-direct/expected.js (100%) rename test/{fixtures => testcase}/execute-member/actual.js (100%) rename test/{fixtures => testcase}/execute-member/expected.js (100%) rename test/{fixtures => testcase}/import-all-css/actual.js (100%) rename test/{fixtures => testcase}/import-all-css/expected.js (100%) rename test/{fixtures => testcase}/import-css/actual.js (100%) rename test/{fixtures => testcase}/import-css/expected.js (100%) rename test/{fixtures => testcase}/import-module/actual.js (100%) rename test/{fixtures => testcase}/import-module/expected.js (100%) rename test/{fixtures => testcase}/import-theme-all-compo/actual.js (100%) rename test/{fixtures => testcase}/import-theme-all-compo/expected.js (100%) rename test/{fixtures => testcase}/import-theme-custom-path/actual.js (100%) rename test/{fixtures => testcase}/import-theme-custom-path/expected.js (100%) rename test/{fixtures => testcase}/import-theme-custom/actual.js (100%) rename test/{fixtures => testcase}/import-theme-custom/expected.js (100%) rename test/{fixtures => testcase}/import-theme/actual.js (100%) rename test/{fixtures => testcase}/import-theme/expected.js (100%) rename test/{fixtures => testcase}/independent-theme-package-custom/actual.js (100%) rename test/{fixtures => testcase}/independent-theme-package-custom/expected.js (100%) rename test/{fixtures => testcase}/independent-theme-package-mixin/actual.js (100%) rename test/{fixtures => testcase}/independent-theme-package-mixin/expected.js (100%) rename test/{fixtures => testcase}/independent-theme-package/actual.js (100%) rename test/{fixtures => testcase}/independent-theme-package/expected.js (100%) rename test/{fixtures => testcase}/multiple-module/actual.js (100%) rename test/{fixtures => testcase}/multiple-module/expected.js (100%) rename test/{fixtures => testcase}/multiple-words/actual.js (100%) rename test/{fixtures => testcase}/multiple-words/expected.js (100%) rename test/{fixtures => testcase}/property/actual.js (100%) rename test/{fixtures => testcase}/property/expected.js (100%) rename test/{fixtures => testcase}/react-element/actual.js (100%) rename test/{fixtures => testcase}/react-element/expected.js (100%) rename test/{fixtures => testcase}/specifier-alias/actual.js (100%) rename test/{fixtures => testcase}/specifier-alias/expected.js (100%) rename test/{fixtures => testcase}/variable-declarator/actual.js (100%) rename test/{fixtures => testcase}/variable-declarator/expected.js (100%) diff --git a/debug/origin/testUseInJsx_index.jsx b/debug/case/testUseInJsx_index.jsx similarity index 100% rename from debug/origin/testUseInJsx_index.jsx rename to debug/case/testUseInJsx_index.jsx diff --git a/debug/debug.js b/debug/debug.js index ebce1202..731bb882 100644 --- a/debug/debug.js +++ b/debug/debug.js @@ -25,4 +25,4 @@ let outputText = transformFileSync(originFile, { ] }).code -writeFileSync(outputFile, outputText) \ No newline at end of file +writeFileSync(outputFile, outputText) diff --git a/test/index-test.js b/test/test.js similarity index 100% rename from test/index-test.js rename to test/test.js diff --git a/test/fixtures/array/actual.js b/test/testcase/array/actual.js similarity index 100% rename from test/fixtures/array/actual.js rename to test/testcase/array/actual.js diff --git a/test/fixtures/array/expected.js b/test/testcase/array/expected.js similarity index 100% rename from test/fixtures/array/expected.js rename to test/testcase/array/expected.js diff --git a/test/fixtures/as-arguments/actual.js b/test/testcase/as-arguments/actual.js similarity index 100% rename from test/fixtures/as-arguments/actual.js rename to test/testcase/as-arguments/actual.js diff --git a/test/fixtures/as-arguments/expected.js b/test/testcase/as-arguments/expected.js similarity index 100% rename from test/fixtures/as-arguments/expected.js rename to test/testcase/as-arguments/expected.js diff --git a/test/fixtures/assignment-expression/actual.js b/test/testcase/assignment-expression/actual.js similarity index 100% rename from test/fixtures/assignment-expression/actual.js rename to test/testcase/assignment-expression/actual.js diff --git a/test/fixtures/assignment-expression/expected.js b/test/testcase/assignment-expression/expected.js similarity index 100% rename from test/fixtures/assignment-expression/expected.js rename to test/testcase/assignment-expression/expected.js diff --git a/test/fixtures/camel-to-dash-option/actual.js b/test/testcase/camel-to-dash-option/actual.js similarity index 100% rename from test/fixtures/camel-to-dash-option/actual.js rename to test/testcase/camel-to-dash-option/actual.js diff --git a/test/fixtures/camel-to-dash-option/expected.js b/test/testcase/camel-to-dash-option/expected.js similarity index 100% rename from test/fixtures/camel-to-dash-option/expected.js rename to test/testcase/camel-to-dash-option/expected.js diff --git a/test/fixtures/conditions/actual.js b/test/testcase/conditions/actual.js similarity index 100% rename from test/fixtures/conditions/actual.js rename to test/testcase/conditions/actual.js diff --git a/test/fixtures/conditions/expected.js b/test/testcase/conditions/expected.js similarity index 100% rename from test/fixtures/conditions/expected.js rename to test/testcase/conditions/expected.js diff --git a/test/fixtures/custom-css-filename/actual.js b/test/testcase/custom-css-filename/actual.js similarity index 100% rename from test/fixtures/custom-css-filename/actual.js rename to test/testcase/custom-css-filename/actual.js diff --git a/test/fixtures/custom-css-filename/expected.js b/test/testcase/custom-css-filename/expected.js similarity index 100% rename from test/fixtures/custom-css-filename/expected.js rename to test/testcase/custom-css-filename/expected.js diff --git a/test/fixtures/execute-direct/actual.js b/test/testcase/execute-direct/actual.js similarity index 100% rename from test/fixtures/execute-direct/actual.js rename to test/testcase/execute-direct/actual.js diff --git a/test/fixtures/execute-direct/expected.js b/test/testcase/execute-direct/expected.js similarity index 100% rename from test/fixtures/execute-direct/expected.js rename to test/testcase/execute-direct/expected.js diff --git a/test/fixtures/execute-member/actual.js b/test/testcase/execute-member/actual.js similarity index 100% rename from test/fixtures/execute-member/actual.js rename to test/testcase/execute-member/actual.js diff --git a/test/fixtures/execute-member/expected.js b/test/testcase/execute-member/expected.js similarity index 100% rename from test/fixtures/execute-member/expected.js rename to test/testcase/execute-member/expected.js diff --git a/test/fixtures/import-all-css/actual.js b/test/testcase/import-all-css/actual.js similarity index 100% rename from test/fixtures/import-all-css/actual.js rename to test/testcase/import-all-css/actual.js diff --git a/test/fixtures/import-all-css/expected.js b/test/testcase/import-all-css/expected.js similarity index 100% rename from test/fixtures/import-all-css/expected.js rename to test/testcase/import-all-css/expected.js diff --git a/test/fixtures/import-css/actual.js b/test/testcase/import-css/actual.js similarity index 100% rename from test/fixtures/import-css/actual.js rename to test/testcase/import-css/actual.js diff --git a/test/fixtures/import-css/expected.js b/test/testcase/import-css/expected.js similarity index 100% rename from test/fixtures/import-css/expected.js rename to test/testcase/import-css/expected.js diff --git a/test/fixtures/import-module/actual.js b/test/testcase/import-module/actual.js similarity index 100% rename from test/fixtures/import-module/actual.js rename to test/testcase/import-module/actual.js diff --git a/test/fixtures/import-module/expected.js b/test/testcase/import-module/expected.js similarity index 100% rename from test/fixtures/import-module/expected.js rename to test/testcase/import-module/expected.js diff --git a/test/fixtures/import-theme-all-compo/actual.js b/test/testcase/import-theme-all-compo/actual.js similarity index 100% rename from test/fixtures/import-theme-all-compo/actual.js rename to test/testcase/import-theme-all-compo/actual.js diff --git a/test/fixtures/import-theme-all-compo/expected.js b/test/testcase/import-theme-all-compo/expected.js similarity index 100% rename from test/fixtures/import-theme-all-compo/expected.js rename to test/testcase/import-theme-all-compo/expected.js diff --git a/test/fixtures/import-theme-custom-path/actual.js b/test/testcase/import-theme-custom-path/actual.js similarity index 100% rename from test/fixtures/import-theme-custom-path/actual.js rename to test/testcase/import-theme-custom-path/actual.js diff --git a/test/fixtures/import-theme-custom-path/expected.js b/test/testcase/import-theme-custom-path/expected.js similarity index 100% rename from test/fixtures/import-theme-custom-path/expected.js rename to test/testcase/import-theme-custom-path/expected.js diff --git a/test/fixtures/import-theme-custom/actual.js b/test/testcase/import-theme-custom/actual.js similarity index 100% rename from test/fixtures/import-theme-custom/actual.js rename to test/testcase/import-theme-custom/actual.js diff --git a/test/fixtures/import-theme-custom/expected.js b/test/testcase/import-theme-custom/expected.js similarity index 100% rename from test/fixtures/import-theme-custom/expected.js rename to test/testcase/import-theme-custom/expected.js diff --git a/test/fixtures/import-theme/actual.js b/test/testcase/import-theme/actual.js similarity index 100% rename from test/fixtures/import-theme/actual.js rename to test/testcase/import-theme/actual.js diff --git a/test/fixtures/import-theme/expected.js b/test/testcase/import-theme/expected.js similarity index 100% rename from test/fixtures/import-theme/expected.js rename to test/testcase/import-theme/expected.js diff --git a/test/fixtures/independent-theme-package-custom/actual.js b/test/testcase/independent-theme-package-custom/actual.js similarity index 100% rename from test/fixtures/independent-theme-package-custom/actual.js rename to test/testcase/independent-theme-package-custom/actual.js diff --git a/test/fixtures/independent-theme-package-custom/expected.js b/test/testcase/independent-theme-package-custom/expected.js similarity index 100% rename from test/fixtures/independent-theme-package-custom/expected.js rename to test/testcase/independent-theme-package-custom/expected.js diff --git a/test/fixtures/independent-theme-package-mixin/actual.js b/test/testcase/independent-theme-package-mixin/actual.js similarity index 100% rename from test/fixtures/independent-theme-package-mixin/actual.js rename to test/testcase/independent-theme-package-mixin/actual.js diff --git a/test/fixtures/independent-theme-package-mixin/expected.js b/test/testcase/independent-theme-package-mixin/expected.js similarity index 100% rename from test/fixtures/independent-theme-package-mixin/expected.js rename to test/testcase/independent-theme-package-mixin/expected.js diff --git a/test/fixtures/independent-theme-package/actual.js b/test/testcase/independent-theme-package/actual.js similarity index 100% rename from test/fixtures/independent-theme-package/actual.js rename to test/testcase/independent-theme-package/actual.js diff --git a/test/fixtures/independent-theme-package/expected.js b/test/testcase/independent-theme-package/expected.js similarity index 100% rename from test/fixtures/independent-theme-package/expected.js rename to test/testcase/independent-theme-package/expected.js diff --git a/test/fixtures/multiple-module/actual.js b/test/testcase/multiple-module/actual.js similarity index 100% rename from test/fixtures/multiple-module/actual.js rename to test/testcase/multiple-module/actual.js diff --git a/test/fixtures/multiple-module/expected.js b/test/testcase/multiple-module/expected.js similarity index 100% rename from test/fixtures/multiple-module/expected.js rename to test/testcase/multiple-module/expected.js diff --git a/test/fixtures/multiple-words/actual.js b/test/testcase/multiple-words/actual.js similarity index 100% rename from test/fixtures/multiple-words/actual.js rename to test/testcase/multiple-words/actual.js diff --git a/test/fixtures/multiple-words/expected.js b/test/testcase/multiple-words/expected.js similarity index 100% rename from test/fixtures/multiple-words/expected.js rename to test/testcase/multiple-words/expected.js diff --git a/test/fixtures/property/actual.js b/test/testcase/property/actual.js similarity index 100% rename from test/fixtures/property/actual.js rename to test/testcase/property/actual.js diff --git a/test/fixtures/property/expected.js b/test/testcase/property/expected.js similarity index 100% rename from test/fixtures/property/expected.js rename to test/testcase/property/expected.js diff --git a/test/fixtures/react-element/actual.js b/test/testcase/react-element/actual.js similarity index 100% rename from test/fixtures/react-element/actual.js rename to test/testcase/react-element/actual.js diff --git a/test/fixtures/react-element/expected.js b/test/testcase/react-element/expected.js similarity index 100% rename from test/fixtures/react-element/expected.js rename to test/testcase/react-element/expected.js diff --git a/test/fixtures/specifier-alias/actual.js b/test/testcase/specifier-alias/actual.js similarity index 100% rename from test/fixtures/specifier-alias/actual.js rename to test/testcase/specifier-alias/actual.js diff --git a/test/fixtures/specifier-alias/expected.js b/test/testcase/specifier-alias/expected.js similarity index 100% rename from test/fixtures/specifier-alias/expected.js rename to test/testcase/specifier-alias/expected.js diff --git a/test/fixtures/variable-declarator/actual.js b/test/testcase/variable-declarator/actual.js similarity index 100% rename from test/fixtures/variable-declarator/actual.js rename to test/testcase/variable-declarator/actual.js diff --git a/test/fixtures/variable-declarator/expected.js b/test/testcase/variable-declarator/expected.js similarity index 100% rename from test/fixtures/variable-declarator/expected.js rename to test/testcase/variable-declarator/expected.js