diff --git a/build/rollup.config.js b/build/rollup.config.js index 10476d27..4a1ec3c2 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -7,6 +7,7 @@ import commonjs from 'rollup-plugin-commonjs' import copy from 'rollup-plugin-copy' import { terser } from 'rollup-plugin-terser' import del from 'rollup-plugin-delete' +import multiInput from 'rollup-plugin-multi-input' const external = [ ...Object.keys(pkg.dependencies || {}), @@ -15,20 +16,23 @@ const external = [ ] export default { - input: 'src/index.ts', - output: [ - { - name: 'SoramitsuJsUi', - file: 'lib/soramitsu-js-ui.esm.js', - format: 'esm', - sourcemap: true - }, { - name: 'SoramitsuJsUiUmd', - format: 'umd', - file: 'lib/soramitsu-js-ui.umd.js', - sourcemap: true - } + input: [ + 'src/index.ts', + 'src/types/DesignSystem.ts', + 'src/types/Locale.ts', + 'src/types/Theme.ts', + 'src/locale/index.ts', + 'src/plugins/*.ts', + 'src/store/index.ts', + 'src/utils/*.ts', + 'src/directives/index.ts', + 'src/components/*/**/index.ts' ], + output: { + format: 'esm', + dir: 'lib' + // sourcemap: true We don't need it because of d.ts files + }, external (id) { return external.includes(id.split('/')[0]) || /element-ui\/lib\//.test(id) @@ -52,6 +56,9 @@ export default { { src: 'src/styles/neumorphism/*', dest: 'lib/styles/neumorphism' } ] }), + multiInput({ + relative: 'src/' + }), typescript({ typescript: require('typescript'), objectHashIgnoreUnknownHack: true, @@ -69,7 +76,19 @@ export default { resolve(), terser(), del({ - targets: ['lib/styles/index.d.ts', 'lib/soramitsu-js-ui.esm.css'], + targets: [ + 'lib/styles/index.d.ts', + 'bundle.css' + // TODO: find a way how to remove this dependencies + // 'lib/BorderRadiusMixin-**.js', + // 'lib/SizeMixin-**.js', + // 'lib/DesignSystem-**.js', + // 'lib/DesignSystemInject-**.js', + // 'lib/normalize-component-**.js', + // 'lib/components-**.js', + // 'lib/consts-**.js', + // 'lib/index-**.js' + ], hook: 'writeBundle' }) ] diff --git a/package.json b/package.json index 004bd2a7..5d4254a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "1.0.2", + "version": "1.0.3", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu/" @@ -13,9 +13,9 @@ } ], "author": "Stefan Popov ", - "main": "./lib/soramitsu-js-ui.umd.js", - "module": "./lib/soramitsu-js-ui.esm.js", - "unpkg": "./lib/soramitsu-js-ui.min.js", + "main": "./lib/index.js", + "module": "./lib/index.js", + "unpkg": "./lib/index.js", "typings": "./lib/index.d.ts", "scripts": { "build": "rm -rf lib && rollup -c ./build/rollup.config.js", @@ -75,6 +75,7 @@ "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-copy": "^3.4.0", "rollup-plugin-delete": "^1.1.0", + "rollup-plugin-multi-input": "^1.3.1", "rollup-plugin-scss": "^2.5.0", "rollup-plugin-terser": "^5.1.2", "rollup-plugin-typescript2": "^0.25.2", @@ -94,7 +95,6 @@ }, "files": [ "lib/*", - "src/*", "*.json", "*.js" ], diff --git a/src/components/Card/SCard/SCard.vue b/src/components/Card/SCard/SCard.vue index 1c3f1af4..4bd10c18 100644 --- a/src/components/Card/SCard/SCard.vue +++ b/src/components/Card/SCard/SCard.vue @@ -20,7 +20,6 @@ import BorderRadiusMixin from '../../../mixins/BorderRadiusMixin' import SizeMixin from '../../../mixins/SizeMixin' import StatusMixin from '../../../mixins/StatusMixin' import { CardShadow } from '../consts' -import { BorderRadius } from '../../../types' @Component({ components: { ElCard } @@ -48,8 +47,6 @@ export default class SCard extends Mixins(BorderRadiusMixin, SizeMixin, StatusMi * `false` by default */ @Prop({ default: false, type: Boolean }) readonly clickable!: boolean - - @Prop({ default: BorderRadius.MEDIUM }) borderRadius!: string /** * Does card should looks like it's under surface (inner shadow) */ diff --git a/src/components/DesignSystem/DesignSystemInject.ts b/src/components/DesignSystem/DesignSystemInject.ts index 6adbb16f..24ca84cd 100644 --- a/src/components/DesignSystem/DesignSystemInject.ts +++ b/src/components/DesignSystem/DesignSystemInject.ts @@ -1,6 +1,6 @@ import { Component, Vue, Inject, Prop } from 'vue-property-decorator' import { DesignSystemProvideKey } from './consts' -import { DesignSystem } from '../../utils/DesignSystem' +import DesignSystem from '../../types/DesignSystem' @Component export default class DesignSystemInject extends Vue { diff --git a/src/components/DesignSystem/SDesignSystemProvider/SDesignSystemProvider.vue b/src/components/DesignSystem/SDesignSystemProvider/SDesignSystemProvider.vue index 8c353bea..57e40ce8 100644 --- a/src/components/DesignSystem/SDesignSystemProvider/SDesignSystemProvider.vue +++ b/src/components/DesignSystem/SDesignSystemProvider/SDesignSystemProvider.vue @@ -7,7 +7,7 @@