@factoringplus/pl-components-pack-v3 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ > 1%
2
+ last 2 versions
3
+ not dead
package/.editorconfig ADDED
@@ -0,0 +1,7 @@
1
+ [*.{js,jsx,ts,tsx,vue}]
2
+ indent_style = space
3
+ indent_size = 2
4
+ end_of_line = lf
5
+ trim_trailing_whitespace = true
6
+ insert_final_newline = true
7
+ max_line_length = 100
@@ -0,0 +1,30 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ "stories": [
5
+ "../src/**/*.stories.mdx",
6
+ "../src/**/*.stories.@(js|jsx|ts|tsx)",
7
+ "../src/**/**/*.stories.@(js|jsx|ts|tsx)",
8
+ ],
9
+ "addons": [
10
+ "@storybook/addon-links",
11
+ "@storybook/addon-essentials"
12
+ ],
13
+ "framework": "@storybook/vue3",
14
+ webpackFinal: async (config, { configType }) => {
15
+ config.module.rules.push(
16
+ {
17
+ test: /\.mjs$/,
18
+ include: /node_modules/,
19
+ type: 'javascript/auto'
20
+ },
21
+ {
22
+ test: /\.scss$/,
23
+ use: ['style-loader', 'css-loader', 'sass-loader'],
24
+ include: path.resolve(__dirname, '../'),
25
+ }
26
+ );
27
+
28
+ return config;
29
+ },
30
+ }
@@ -0,0 +1,15 @@
1
+ import { app } from '@storybook/vue3';
2
+ import ElementPlus from 'element-plus';
3
+ import 'element-plus/dist/index.css';
4
+
5
+ app.use(ElementPlus);
6
+
7
+ export const parameters = {
8
+ actions: { argTypesRegex: "^on[A-Z].*" },
9
+ controls: {
10
+ matchers: {
11
+ color: /(background|color)$/i,
12
+ date: /Date$/,
13
+ },
14
+ },
15
+ }
@@ -0,0 +1,36 @@
1
+ import commonjs from '@rollup/plugin-commonjs'; // Конвертирование CommonJS модулей в ES6
2
+ import vue from 'rollup-plugin-vue'; // Обработка однофайловых компонентов .vue
3
+ import buble from '@rollup/plugin-buble'; // Транспиляция/добавление полифилов для умеренной поддержки браузеров
4
+ import postcss from 'rollup-plugin-postcss';
5
+
6
+ export default {
7
+ input: 'entry.js', // Путь до относительного package.json
8
+ output: {
9
+ format: 'esm',
10
+ compact: true,
11
+ file: 'dist/pl-components-pack-v3.esm.js',
12
+ },
13
+ plugins: [
14
+ commonjs(),
15
+ vue({
16
+ css: false, // Динамически внедряем CSS в тег <style>
17
+ compileTemplate: true, // Явное преобразование шаблона в рендер-функцию
18
+ }),
19
+ postcss({
20
+ minimize: true,
21
+ extract: 'styles/pl-components-pack.css',
22
+ }),
23
+ buble(), // Транспиляция в ES5
24
+ ],
25
+ external: [
26
+ 'jquery',
27
+ 'element-ui',
28
+ 'lodash',
29
+ 'axios',
30
+ 'moment',
31
+ 'sweetalert',
32
+ 'vue-infinite-loading',
33
+ 'vue-currency-input',
34
+ 'vue-resize',
35
+ ],
36
+ };
package/entry.js CHANGED
@@ -1,37 +1,35 @@
1
1
  import PlCurrency from './src/components/pl-currency/src/pl-currency.vue';
2
2
 
3
- export default PlCurrency;
3
+ // Объявление функции установки, выполняемой Vue.use()
4
+ export function install(Vue) {
5
+ if (install.installed) {
6
+ return;
7
+ }
8
+ install.installed = true;
9
+ Vue.component('PlCurrency', PlCurrency);
10
+ }
4
11
 
5
- // // Объявление функции установки, выполняемой Vue.use()
6
- // export function install(Vue) {
7
- // if (install.installed) {
8
- // return;
9
- // }
10
- // install.installed = true;
11
- // Vue.component('PlCurrency', PlCurrency);
12
- // }
13
- //
14
- // // Создание значения модуля для Vue.use()
15
- // const plugin = {
16
- // install,
17
- // };
18
- //
19
- // // Автоматическая установка, когда vue найден (например в браузере с помощью тега <script>)
20
- // let GlobalVue = null;
21
- // if (typeof window !== 'undefined') {
22
- // GlobalVue = window.Vue;
23
- // } else if (typeof global !== 'undefined') {
24
- // GlobalVue = global.Vue;
25
- // }
26
- // if (GlobalVue) {
27
- // GlobalVue.use(plugin);
28
- // }
29
- //
30
- // PlCurrency.install = install;
31
- //
32
- // // Экспорт компонента, для использования в качестве модуля (npm/webpack/etc.)
33
- // export default {
34
- // version: '0.1.0',
35
- // install,
36
- // PlCurrency,
37
- // };
12
+ // Создание значения модуля для Vue.use()
13
+ const plugin = {
14
+ install,
15
+ };
16
+
17
+ // Автоматическая установка, когда vue найден (например в браузере с помощью тега <script>)
18
+ let GlobalVue = null;
19
+ if (typeof window !== 'undefined') {
20
+ GlobalVue = window.Vue;
21
+ } else if (typeof global !== 'undefined') {
22
+ GlobalVue = global.Vue;
23
+ }
24
+ if (GlobalVue) {
25
+ GlobalVue.use(plugin);
26
+ }
27
+
28
+ PlCurrency.install = install;
29
+
30
+ // Экспорт компонента, для использования в качестве модуля (npm/webpack/etc.)
31
+ export default {
32
+ version: '0.1.2',
33
+ install,
34
+ PlCurrency,
35
+ };
package/package.json CHANGED
@@ -1,18 +1,26 @@
1
1
  {
2
2
  "name": "@factoringplus/pl-components-pack-v3",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
+ "module": "dist/pl-components-pack-v3.esm.js",
6
+ "unpkg": "dist/pl-components-pack-v3.min.js",
5
7
  "scripts": {
6
8
  "serve": "vue-cli-service serve",
7
- "build": "vue-cli-service build",
9
+ "build": "rollup --config build/rollup.config.js",
8
10
  "lint": "vue-cli-service lint",
9
11
  "storybook": "start-storybook -p 6006",
10
12
  "build-storybook": "build-storybook",
11
13
  "build-library": "vue-cli-service build --target lib --name @factoringplus/pl-components-pack-v3 ./entry.js"
12
14
  },
13
15
  "dependencies": {
16
+ "@rollup/plugin-buble": "^0.21.3",
17
+ "@rollup/plugin-commonjs": "^21.0.2",
14
18
  "core-js": "^3.6.5",
15
19
  "element-plus": "^2.0.1",
20
+ "postcss": "^8.4.7",
21
+ "rollup": "^2.68.0",
22
+ "rollup-plugin-postcss": "^4.0.2",
23
+ "rollup-plugin-vue": "^6.0.0",
16
24
  "vue": "^3.0.0",
17
25
  "vue-currency-input": "^2.4.0",
18
26
  "vue-router": "^4.0.0-0",
@@ -51,19 +59,10 @@
51
59
  ]
52
60
  },
53
61
  "description": "## Project setup ``` npm install ```",
54
- "main": ".dist/@factoringplus/pl-components-pack-v3.common.js",
55
62
  "repository": {
56
63
  "type": "git",
57
64
  "url": "https://bitbucket.izumfin.com/scm/plat/storybook3.git"
58
65
  },
59
66
  "author": "",
60
- "files": [
61
- "dist/*",
62
- "src/*",
63
- "public/*",
64
- "*.json",
65
- "*.js",
66
- "plugins/*"
67
- ],
68
67
  "license": "ISC"
69
68
  }