Skip to content

Commit e554c23

Browse files
author
Suchita Doshi
committed
initial commit for ember tracked properties codemod
1 parent cf6b209 commit e554c23

25 files changed

+5868
-1
lines changed

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: 'standard',
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
},
6+
env: {
7+
node: true,
8+
es6: true,
9+
},
10+
};

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
*.log

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
---
3+
language: node_js
4+
node_js:
5+
- "8"
6+
- "10"
7+
8+
sudo: false
9+
dist: trusty
10+
11+
cache:
12+
yarn: true
13+
14+
before_install:
15+
- curl -o- -L https://yarnpkg.com/install.sh | bash
16+
- export PATH=$HOME/.yarn/bin:$PATH
17+
18+
install:
19+
- yarn install
20+
21+
script:
22+
- yarn test

CHANGELOG.md

Whitespace-only changes.

README.md

100644100755
Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
# ember-tracked-properties-codemod
2-
Convert to `@tracked`
2+
3+
[![Build Status](https://travis-ci.com/suchitadoshi1987/ember-tracked-properties-codemod.svg?branch=master)](https://travis-ci.com/suchitadoshi1987/ember-tracked-properties-codemod)
4+
5+
[![npm](https://img.shields.io/npm/v/ember-tracked-properties-codemod.svg?label=npm)](https://www.npmjs.com/package/ember-tracked-properties-codemod)
6+
7+
8+
A codemod for transforming your ember app code to start using `@tracked` properties.
9+
10+
11+
12+
## Pre-requisites
13+
14+
- Since `@tracked` properties is supported from the `3.13` version of Ember, this codemod should only be used for apps with version `3.13+`.
15+
- This codemod only supports native classes. To get the most out of this codemod, you would need to run the [Ember Native class codemod](https://github.com/ember-codemods/ember-native-class-codemod) first.
16+
17+
## Usage
18+
19+
```
20+
npx ember-tracked-properties-codemod path/of/files/ or/some**/*glob.hbs
21+
```
22+
23+
24+
25+
## Contributing
26+
27+
### Installation
28+
29+
* clone the repo
30+
* change into the repo directory
31+
* `yarn`
32+
33+
### Running tests
34+
35+
* `yarn test`
36+

bin/cli.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
require('codemod-cli').runTransform(
5+
__dirname,
6+
'tracked-properties' /* transform name */,
7+
process.argv.slice(2) /* paths or globs */
8+
);

package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "ember-tracked-properties-codemod",
3+
"description": "A codemod for transforming your ember app code to start using `@tracked` properties.",
4+
"version": "0.1.0",
5+
"author": {
6+
"name": "Suchita Doshi",
7+
"email": "[email protected]",
8+
"url": "https://github.com/suchitadoshi1987"
9+
},
10+
"license": "MIT",
11+
"scripts": {
12+
"test": "codemod-cli test",
13+
"update-docs": "codemod-cli update-docs"
14+
},
15+
"bin": "./bin/cli.js",
16+
"keywords": [
17+
"codemod-cli"
18+
],
19+
"dependencies": {
20+
"codemod-cli": "^0.2.7"
21+
},
22+
"devDependencies": {
23+
"@babel/plugin-proposal-class-properties": "^7.7.4",
24+
"@babel/plugin-proposal-decorators": "^7.7.4",
25+
"eslint": "^5.9.0",
26+
"eslint-config-prettier": "^3.3.0",
27+
"eslint-plugin-prettier": "^3.0.0",
28+
"prettier": "^1.15.2",
29+
"jest": "^23.1.0"
30+
},
31+
"jest": {
32+
"testEnvironment": "node"
33+
},
34+
"repository": {
35+
"type": "git",
36+
"url": "https://github.com/suchitadoshi1987/ember-tracked-properties-codemod"
37+
},
38+
"publishConfig": {
39+
"registry": "https://registry.npmjs.org"
40+
},
41+
"engines": {
42+
"node": "8.* || 10.* || >= 12.*"
43+
}
44+
}

transforms/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)