mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
chore: improve workflows
- Add standard-version to automate version bumping, adding tag, and writing changelog - remove husky - add lint script - update CI pipeline to include linting for pull requests - format yet-linted files - add Enrico to contributors
This commit is contained in:
parent
c1c8309443
commit
15185040ed
7 changed files with 1072 additions and 413 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
@ -17,8 +17,9 @@ jobs:
|
|||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- name: Install dependencies and build the library
|
||||
- name: Install dependencies, build, test, and lint the codebase
|
||||
run: |
|
||||
yarn
|
||||
yarn build:lib
|
||||
yarn test:types
|
||||
yarn lint
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/lib
|
||||
/css
|
||||
/types
|
||||
.svelte-kit
|
||||
.routify
|
||||
dist
|
||||
client
|
||||
build
|
||||
*.svx
|
||||
*.svx
|
||||
|
|
16
package.json
16
package.json
|
@ -12,12 +12,13 @@
|
|||
],
|
||||
"scripts": {
|
||||
"test:types": "svelte-check --workspace tests",
|
||||
"lint": "prettier --write \"**/*.{svelte,md,js,json,ts}\"",
|
||||
"build:css": "node scripts/build-css",
|
||||
"build:docs": "node scripts/build-docs",
|
||||
"build:lib": "rollup -c",
|
||||
"prepack": "yarn build:docs & yarn build:lib",
|
||||
"format": "prettier --write \"./**/*.{svelte,js,md}\"",
|
||||
"prepare": "husky install"
|
||||
"prepack": "yarn build:docs & yarn build:lib",
|
||||
"release": "standard-version"
|
||||
},
|
||||
"dependencies": {
|
||||
"flatpickr": "4.6.9"
|
||||
|
@ -29,8 +30,6 @@
|
|||
"autoprefixer": "^10.4.8",
|
||||
"carbon-components": "10.56.0",
|
||||
"carbon-icons-svelte": "^11.2.0",
|
||||
"husky": "^8.0.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"postcss": "^8.4.16",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-svelte": "^2.7.0",
|
||||
|
@ -38,17 +37,12 @@
|
|||
"rollup-plugin-svelte": "^7.1.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"sass": "^1.49.11",
|
||||
"standard-version": "^9.5.0",
|
||||
"sveld": "^0.18.0",
|
||||
"svelte": "^3.51.0",
|
||||
"svelte-check": "^2.8.1",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{svelte,md,js,json}": [
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{svelte,js,md}": "prettier --write"
|
||||
},
|
||||
"prettier": {
|
||||
"svelteStrictMode": true
|
||||
},
|
||||
|
@ -73,6 +67,6 @@
|
|||
],
|
||||
"contributors": [
|
||||
"Eric Liu (https://github.com/metonym)",
|
||||
"Josef Aidt (https://github.com/josefaidt)"
|
||||
"Enrico Sacchetti (https://github.com/theetrain)"
|
||||
]
|
||||
}
|
||||
|
|
56
src/Breakpoint/breakpointObserver.d.ts
vendored
56
src/Breakpoint/breakpointObserver.d.ts
vendored
|
@ -1,28 +1,28 @@
|
|||
import type { Readable, Subscriber, Unsubscriber } from "svelte/store";
|
||||
import type { BreakpointSize, BreakpointValue } from "./breakpoints";
|
||||
|
||||
/**
|
||||
* Creates a readable store that returns the current breakpoint size.
|
||||
* It also provides functions for creating derived stores used to do comparisons.
|
||||
*/
|
||||
export function breakpointObserver(): {
|
||||
subscribe: (
|
||||
this: void,
|
||||
run: Subscriber<any>,
|
||||
invalidate?: (value?: any) => void
|
||||
) => Unsubscriber;
|
||||
/**
|
||||
* Returns a store readable store that returns whether the current
|
||||
* breakpoint is smaller than {@link size}.
|
||||
* @param {BreakpointSize} size Size to compare against.
|
||||
*/
|
||||
smallerThan: (size: BreakpointSize) => Readable<boolean>;
|
||||
/**
|
||||
* Returns a store readable store that returns whether the current
|
||||
* breakpoint is larger than {@link size}.
|
||||
* @param {BreakpointSize} size Size to compare against.
|
||||
*/
|
||||
largerThan: (size: BreakpointSize) => Readable<boolean>;
|
||||
};
|
||||
|
||||
export default breakpointObserver;
|
||||
import type { Readable, Subscriber, Unsubscriber } from "svelte/store";
|
||||
import type { BreakpointSize, BreakpointValue } from "./breakpoints";
|
||||
|
||||
/**
|
||||
* Creates a readable store that returns the current breakpoint size.
|
||||
* It also provides functions for creating derived stores used to do comparisons.
|
||||
*/
|
||||
export function breakpointObserver(): {
|
||||
subscribe: (
|
||||
this: void,
|
||||
run: Subscriber<any>,
|
||||
invalidate?: (value?: any) => void
|
||||
) => Unsubscriber;
|
||||
/**
|
||||
* Returns a store readable store that returns whether the current
|
||||
* breakpoint is smaller than {@link size}.
|
||||
* @param {BreakpointSize} size Size to compare against.
|
||||
*/
|
||||
smallerThan: (size: BreakpointSize) => Readable<boolean>;
|
||||
/**
|
||||
* Returns a store readable store that returns whether the current
|
||||
* breakpoint is larger than {@link size}.
|
||||
* @param {BreakpointSize} size Size to compare against.
|
||||
*/
|
||||
largerThan: (size: BreakpointSize) => Readable<boolean>;
|
||||
};
|
||||
|
||||
export default breakpointObserver;
|
||||
|
|
22
src/Breakpoint/breakpoints.d.ts
vendored
22
src/Breakpoint/breakpoints.d.ts
vendored
|
@ -1,11 +1,11 @@
|
|||
/**
|
||||
* Pixel sizes of Carbon grid breakpoints.
|
||||
* @type {Record<BreakpointSize, BreakpointValue>}
|
||||
*/
|
||||
export const breakpoints: Record<BreakpointSize, BreakpointValue>;
|
||||
|
||||
export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max";
|
||||
|
||||
export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
|
||||
|
||||
export default breakpoints;
|
||||
/**
|
||||
* Pixel sizes of Carbon grid breakpoints.
|
||||
* @type {Record<BreakpointSize, BreakpointValue>}
|
||||
*/
|
||||
export const breakpoints: Record<BreakpointSize, BreakpointValue>;
|
||||
|
||||
export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max";
|
||||
|
||||
export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
|
||||
|
||||
export default breakpoints;
|
||||
|
|
6
src/Breakpoint/index.d.ts
vendored
6
src/Breakpoint/index.d.ts
vendored
|
@ -1,3 +1,3 @@
|
|||
export { default as Breakpoint } from "./Breakpoint.svelte";
|
||||
export { breakpointObserver } from "./breakpointObserver";
|
||||
export { breakpoints } from "./breakpoints";
|
||||
export { default as Breakpoint } from "./Breakpoint.svelte";
|
||||
export { breakpointObserver } from "./breakpointObserver";
|
||||
export { breakpoints } from "./breakpoints";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue