Skip to content

Commit 31577ff

Browse files
authored
chore(bundling): upgrades deps and bundling #130
2 parents 79e8edc + c850b88 commit 31577ff

File tree

13 files changed

+4440
-7835
lines changed

13 files changed

+4440
-7835
lines changed

.eslintrc.json

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"parser": "@typescript-eslint/parser",
3-
"plugins": [
4-
"svelte3",
5-
"@typescript-eslint"
6-
],
3+
"plugins": ["vitest", "@typescript-eslint"],
4+
"parserOptions": {
5+
"ecmaVersion": 2019,
6+
"sourceType": "module",
7+
"extraFileExtensions": [".svelte"]
8+
},
79
"extends": [
810
"eslint:recommended",
911
"plugin:import/recommended",
12+
"plugin:svelte/recommended",
1013
"plugin:@typescript-eslint/recommended"
1114
],
1215
"env": {
@@ -15,39 +18,24 @@
1518
},
1619
"overrides": [
1720
{
18-
"files": [
19-
"**/*.svelte"
20-
],
21-
"processor": "svelte3/svelte3",
21+
"files": ["*.svelte"],
22+
"parser": "svelte-eslint-parser",
2223
"rules": {
2324
"no-undef": "off"
25+
},
26+
"parserOptions": {
27+
"parser": "@typescript-eslint/parser"
2428
}
2529
}
2630
],
27-
"parserOptions": {
28-
"ecmaVersion": 2019,
29-
"sourceType": "module"
30-
},
3131
"rules": {
3232
"arrow-parens": 0,
33-
"curly": [
34-
2,
35-
"multi-line"
36-
],
37-
"quotes": [
38-
2,
39-
"single",
40-
"avoid-escape"
41-
],
42-
"semi": [
43-
2,
44-
"always"
45-
],
33+
"curly": [2, "multi-line"],
34+
"quotes": [2, "single", "avoid-escape"],
35+
"semi": [2, "always"],
4636
"strict": 0,
4737
"no-use-before-define": 0,
48-
"import/no-unresolved": 0
49-
},
50-
"settings": {
51-
"svelte3/typescript": true
38+
"import/no-unresolved": 0,
39+
"no-inner-declarations": 0
5240
}
5341
}

.github/workflows/checks.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ jobs:
99
name: Checking size
1010
if: "!contains(github.event.head_commit.message, '[ci skip]')"
1111
steps:
12-
- name: Checkout the repository
12+
- name: Checkout repository
1313
uses: actions/checkout@v3
1414
- name: Install pnpm
1515
uses: pnpm/action-setup@v2
1616
with:
17-
version: 7
18-
- name: Install Node.js
17+
version: 8.11
18+
- name: Install Node
1919
uses: actions/setup-node@v3
2020
with:
21-
node-version: 16
21+
node-version: 20
2222
cache: 'pnpm'
23+
registry-url: 'https://registry.npmjs.org'
2324
- name: Check size
2425
uses: andresz1/size-limit-action@master
2526
with:
@@ -33,12 +34,13 @@ jobs:
3334
- name: Install pnpm
3435
uses: pnpm/action-setup@v2
3536
with:
36-
version: 7
37-
- name: Install Node.js
37+
version: 8.11
38+
- name: Install Node
3839
uses: actions/setup-node@v3
3940
with:
40-
node-version: 16
41+
node-version: 20
4142
cache: 'pnpm'
43+
registry-url: 'https://registry.npmjs.org'
4244
- name: Install dependencies
4345
run: pnpm install
4446
- name: Check storybook

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ jobs:
1313
- name: Install pnpm
1414
uses: pnpm/action-setup@v2
1515
with:
16-
version: 7
17-
- name: Install Node.js
16+
version: 8.11
17+
- name: Install Node
1818
uses: actions/setup-node@v3
1919
with:
20-
node-version: 16
20+
node-version: 20
2121
cache: 'pnpm'
22+
registry-url: 'https://registry.npmjs.org'
2223
- name: Install dependencies
2324
run: pnpm install
2425
- name: Run tests

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
- name: Install pnpm
1313
uses: pnpm/action-setup@v2
1414
with:
15-
version: 7
16-
- name: Install Node.js
15+
version: 8.11
16+
- name: Install Node
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: 16
19+
node-version: 20
2020
cache: 'pnpm'
2121
registry-url: 'https://registry.npmjs.org'
2222
- name: Install dependencies

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ typings/
179179
# rollup.js default build output
180180
dist/
181181

182+
# ignore package bundling output
183+
.svelte-kit
184+
182185
# Uncomment the public line if your project uses Gatsby
183186
# https://nextjs.org/blog/next-9-1#public-directory-support
184187
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav

.size-limit.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ function modifyWebpackConfig(config) {
99

1010
module.exports = [
1111
{
12-
path: 'package/index.js',
12+
path: 'dist/index.js',
1313
limit: '840 B',
1414
import: '{ Chart }',
1515
modifyWebpackConfig
1616
},
1717
{
18-
path: 'package/index.js',
18+
path: 'dist/index.js',
1919
limit: '1.25 KB',
2020
import: '{ Bar }',
2121
modifyWebpackConfig
2222
},
2323
{
24-
path: 'package/index.js',
24+
path: 'dist/index.js',
2525
limit: '1.55 KB',
2626
import: '{ Bar, Bubble, Chart, Doughnut, Line, Pie, PolarArea, Radar, Scatter }',
2727
modifyWebpackConfig

.storybook/main.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
const path = require('path');
2-
const { mergeConfig } = require('vite');
3-
const preprocess = require('svelte-preprocess');
1+
import path from 'path';
2+
import preprocess from 'svelte-preprocess';
3+
import { mergeConfig } from 'vite';
44

5-
module.exports = {
6-
core: {
7-
builder: '@storybook/builder-vite',
5+
export default {
6+
stories: ['../stories/*.stories.@(js|ts)'],
7+
addons: ['@storybook/addon-essentials'],
8+
framework: {
9+
name: '@storybook/svelte-vite',
10+
options: {
11+
preprocess: preprocess(),
12+
},
813
},
914
viteFinal(config) {
1015
return mergeConfig(config, {
@@ -16,10 +21,4 @@ module.exports = {
1621
},
1722
});
1823
},
19-
svelteOptions: {
20-
preprocess: preprocess(),
21-
},
22-
stories: ['../stories/*.stories.(js|ts)'],
23-
addons: ['@storybook/addon-essentials'],
24-
framework: '@storybook/svelte',
2524
};

.storybook/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
{
22
"name": "svelte-chartjs",
3-
"type": "module",
43
"version": "3.1.2",
54
"author": "Saurav Kanchan",
65
"homepage": "https://saurav.tech/mdbsvelte/?path=/story/charts--examples",
76
"license": "MIT",
8-
"publishConfig": {
9-
"directory": "package"
10-
},
117
"keywords": [
128
"svelte",
139
"chartjs"
1410
],
11+
"type": "module",
12+
"types": "./dist/types/index.d.ts",
13+
"svelte": "./dist/index.js",
14+
"exports": {
15+
".": {
16+
"types": "./dist/types/index.d.ts",
17+
"svelte": "./dist/index.js",
18+
"import": "./dist/index.js"
19+
},
20+
"./package.json": "./package.json"
21+
},
22+
"publishConfig": {
23+
"directory": "dist"
24+
},
25+
"files": [
26+
"dist",
27+
"src"
28+
],
1529
"repository": {
1630
"type": "git",
1731
"url": "git+https://github.com/SauravKanchan/svelte-chartjs.git"
@@ -20,17 +34,18 @@
2034
"url": "https://github.com/SauravKanchan/svelte-chartjs"
2135
},
2236
"scripts": {
23-
"build": "del ./package && svelte-package && clear-package-json package/package.json -o package/package.json",
37+
"build": "svelte-package --input ./src && pnpm lint:package",
2438
"prepublishOnly": "pnpm test && pnpm build",
25-
"postpublish": "del ./package",
39+
"postpublish": "del ./dist",
2640
"commit": "cz",
2741
"format": "prettier --write 'src/**/*.{js,ts,svelte}'",
2842
"test:lint": "eslint src --ext .js,.svelte",
2943
"test:size": "size-limit",
3044
"test:unit": "vitest run --coverage",
3145
"test": "pnpm test:lint && pnpm test:unit",
32-
"start:storybook": "start-storybook -p 6006 --ci",
33-
"build:storybook": "del ./storybook-static; NODE_ENV=production build-storybook",
46+
"lint:package": "publint --strict",
47+
"start:storybook": "storybook dev -p 6006",
48+
"build:storybook": "del ./storybook-static; NODE_ENV=production storybook build -o ./storybook-static",
3449
"bumpVersion": "standard-version",
3550
"createGithubRelease": "simple-github-release",
3651
"release": "pnpm bumpVersion && git push origin master --tags && pnpm createGithubRelease",
@@ -45,46 +60,53 @@
4560
"@commitlint/config-conventional": "^17.0.2",
4661
"@commitlint/cz-commitlint": "^17.0.0",
4762
"@size-limit/preset-big-lib": "^8.0.0",
48-
"@storybook/addon-actions": "^6.5.9",
49-
"@storybook/addon-backgrounds": "^6.5.13",
50-
"@storybook/addon-docs": "^6.5.13",
51-
"@storybook/addon-essentials": "^6.5.9",
52-
"@storybook/addon-measure": "^6.5.13",
53-
"@storybook/addon-outline": "^6.5.13",
54-
"@storybook/builder-vite": "^0.3.0",
55-
"@storybook/client-api": "^6.5.13",
56-
"@storybook/client-logger": "^6.5.13",
57-
"@storybook/svelte": "^6.5.14",
58-
"@sveltejs/package": "^1.0.1",
59-
"@sveltejs/vite-plugin-svelte": "^2.0.2",
60-
"@testing-library/svelte": "^3.2.1",
61-
"@typescript-eslint/eslint-plugin": "^5.30.6",
62-
"@typescript-eslint/parser": "^5.30.6",
63-
"@vitest/coverage-c8": "^0.27.0",
63+
"@storybook/addon-actions": "^7.6.10",
64+
"@storybook/addon-backgrounds": "^7.6.10",
65+
"@storybook/addon-docs": "^7.6.10",
66+
"@storybook/addon-essentials": "^7.6.10",
67+
"@storybook/addon-measure": "^7.6.10",
68+
"@storybook/addon-outline": "^7.6.10",
69+
"@storybook/builder-vite": "^7.6.10",
70+
"@storybook/client-api": "^7.6.10",
71+
"@storybook/client-logger": "^7.6.10",
72+
"@storybook/svelte": "^7.6.10",
73+
"@storybook/svelte-vite": "^7.6.10",
74+
"@sveltejs/package": "^2.2.4",
75+
"@sveltejs/vite-plugin-svelte": "^3.0.2",
76+
"@testing-library/jest-dom": "^6.1.4",
77+
"@testing-library/svelte": "^4.0.5",
78+
"@tsconfig/svelte": "^5.0.2",
79+
"@types/node": "^20.11.10",
80+
"@typescript-eslint/eslint-plugin": "^6.19.1",
81+
"@typescript-eslint/parser": "^6.19.1",
82+
"@vitest/coverage-v8": "^1.2.2",
6483
"chart.js": "^4.1.2",
65-
"clean-publish": "^4.0.1",
6684
"commitizen": "^4.2.4",
6785
"cz-conventional-changelog": "^3.3.0",
6886
"del-cli": "^5.0.0",
69-
"eslint": "^8.18.0",
70-
"eslint-plugin-import": "^2.26.0",
71-
"eslint-plugin-svelte3": "^4.0.0",
87+
"eslint": "^8.56.0",
88+
"eslint-plugin-import": "^2.29.1",
89+
"eslint-plugin-svelte": "^2.35.1",
90+
"eslint-plugin-vitest": "^0.3.20",
7291
"jsdom": "^21.0.0",
7392
"nano-staged": "^0.8.0",
74-
"prettier": "^2.7.1",
75-
"prettier-plugin-svelte": "^2.7.0",
93+
"prettier": "^3.1.0",
94+
"prettier-plugin-svelte": "^3.1.2",
95+
"publint": "^0.2.7",
7696
"react": "^18.2.0",
7797
"react-dom": "^18.2.0",
7898
"simple-git-hooks": "^2.8.0",
7999
"simple-github-release": "^1.0.0",
80100
"size-limit": "^8.0.0",
81101
"standard-version": "^9.5.0",
82-
"svelte": "^4.0.0",
83-
"svelte-loader": "^3.1.5",
84-
"svelte-preprocess": "^5.0.0",
102+
"storybook": "^7.6.10",
103+
"svelte": "^4.2.9",
104+
"svelte-eslint-parser": "^0.33.1",
105+
"svelte-loader": "^3.1.9",
106+
"svelte-preprocess": "^5.1.3",
85107
"typescript": "^4.9.4",
86-
"vite": "^4.0.5",
87-
"vitest": "^0.27.0",
88-
"vitest-canvas-mock": "^0.2.2"
108+
"vite": "^5.0.12",
109+
"vitest": "^1.2.1",
110+
"vitest-canvas-mock": "^0.3.3"
89111
}
90112
}

0 commit comments

Comments
 (0)