Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 92ce9c4

Browse files
committed
Fix: styles ordering
1 parent de0b395 commit 92ce9c4

File tree

5 files changed

+40
-32
lines changed

5 files changed

+40
-32
lines changed

__tests__/__snapshots__/index.js.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Package exports expected interface 1`] = `
4+
Object {
5+
"Avatar": [Function],
6+
"Button": [Function],
7+
"DangerButton": [Function],
8+
"DataScienceTrackEventTag": [Function],
9+
"DataScienceTrackTag": [Function],
10+
"DesignTrackEventTag": [Function],
11+
"DesignTrackTag": [Function],
12+
"DevelopmentTrackEventTag": [Function],
13+
"DevelopmentTrackTag": [Function],
14+
"GhostButton": [Function],
15+
"PrimaryButton": [Function],
16+
"SecondaryButton": [Function],
17+
"Tag": [Function],
18+
}
19+
`;

__tests__/index.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
import iface from '../src';
22

33
test('Package exports expected interface', () => {
4-
expect(iface).toHaveProperty('Avatar');
5-
6-
/* components/buttons */
7-
expect(iface).toHaveProperty('Button');
8-
expect(iface).toHaveProperty('DangerButton');
9-
expect(iface).toHaveProperty('GhostButton');
10-
expect(iface).toHaveProperty('PrimaryButton');
11-
expect(iface).toHaveProperty('SecondaryButton');
12-
13-
/* components/tags */
14-
expect(iface).toHaveProperty('Tag');
15-
expect(iface).toHaveProperty('DataScienceTrackTag');
16-
expect(iface).toHaveProperty('DataScienceTrackEventTag');
17-
expect(iface).toHaveProperty('DesignTrackTag');
18-
expect(iface).toHaveProperty('DesignTrackEventTag');
19-
expect(iface).toHaveProperty('DevelopmentTrackTag');
20-
expect(iface).toHaveProperty('DevelopmentTrackEventTag');
4+
expect(iface).toMatchSnapshot();
215
});

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
"lint:scss": "./node_modules/.bin/stylelint **/*.scss --syntax scss",
3333
"test": "npm run lint && npm run jest"
3434
},
35-
"version": "0.4.2",
35+
"version": "0.4.3",
3636
"dependencies": {
3737
"react": "^16.4.1",
3838
"react-css-super-themr": "^2.2.0",
3939
"react-dom": "^16.4.1",
40-
"topcoder-react-utils": "^0.6.5"
40+
"topcoder-react-utils": "^0.6.7"
4141
},
4242
"devDependencies": {
4343
"autoprefixer": "^8.6.3",

src/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import 'styles/global.scss';
2-
import Avatar from 'components/Avatar';
3-
import * as buttons from 'components/buttons';
4-
import * as tags from 'components/tags';
1+
/* NOTE: Order of imports is important here, this is also the reason to
2+
* avoid `import` instructions, as they are silently re-ordered on top by
3+
* the compiler. */
54

65
/* eslint-disable global-require */
76
if (process.env.NODE_ENV === 'production') {
@@ -11,6 +10,12 @@ if (process.env.NODE_ENV === 'production') {
1110
}
1211
/* eslint-enable global-require */
1312

13+
require('styles/global.scss');
14+
15+
const Avatar = require('components/Avatar').default;
16+
const buttons = require('components/buttons');
17+
const tags = require('components/tags');
18+
1419
module.exports = {
1520
Avatar,
1621
...buttons,

0 commit comments

Comments
 (0)