Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(bundling): upgrades deps and bundling #130

Merged
merged 5 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 17 additions & 29 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"svelte3",
"@typescript-eslint"
],
"plugins": ["vitest", "@typescript-eslint"],
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"extraFileExtensions": [".svelte"]
},
"extends": [
"eslint:recommended",
"plugin:import/recommended",
dysfunc marked this conversation as resolved.
Show resolved Hide resolved
"plugin:svelte/recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
Expand All @@ -15,39 +18,24 @@
},
"overrides": [
{
"files": [
"**/*.svelte"
],
"processor": "svelte3/svelte3",
"files": ["*.svelte"],
"parser": "svelte-eslint-parser",
"rules": {
"no-undef": "off"
},
"parserOptions": {
"parser": "@typescript-eslint/parser"
}
}
],
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"rules": {
"arrow-parens": 0,
"curly": [
2,
"multi-line"
],
"quotes": [
2,
"single",
"avoid-escape"
],
"semi": [
2,
"always"
],
"curly": [2, "multi-line"],
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"],
"strict": 0,
"no-use-before-define": 0,
"import/no-unresolved": 0
},
"settings": {
"svelte3/typescript": true
"import/no-unresolved": 0,
"no-inner-declarations": 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this one was required so there weren't a ton of errors introduced?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was only one error, which was the one I rolled back. I figured we could always fix it later and remove the lint rule.

}
}
16 changes: 9 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ jobs:
name: Checking size
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Install Node.js
version: 8.11
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Check size
uses: andresz1/size-limit-action@master
with:
Expand All @@ -33,12 +34,13 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Install Node.js
version: 8.11
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Check storybook
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Install Node.js
version: 8.11
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Run tests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Install Node.js
version: 8.11
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ typings/
# rollup.js default build output
dist/

# ignore package bundling output
.svelte-kit

# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
Expand Down
6 changes: 3 additions & 3 deletions .size-limit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ function modifyWebpackConfig(config) {

module.exports = [
{
path: 'package/index.js',
path: 'dist/index.js',
limit: '840 B',
import: '{ Chart }',
modifyWebpackConfig
},
{
path: 'package/index.js',
path: 'dist/index.js',
limit: '1.25 KB',
import: '{ Bar }',
modifyWebpackConfig
},
{
path: 'package/index.js',
path: 'dist/index.js',
limit: '1.55 KB',
import: '{ Bar, Bubble, Chart, Doughnut, Line, Pie, PolarArea, Radar, Scatter }',
modifyWebpackConfig
Expand Down
23 changes: 11 additions & 12 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
const path = require('path');
const { mergeConfig } = require('vite');
const preprocess = require('svelte-preprocess');
import path from 'path';
import preprocess from 'svelte-preprocess';
import { mergeConfig } from 'vite';

module.exports = {
core: {
builder: '@storybook/builder-vite',
export default {
stories: ['../stories/*.stories.@(js|ts)'],
addons: ['@storybook/addon-essentials'],
framework: {
name: '@storybook/svelte-vite',
options: {
preprocess: preprocess(),
},
},
viteFinal(config) {
return mergeConfig(config, {
Expand All @@ -16,10 +21,4 @@ module.exports = {
},
});
},
svelteOptions: {
preprocess: preprocess(),
},
stories: ['../stories/*.stories.(js|ts)'],
addons: ['@storybook/addon-essentials'],
framework: '@storybook/svelte',
};
3 changes: 0 additions & 3 deletions .storybook/package.json

This file was deleted.

94 changes: 58 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
{
"name": "svelte-chartjs",
"type": "module",
"version": "3.1.2",
"author": "Saurav Kanchan",
"homepage": "https://saurav.tech/mdbsvelte/?path=/story/charts--examples",
"license": "MIT",
"publishConfig": {
"directory": "package"
},
"keywords": [
"svelte",
"chartjs"
],
"type": "module",
"types": "./dist/types/index.d.ts",
"svelte": "./dist/index.js",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"svelte": "./dist/index.js",
"import": "./dist/index.js"
},
"./package.json": "./package.json"
},
"publishConfig": {
"directory": "dist"
niemyjski marked this conversation as resolved.
Show resolved Hide resolved
},
"files": [
"dist",
"src"
],
"repository": {
"type": "git",
"url": "git+https://github.com/SauravKanchan/svelte-chartjs.git"
Expand All @@ -20,17 +34,18 @@
"url": "https://github.com/SauravKanchan/svelte-chartjs"
},
"scripts": {
"build": "del ./package && svelte-package && clear-package-json package/package.json -o package/package.json",
"build": "svelte-package --input ./src && pnpm lint:package",
"prepublishOnly": "pnpm test && pnpm build",
"postpublish": "del ./package",
"postpublish": "del ./dist",
"commit": "cz",
"format": "prettier --write 'src/**/*.{js,ts,svelte}'",
"test:lint": "eslint src --ext .js,.svelte",
"test:size": "size-limit",
"test:unit": "vitest run --coverage",
"test": "pnpm test:lint && pnpm test:unit",
"start:storybook": "start-storybook -p 6006 --ci",
"build:storybook": "del ./storybook-static; NODE_ENV=production build-storybook",
"lint:package": "publint --strict",
"start:storybook": "storybook dev -p 6006",
"build:storybook": "del ./storybook-static; NODE_ENV=production storybook build -o ./storybook-static",
"bumpVersion": "standard-version",
"createGithubRelease": "simple-github-release",
"release": "pnpm bumpVersion && git push origin master --tags && pnpm createGithubRelease",
Expand All @@ -45,46 +60,53 @@
"@commitlint/config-conventional": "^17.0.2",
"@commitlint/cz-commitlint": "^17.0.0",
"@size-limit/preset-big-lib": "^8.0.0",
"@storybook/addon-actions": "^6.5.9",
"@storybook/addon-backgrounds": "^6.5.13",
"@storybook/addon-docs": "^6.5.13",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-measure": "^6.5.13",
"@storybook/addon-outline": "^6.5.13",
"@storybook/builder-vite": "^0.3.0",
"@storybook/client-api": "^6.5.13",
"@storybook/client-logger": "^6.5.13",
"@storybook/svelte": "^6.5.14",
"@sveltejs/package": "^1.0.1",
"@sveltejs/vite-plugin-svelte": "^2.0.2",
"@testing-library/svelte": "^3.2.1",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"@vitest/coverage-c8": "^0.27.0",
"@storybook/addon-actions": "^7.6.10",
"@storybook/addon-backgrounds": "^7.6.10",
"@storybook/addon-docs": "^7.6.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-measure": "^7.6.10",
"@storybook/addon-outline": "^7.6.10",
"@storybook/builder-vite": "^7.6.10",
"@storybook/client-api": "^7.6.10",
"@storybook/client-logger": "^7.6.10",
"@storybook/svelte": "^7.6.10",
"@storybook/svelte-vite": "^7.6.10",
"@sveltejs/package": "^2.2.4",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/svelte": "^4.0.5",
"@tsconfig/svelte": "^5.0.2",
"@types/node": "^20.11.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@vitest/coverage-v8": "^1.2.2",
"chart.js": "^4.1.2",
"clean-publish": "^4.0.1",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
"del-cli": "^5.0.0",
"eslint": "^8.18.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-svelte3": "^4.0.0",
"eslint": "^8.56.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-svelte": "^2.35.1",
"eslint-plugin-vitest": "^0.3.20",
"jsdom": "^21.0.0",
"nano-staged": "^0.8.0",
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.7.0",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.2",
"publint": "^0.2.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"simple-git-hooks": "^2.8.0",
"simple-github-release": "^1.0.0",
"size-limit": "^8.0.0",
"standard-version": "^9.5.0",
"svelte": "^4.0.0",
"svelte-loader": "^3.1.5",
"svelte-preprocess": "^5.0.0",
"storybook": "^7.6.10",
"svelte": "^4.2.9",
niemyjski marked this conversation as resolved.
Show resolved Hide resolved
"svelte-eslint-parser": "^0.33.1",
"svelte-loader": "^3.1.9",
"svelte-preprocess": "^5.1.3",
"typescript": "^4.9.4",
"vite": "^4.0.5",
"vitest": "^0.27.0",
"vitest-canvas-mock": "^0.2.2"
"vite": "^5.0.12",
"vitest": "^1.2.1",
"vitest-canvas-mock": "^0.3.3"
}
}
Loading
Loading