Skip to content

Commit e5cc8d3

Browse files
committed
refactor: fix component spec
1 parent b909525 commit e5cc8d3

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## 0.3.0
2+
3+
* [BREAKING] Component spec format changed from using `.` as a delimiter between
4+
module and export name to `?`.
5+
6+
Update:
7+
8+
Label {
9+
base: mylib.Label;
10+
color: red;
11+
}
12+
13+
To:
14+
15+
Label {
16+
base: mylib?Label;
17+
color: red;
18+
}
19+
120
## 0.2.0
221

322
* [FEATURE] When specifying `base` for a styled component it is treated as an

src/ComponentRef.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import * as types from 'babel-types';
77

88
// TODO: More robust regexpes required!
9-
const PARSE_REF_RE = /^([a-zA-Z0-9_\-\/]+)(\.([a-zA-Z0-9_]+))?$/;
10-
const PARSE_NAMED_REF_RE = /^([a-zA-Z0-9_]+)=([a-zA-Z0-9_\-\/]+)(\.([a-zA-Z0-9_]+))?$/;
9+
const PARSE_REF_RE = /^([a-zA-Z0-9\._\-\/]+)(\?([a-zA-Z0-9_]+))?$/;
10+
const PARSE_NAMED_REF_RE = /^([a-zA-Z0-9_]+)=([a-zA-Z0-9_\.\-\/]+)(\?([a-zA-Z0-9_]+))?$/;
1111

1212
export type ComponentRef = {
1313
source: string;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Label {
2-
base: lib.Label;
2+
base: lib?Label;
33
color: red;
44
}

0 commit comments

Comments
 (0)