Skip to content

Commit 9f46696

Browse files
committed
added transform for removing import for htmlbars-inline-precompile and adding import for ember-cli-htmlbars
1 parent 56c67ec commit 9f46696

14 files changed

Lines changed: 5582 additions & 0 deletions

File tree

.eslintignore

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

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
parserOptions: {
3+
ecmaVersion: 2018,
4+
},
5+
6+
plugins: ['prettier', 'node'],
7+
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:node/recommended'],
8+
env: {
9+
node: true,
10+
},
11+
rules: {},
12+
overrides: [
13+
{
14+
files: ['__tests__/**/*.js'],
15+
env: {
16+
jest: true,
17+
},
18+
},
19+
],
20+
};

.prettierrc

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

.travis.yml

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

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+
process.argv[2] /* transform name */,
7+
process.argv.slice(3) /* paths or globs */
8+
);

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "ember-cli-htmlbars-inline-precompile-codemod",
3+
"version": "0.1.0",
4+
"scripts": {
5+
"lint": "eslint --cache .",
6+
"test": "codemod-cli test",
7+
"test:coverage": "codemod-cli test --coverage",
8+
"update-docs": "codemod-cli update-docs",
9+
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls"
10+
},
11+
"bin": "./bin/cli.js",
12+
"keywords": [
13+
"codemod-cli"
14+
],
15+
"dependencies": {
16+
"codemod-cli": "^2.1.0"
17+
},
18+
"devDependencies": {
19+
"coveralls": "^3.0.6",
20+
"eslint": "^6.4.0",
21+
"eslint-config-prettier": "^6.3.0",
22+
"eslint-plugin-node": "^10.0.0",
23+
"eslint-plugin-prettier": "^3.1.1",
24+
"jest": "^24.9.0",
25+
"prettier": "^1.18.2"
26+
},
27+
"engines": {
28+
"node": "8.* || 10.* || >= 12"
29+
},
30+
"jest": {
31+
"testEnvironment": "node"
32+
}
33+
}

transforms/.gitkeep

Whitespace-only changes.

transforms/main/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# main
2+
3+
4+
## Usage
5+
6+
```
7+
npx ember-cli-htmlbars-inline-precompile-codemod main path/of/files/ or/some**/*glob.js
8+
9+
# or
10+
11+
yarn global add ember-cli-htmlbars-inline-precompile-codemod
12+
ember-cli-htmlbars-inline-precompile-codemod main path/of/files/ or/some**/*glob.js
13+
```
14+
15+
## Input / Output
16+
17+
<!--FIXTURES_TOC_START-->
18+
<!--FIXTURES_TOC_END-->
19+
20+
<!--FIXTURES_CONTENT_START-->
21+
<!--FIXTURES_CONTENT_END-->
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import hbs from 'htmlbars-inline-precompile';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import { hbs } from 'ember-cli-htmlbars';

0 commit comments

Comments
 (0)