Skip to content

Commit 1b0deec

Browse files
committed
refactor: update to new babel-plugin-ast-literal
1 parent 6ffe304 commit 1b0deec

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

decls/utils.js

-2
This file was deleted.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"homepage": "https://github.com/andreypopp/react-css-components#readme",
4646
"dependencies": {
47-
"babel-plugin-ast-literal": "^0.4.0",
47+
"babel-plugin-ast-literal": "^0.5.3",
4848
"babel-traverse": "^6.7.6",
4949
"babel-types": "^6.7.2",
5050
"babylon": "^6.7.0",
@@ -61,7 +61,7 @@
6161
"eslint": "^2.7.0",
6262
"eslint-config-prometheusresearch": "^0.2.0",
6363
"eslint-plugin-react": "^4.3.0",
64-
"flow-bin": "^0.23.0",
64+
"flow-bin": "^0.26.0",
6565
"mocha": "^2.4.5"
6666
}
6767
}

src/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {identifier, stringLiteral, program} from 'babel-types';
1111
import generate from 'babel-generator';
1212
import traverse from 'babel-traverse';
1313
import * as types from 'babel-types';
14+
import {expr, stmt} from 'babel-plugin-ast-literal/api';
1415
import {parse} from 'babylon';
1516

1617
import * as postcss from 'postcss';
@@ -219,7 +220,7 @@ function renderToJS(source: string, config: RenderConfig): string {
219220

220221
let imports = stmt`
221222
import React from "react";
222-
import styles from "${stringLiteral(config.requestCSS)}";
223+
import styles from "${config.requestCSS}";
223224
`;
224225
let statements = [];
225226
let components: ComponentSpecCollection = {};
@@ -259,7 +260,7 @@ function renderToJS(source: string, config: RenderConfig): string {
259260
imports.push(stmt`
260261
import {
261262
${identifier(ref.name)} as ${base}
262-
} from "${stringLiteral(ref.source)}";
263+
} from "${ref.source}";
263264
`);
264265
}
265266

0 commit comments

Comments
 (0)