diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a1a900f..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/node:lts - user: node - - working_directory: /home/node/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v2-dependencies-{{ checksum "yarn.lock" }} - - - run: yarn install --pure-lockfile - - - save_cache: - paths: - - node_modules - - ~/.cache/yarn - key: v2-dependencies-{{ checksum "yarn.lock" }} - - # run tests! - - run: yarn test diff --git a/.gitignore b/.gitignore index c78d044..3c3629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,67 +1 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next - -# vuepress build output -.vuepress/dist - -# webstorm -.idea +node_modules diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ec6d3cd..0000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -package.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index ea8d3de..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "editor.formatOnSave": true, - "prettier.eslintIntegration": false, - "prettier.arrowParens": "avoid", - "prettier.bracketSpacing": true, - "prettier.ignorePath": ".prettierignore", - "prettier.printWidth": 120, - "prettier.semi": false, - "prettier.singleQuote": true, - "prettier.tabWidth": 2, - "prettier.trailingComma": "all" -} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a296e7a..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,175 +0,0 @@ -# [1.4.0](https://github.com/vuejs/jsx-vue2/compare/v1.3.1...v1.4.0) (2022-08-25) - -## other - -#### Features - -* Make `importSource` API configurable ([#291](https://github.com/vuejs/jsx-vue2/issues/291)) ([60da266](https://github.com/vuejs/jsx-vue2/commit/60da266)) - - - -# [1.3.1](https://github.com/vuejs/jsx-vue2/compare/v1.3.0...v1.3.1) (2022-07-21) - -## other - -#### Bug Fixes - -* relax the vue peer dependency version requirement ([8b5f023](https://github.com/vuejs/jsx-vue2/commit/8b5f023)) - - - -# [1.3.0](https://github.com/vuejs/jsx-vue2/compare/v1.2.4...v1.3.0) (2022-07-06) - -## other - -#### Features - -* add importSource option ([#284](https://github.com/vuejs/jsx-vue2/issues/284)) ([abffc65](https://github.com/vuejs/jsx-vue2/commit/abffc65)) -* rework the `compositionAPI` option of the preset to support Vue 2.7 ([e7d094e](https://github.com/vuejs/jsx-vue2/commit/e7d094e)) - - - -# [1.2.4](https://github.com/vuejs/jsx-vue2/compare/v1.2.3...v1.2.4) (2020-10-27) - -## other - -#### Bug Fixes - -* **composition-api-render-instance:** store currentInstance in variable for render instance ([#168](https://github.com/vuejs/jsx-vue2/issues/168)) ([a3525bf](https://github.com/vuejs/jsx-vue2/commit/a3525bf)) - - - -# [1.2.3](https://github.com/vuejs/jsx-vue2/compare/v1.2.2...v1.2.3) (2020-10-20) - -## other - -#### Bug Fixes - -* v-model/v-on should apply before arrow-functions transform ([#167](https://github.com/vuejs/jsx-vue2/issues/167)) ([319932e](https://github.com/vuejs/jsx-vue2/commit/319932e)), closes [#87](https://github.com/vuejs/jsx-vue2/issues/87) [/github.com/vuejs/jsx/issues/165#issuecomment-712603569](https://github.com//github.com/vuejs/jsx/issues/165/issues/issuecomment-712603569) - - - -# [1.2.2](https://github.com/vuejs/jsx-vue2/compare/v1.2.1...v1.2.2) (2020-10-17) - -## other - -#### Bug Fixes - -* functional-vue & inject-h should traverse before JSX plugin ([#166](https://github.com/vuejs/jsx-vue2/issues/166)) ([8969609](https://github.com/vuejs/jsx-vue2/commit/8969609)), closes [#165](https://github.com/vuejs/jsx-vue2/issues/165) - - - -# [1.2.1](https://github.com/vuejs/jsx-vue2/compare/v1.2.0...v1.2.1) (2020-10-16) - -## other - -#### Bug Fixes - -* add composition-api packages to dependencies ([cd9db9f](https://github.com/vuejs/jsx-vue2/commit/cd9db9f)) - - - -# [1.2.0](https://github.com/vuejs/jsx-vue2/compare/v1.1.2...v1.2.0) (2020-10-16) - -## other - -#### Features - -* add [@vue](https://github.com/vue)/composition-api support ([#142](https://github.com/vuejs/jsx-vue2/issues/142)) ([ecc6ed6](https://github.com/vuejs/jsx-vue2/commit/ecc6ed6)) -* allow prior babel plugins to traverse JSX tree throughly, close [#86](https://github.com/vuejs/jsx-vue2/issues/86) ([b49fa8a](https://github.com/vuejs/jsx-vue2/commit/b49fa8a)) -* change all sugar plugins to work without pre-traversing the Program ([0943580](https://github.com/vuejs/jsx-vue2/commit/0943580)) - - - -# [1.1.2](https://github.com/vuejs/jsx-vue2/compare/v1.1.1...v1.1.2) (2019-11-09) - -## other - -#### Bug Fixes - -* add [@babel](https://github.com/babel)/core to peerDependencies ([f60f316](https://github.com/vuejs/jsx-vue2/commit/f60f316)) - - - -# [1.1.1](https://github.com/vuejs/jsx-vue2/compare/v1.1.0...v1.1.1) (2019-10-11) - -## other - -#### Bug Fixes - -* **v-model:** create non-existent properties as reactive ([05b9b3a](https://github.com/vuejs/jsx-vue2/commit/05b9b3a)) - - - -# [1.1.0](https://github.com/vuejs/jsx-vue2/compare/v1.0.0...v1.1.0) (2019-07-23) - -## other - -#### Bug Fixes - -* support for `.passive` modifier ([01177c8](https://github.com/vuejs/jsx-vue2/commit/01177c8)) - - - -# [1.0.0](https://github.com/vuejs/jsx-vue2/compare/v1.0.0-beta.3...v1.0.0) (2019-05-08) - -## other - -#### Bug Fixes - -* Support props with underscore, close [#55](https://github.com/vuejs/jsx-vue2/issues/55) ([852481c](https://github.com/vuejs/jsx-vue2/commit/852481c)) - - - -# [1.0.0-beta.3](https://github.com/vuejs/jsx-vue2/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2019-03-22) - -## other - -#### Bug Fixes - -* filter out jsx comments in `getChildren` ([7f0c84c](https://github.com/vuejs/jsx-vue2/commit/7f0c84c)), closes [#46](https://github.com/vuejs/jsx-vue2/issues/46) -* fix incorrect repository urls ([99380b3](https://github.com/vuejs/jsx-vue2/commit/99380b3)) - - - -# [1.0.0-beta.2](https://github.com/vuejs/jsx-vue2/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2019-01-11) - -## other - -#### Bug Fixes - -* remove extraneous peer deps ([29414a7](https://github.com/vuejs/jsx-vue2/commit/29414a7)) -* Trim whitespaces properly, fix [#37](https://github.com/vuejs/jsx-vue2/issues/37) ([54c75ee](https://github.com/vuejs/jsx-vue2/commit/54c75ee)) -#### Features - -* Support root-level attributes, close [#32](https://github.com/vuejs/jsx-vue2/issues/32) ([96b182c](https://github.com/vuejs/jsx-vue2/commit/96b182c)) - - - -# 1.0.0-beta.1 (2018-12-25) - -## other - -#### Bug Fixes - -* Add events at the begining of argument list ([0604214](https://github.com/vuejs/jsx-vue2/commit/0604214)) -* Add staticClass as root attribute ([cd3bab1](https://github.com/vuejs/jsx-vue2/commit/cd3bab1)) -* Do not trim all spaces ([c5ebfac](https://github.com/vuejs/jsx-vue2/commit/c5ebfac)) -* Fix failing tests ([21213df](https://github.com/vuejs/jsx-vue2/commit/21213df)) -* Force html & svg tags to always be treated as string tags ([12a311e](https://github.com/vuejs/jsx-vue2/commit/12a311e)) -* proper support for camelCase ([a903610](https://github.com/vuejs/jsx-vue2/commit/a903610)) -* Support camelCase directives ([6a43377](https://github.com/vuejs/jsx-vue2/commit/6a43377)) -* Support default export in functional component ([7e6f893](https://github.com/vuejs/jsx-vue2/commit/7e6f893)) -* throw an error if v-model is used with a string ([82d6bcb](https://github.com/vuejs/jsx-vue2/commit/82d6bcb)) -#### Features - -* Add release utilities ([4bb22fb](https://github.com/vuejs/jsx-vue2/commit/4bb22fb)) -* add support for argument and modifiers for directives ([0085b8f](https://github.com/vuejs/jsx-vue2/commit/0085b8f)) -* change the syntax for argument and modifiers ([b1c8036](https://github.com/vuejs/jsx-vue2/commit/b1c8036)) -* Event modifiers for v-on ([cef09bb](https://github.com/vuejs/jsx-vue2/commit/cef09bb)) -* implement babel preset ([1137c1d](https://github.com/vuejs/jsx-vue2/commit/1137c1d)) -* Support vModel in kebab-case components ([dc0e29f](https://github.com/vuejs/jsx-vue2/commit/dc0e29f)) -* Treat string as component if declared in scope ([51ca488](https://github.com/vuejs/jsx-vue2/commit/51ca488)) - - - diff --git a/README.md b/README.md deleted file mode 100644 index 6d8274e..0000000 --- a/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# Babel Preset JSX - -> [!CAUTION] -> Vue 2 has reached EOL, and this project is no longer actively maintained. - -Configurable Babel preset to add Vue JSX support. See the [configuration options here](./packages/babel-preset-jsx). - -## Compatibility - -This repo is only compatible with: - -- **Babel 7+**. For Babel 6 support, use [vuejs/babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx) -- **Vue 2+**. JSX is not supported for older versions. For Vue 3 support, please use [`@vue/babel-plugin-jsx`](https://github.com/vuejs/babel-plugin-jsx). - -## Installation - -Install the preset with: - -```bash -npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props -``` - -Then add the preset to `babel.config.js`: - -```js -module.exports = { - presets: ['@vue/babel-preset-jsx'], -} -``` - -## Syntax - -### Content - -```jsx -render() { - return

hello

-} -``` - -with dynamic content: - -```jsx -render() { - return

hello { this.message }

-} -``` - -when self-closing: - -```jsx -render() { - return -} -``` - -with a component: - -```jsx -import MyComponent from './my-component' - -export default { - render() { - return hello - }, -} -``` - -### Attributes/Props - -```jsx -render() { - return -} -``` - -with a dynamic binding: - -```jsx -render() { - return -} -``` - -with the spread operator (object needs to be compatible with [Vue Data Object](https://v2.vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth)): - -```jsx -render() { - const inputAttrs = { - type: 'email', - placeholder: 'Enter your email' - } - - return -} -``` - -### Slots - -named slots: - -```jsx -render() { - return ( - -
header
- -
- ) -} -``` - -scoped slots: - -```jsx -render() { - const scopedSlots = { - header: () =>
header
, - footer: () => - } - - return -} -``` - -### Directives - -```jsx - -``` - -with a modifier: - -```jsx - -``` - -with an argument: - -```jsx - -``` - -with an argument and modifiers: - -```jsx - -``` - -v-html: - -```jsx -

-``` - -### Functional Components - -Transpiles arrow functions that return JSX into functional components, when they are either default exports: - -```jsx -export default ({ props }) =>

hello {props.message}

-``` - -or PascalCase variable declarations: - -```jsx -const HelloWorld = ({ props }) =>

hello {props.message}

-``` diff --git a/lerna.json b/lerna.json index 89346c0..8e0a097 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,8 @@ { - "lerna": "2.9.1", "packages": [ "packages/*" ], - "version": "1.4.0", - "npmClient": "yarn" + "npmClient": "yarn", + "useWorkspaces": true, + "version": "0.0.0" } diff --git a/package.json b/package.json index e4e742f..b0f56bc 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,10 @@ { + "name": "root", "private": true, - "license": "MIT", - "workspaces": [ - "packages/*" - ], - "scripts": { - "test": "lerna run test", - "release:note": "node scripts/gen-release-notes.js run", - "release:build": "lerna run build", - "prerelease": "yarn release:build", - "postrelease": "yarn release:note", - "release": "lerna publish" - }, "devDependencies": { - "@lerna-lite/cli": "^1.9.0", - "@lerna-lite/run": "^1.9.0", - "@vue/conventional-changelog": "^0.1.1", - "conventional-changelog": "^2.0.3", - "execa": "^1.0.0" + "lerna": "^3.18.4" + }, + "dependencies": { + "lodash.debounce": "^4.0.8" } } diff --git a/packages/babel-helper-vue-jsx-merge-props/.gitignore b/packages/babel-helper-vue-jsx-merge-props/.gitignore deleted file mode 100644 index 9b1c8b1..0000000 --- a/packages/babel-helper-vue-jsx-merge-props/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/dist diff --git a/packages/babel-helper-vue-jsx-merge-props/README.md b/packages/babel-helper-vue-jsx-merge-props/README.md deleted file mode 100644 index 745c107..0000000 --- a/packages/babel-helper-vue-jsx-merge-props/README.md +++ /dev/null @@ -1,30 +0,0 @@ -## @vue/babel-helper-vue-jsx-merge-props - -A package used internally by vue jsx transformer to merge props spread. It is required to merge some prop trees like this: - -```js -import mergeProps from '@vue/babel-helper-vue-jsx-merge-props' - -const MyComponent = { - render(h) { - // original: