Skip to content

Commit c9069eb

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 910fb95 + b55ccd1 commit c9069eb

37 files changed

+1850
-469
lines changed

.postcssrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ module.exports = {
99
postcssModules({
1010
generateScopedName: classConfig,
1111
getJSON: (cssFileName, json) => {
12-
const cssName = path.basename(cssFileName, '.vue');
12+
let cssName = path.basename(cssFileName, '.vue');
13+
14+
// Fix rollup repeat
15+
cssName = cssName.replace(/(.*)\.vue\?.*/, '$1');
1316
const jsonFileName = path.resolve(`./src/classes/${cssName}.json`);
1417
fs.writeFileSync(jsonFileName, JSON.stringify(json));
1518
},

.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = {
3535
'postcss-loader',
3636
'sass-loader',
3737
],
38+
include: path.resolve(__dirname, '../src/components'),
3839
},
3940
);
4041

.storybook/manager-head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
width: 14px;
1313
height: 14px;
1414
margin-top: 2px;
15-
color: rgb(16,128,67);
15+
/* color: rgb(16,128,67); */
1616
}
1717

1818
#storybook-explorer-tree .sidebar-item[data-selected="true"] svg {

.storybook/preview.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const decorators = [(story) => ({
1313

1414
export const parameters = {
1515
viewMode: 'docs',
16-
actions: { disable: true },
1716
controls: {
1817
matchers: {
1918
color: /(background|color|backgroundColor)$/i,
@@ -26,17 +25,9 @@ export const parameters = {
2625
storySort: {
2726
order: [
2827
"Get Started",
28+
"Polaris Icons",
2929
"Changelog",
30-
"Actions",
31-
"Structure",
32-
"Forms",
33-
"Images & Icons",
34-
"Feedback indicators",
35-
"Titles & Text",
36-
"Behavior",
37-
"Lists & Tables",
38-
"Navigation",
39-
"Overlays",
30+
"Components",
4031
]
4132
}
4233
},

.storybook/stories/GetStarted.stories.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Use as a Vue plugin (globally registers all components):
4444

4545
```js
4646
import Vue from 'vue';
47-
import PolarisVue from 'polaris-vue';
47+
import PolarisVue from '@qikify/polaris-vue';
4848
import '@qikify/polaris-vue/dist/polaris-vue.css';
4949

5050
Vue.use(PolarisVue);
@@ -60,7 +60,7 @@ OR use individual component:
6060

6161
```js
6262
import Vue from 'vue';
63-
import { List, Icon } from 'polaris-vue';
63+
import { List, Icon } from '@qikify/polaris-vue';
6464

6565
new Vue({
6666
components: {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Meta } from '@storybook/addon-docs';
2+
3+
<Meta
4+
title="Polaris Icons"
5+
parameters={{
6+
viewMode: 'docs',
7+
isToolshown: false,
8+
previewTabs: {
9+
'canvas': {
10+
hidden: true,
11+
},
12+
},
13+
}}
14+
/>
15+
16+
Coming soon...

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
Polaris Vue by Qikify based on [Shopify Polaris style guide](https://polaris.shopify.com/).
77
We're trying to make it mostly close with Shopify style guide and get a better performance.
88

9-
Online documentation: [Click Here](https://polaris.qikify.com/)
9+
### Documentation
10+
11+
Online documentation: [Click Here](https://qikify.github.io/polaris-vue/)
1012

1113
## Installation
1214

@@ -28,7 +30,7 @@ Use as a Vue plugin (globally registers all components):
2830

2931
```js
3032
import Vue from 'vue';
31-
import PolarisVue from 'polaris-vue';
33+
import PolarisVue from '@qikify/polaris-vue';
3234
import '@qikify/polaris-vue/dist/polaris-vue.css';
3335

3436
Vue.use(PolarisVue);
@@ -44,7 +46,7 @@ new Vue({
4446

4547
```js
4648
import Vue from 'vue';
47-
import { List, Icon } from 'polaris-vue';
49+
import { List, Icon } from '@qikify/polaris-vue';
4850

4951
new Vue({
5052
components: {

babel.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
const devPresets = ['@vue/babel-preset-app'];
2+
const buildPresets = [
3+
'@babel/preset-env',
4+
'@babel/preset-typescript',
5+
];
16
module.exports = {
2-
presets: [
3-
'@vue/cli-plugin-babel/preset',
4-
],
7+
presets: (process.env.NODE_ENV === 'development' ? devPresets : buildPresets),
58
};

build/rollup.config.base.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import path from 'path';
2+
import alias from '@rollup/plugin-alias';
3+
import resolve from '@rollup/plugin-node-resolve';
4+
import replace from '@rollup/plugin-replace';
5+
import postcss from 'rollup-plugin-postcss';
6+
import commonjs from '@rollup/plugin-commonjs';
7+
8+
export default {
9+
plugins: {
10+
preVue: [
11+
replace({
12+
values: {
13+
'process.env.NODE_ENV': JSON.stringify('production'),
14+
},
15+
preventAssignment: true,
16+
}),
17+
alias({
18+
entries: [
19+
{ find: /@\//, replacement: `${path.resolve(__dirname, '../src/')}` },
20+
],
21+
}),
22+
postcss(),
23+
],
24+
vue: {
25+
css: false,
26+
preprocessStyles: true,
27+
template: {
28+
isProduction: true,
29+
},
30+
style: {
31+
preprocessOptions: {
32+
scss: {
33+
includePaths: ['node_modules'],
34+
},
35+
},
36+
},
37+
},
38+
postVue: [
39+
resolve({
40+
extensions: ['.js', '.ts', '.vue'],
41+
}),
42+
commonjs(),
43+
],
44+
babel: {
45+
exclude: 'node_modules/**',
46+
extensions: ['.ts', '.js', '.vue'],
47+
babelHelpers: 'bundled',
48+
},
49+
},
50+
};

build/rollup.config.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import minimist from 'minimist';
2+
import vue from 'rollup-plugin-vue';
3+
import babel from '@rollup/plugin-babel';
4+
import typescript from 'rollup-plugin-typescript2';
5+
import ttypescript from 'ttypescript';
6+
import json from '@rollup/plugin-json';
7+
8+
import baseConfig from './rollup.config.base';
9+
10+
const argv = minimist(process.argv.slice(2));
11+
12+
const external = ['vue'];
13+
14+
const buildFormats = [];
15+
16+
// ES file build config
17+
// Currently we only support es build
18+
if (!argv.format || argv.format === 'es') {
19+
const merged = {
20+
input: 'src/polaris-vue.ts',
21+
external,
22+
output: {
23+
file: 'dist/polaris-vue.js',
24+
format: 'esm',
25+
exports: 'named',
26+
},
27+
plugins: [
28+
...baseConfig.plugins.preVue,
29+
json(),
30+
vue(baseConfig.plugins.vue),
31+
...baseConfig.plugins.postVue,
32+
typescript({
33+
typescript: ttypescript,
34+
useTsconfigDeclarationDir: true,
35+
emitDeclarationOnly: true,
36+
}),
37+
babel({
38+
...baseConfig.plugins.babel,
39+
presets: [['@babel/preset-env']],
40+
}),
41+
],
42+
};
43+
44+
buildFormats.push(merged);
45+
}
46+
47+
// Export config
48+
export default buildFormats;

0 commit comments

Comments
 (0)