mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore: update guide and scripts
lint files
This commit is contained in:
parent
15185040ed
commit
a4ef8d2db3
6 changed files with 94 additions and 47 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,11 +1,15 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
### [0.71.2](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.71.0...v0.71.2) (2023-01-13)
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
<!-- ## Unreleased -->
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* some thing ([1f7a0b3](https://github.com/carbon-design-system/carbon-components-svelte/commit/1f7a0b3a30d28bf725d8d1e23a11148dfbad73d2))
|
||||||
|
|
||||||
|
### [0.71.1](https://github.com/carbon-design-system/carbon-components-svelte/compare/v0.71.0...v0.71.1) (2023-01-13)
|
||||||
|
|
||||||
## [0.71.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.71.0) - 2022-12-31
|
## [0.71.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.71.0) - 2022-12-31
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,19 @@
|
||||||
|
|
||||||
Before submitting a pull request (PR), consider [filing an issue](https://github.com/carbon-design-system/carbon-components-svelte/issues) to gain clarity and direction.
|
Before submitting a pull request (PR), consider [filing an issue](https://github.com/carbon-design-system/carbon-components-svelte/issues) to gain clarity and direction.
|
||||||
|
|
||||||
|
- [Prerequisites](#prerequisites)
|
||||||
|
- [Project set-up](#project-set-up)
|
||||||
|
- [Install](#install)
|
||||||
|
- [Documentation set-up](#documentation-set-up)
|
||||||
|
- [Development workflow](#development-workflow)
|
||||||
|
- [Component Format](#component-format)
|
||||||
|
- [Editing a component](#editing-a-component)
|
||||||
|
- [Creating a component](#creating-a-component)
|
||||||
|
- [Run `yarn build:docs`](#run-yarn-builddocs)
|
||||||
|
- [Submit a Pull Request](#submit-a-pull-request)
|
||||||
|
- [Sync Your Fork](#sync-your-fork)
|
||||||
|
- [Submit a PR](#submit-a-pr)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- [Node.js](https://nodejs.org/en/download/package-manager/) (version >=12)
|
- [Node.js](https://nodejs.org/en/download/package-manager/) (version >=12)
|
||||||
|
@ -145,3 +158,28 @@ git merge upstream/master
|
||||||
### Submit a PR
|
### Submit a PR
|
||||||
|
|
||||||
After you've pushed your changes to remote, submit your PR. Make sure you are comparing `<YOUR_USER_ID>/feature` to `origin/master`.
|
After you've pushed your changes to remote, submit your PR. Make sure you are comparing `<YOUR_USER_ID>/feature` to `origin/master`.
|
||||||
|
|
||||||
|
## Release
|
||||||
|
|
||||||
|
Locally, while on `master` and the branch is clean, run `yarn release`. This command will:
|
||||||
|
|
||||||
|
- Build library and docs
|
||||||
|
- Bump package.json version
|
||||||
|
- Add notes to Changelog
|
||||||
|
|
||||||
|
Afterwards, perform the following manually:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# 1. Stage prepared files for a commit
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# 2. Commit based on the current version, either manually or with jq
|
||||||
|
git commit -m "v$(jq -r '.version' package.json)"
|
||||||
|
|
||||||
|
# 3. Create a tag based on the current version, either manually or with `jq`:
|
||||||
|
git tag "v$(jq -r '.version' package.json)"
|
||||||
|
|
||||||
|
# 4. Push files, then publish
|
||||||
|
git push
|
||||||
|
npm publish
|
||||||
|
```
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
"build:lib": "rollup -c",
|
"build:lib": "rollup -c",
|
||||||
"format": "prettier --write \"./**/*.{svelte,js,md}\"",
|
"format": "prettier --write \"./**/*.{svelte,js,md}\"",
|
||||||
"prepack": "yarn build:docs & yarn build:lib",
|
"prepack": "yarn build:docs & yarn build:lib",
|
||||||
"release": "standard-version"
|
"release": "standard-version && yarn prepack"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"flatpickr": "4.6.9"
|
"flatpickr": "4.6.9"
|
||||||
|
@ -43,6 +43,11 @@
|
||||||
"svelte-check": "^2.8.1",
|
"svelte-check": "^2.8.1",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
|
"standard-version": {
|
||||||
|
"skip": {
|
||||||
|
"commit": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"svelteStrictMode": true
|
"svelteStrictMode": true
|
||||||
},
|
},
|
||||||
|
|
56
types/Breakpoint/breakpointObserver.d.ts
vendored
56
types/Breakpoint/breakpointObserver.d.ts
vendored
|
@ -1,28 +1,28 @@
|
||||||
import type { Readable, Subscriber, Unsubscriber } from "svelte/store";
|
import type { Readable, Subscriber, Unsubscriber } from "svelte/store";
|
||||||
import type { BreakpointSize, BreakpointValue } from "./breakpoints";
|
import type { BreakpointSize, BreakpointValue } from "./breakpoints";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a readable store that returns the current breakpoint size.
|
* Creates a readable store that returns the current breakpoint size.
|
||||||
* It also provides functions for creating derived stores used to do comparisons.
|
* It also provides functions for creating derived stores used to do comparisons.
|
||||||
*/
|
*/
|
||||||
export function breakpointObserver(): {
|
export function breakpointObserver(): {
|
||||||
subscribe: (
|
subscribe: (
|
||||||
this: void,
|
this: void,
|
||||||
run: Subscriber<any>,
|
run: Subscriber<any>,
|
||||||
invalidate?: (value?: any) => void
|
invalidate?: (value?: any) => void
|
||||||
) => Unsubscriber;
|
) => Unsubscriber;
|
||||||
/**
|
/**
|
||||||
* Returns a store readable store that returns whether the current
|
* Returns a store readable store that returns whether the current
|
||||||
* breakpoint is smaller than {@link size}.
|
* breakpoint is smaller than {@link size}.
|
||||||
* @param {BreakpointSize} size Size to compare against.
|
* @param {BreakpointSize} size Size to compare against.
|
||||||
*/
|
*/
|
||||||
smallerThan: (size: BreakpointSize) => Readable<boolean>;
|
smallerThan: (size: BreakpointSize) => Readable<boolean>;
|
||||||
/**
|
/**
|
||||||
* Returns a store readable store that returns whether the current
|
* Returns a store readable store that returns whether the current
|
||||||
* breakpoint is larger than {@link size}.
|
* breakpoint is larger than {@link size}.
|
||||||
* @param {BreakpointSize} size Size to compare against.
|
* @param {BreakpointSize} size Size to compare against.
|
||||||
*/
|
*/
|
||||||
largerThan: (size: BreakpointSize) => Readable<boolean>;
|
largerThan: (size: BreakpointSize) => Readable<boolean>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default breakpointObserver;
|
export default breakpointObserver;
|
||||||
|
|
22
types/Breakpoint/breakpoints.d.ts
vendored
22
types/Breakpoint/breakpoints.d.ts
vendored
|
@ -1,11 +1,11 @@
|
||||||
/**
|
/**
|
||||||
* Pixel sizes of Carbon grid breakpoints.
|
* Pixel sizes of Carbon grid breakpoints.
|
||||||
* @type {Record<BreakpointSize, BreakpointValue>}
|
* @type {Record<BreakpointSize, BreakpointValue>}
|
||||||
*/
|
*/
|
||||||
export const breakpoints: Record<BreakpointSize, BreakpointValue>;
|
export const breakpoints: Record<BreakpointSize, BreakpointValue>;
|
||||||
|
|
||||||
export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max";
|
export type BreakpointSize = "sm" | "md" | "lg" | "xlg" | "max";
|
||||||
|
|
||||||
export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
|
export type BreakpointValue = 320 | 672 | 1056 | 1312 | 1584;
|
||||||
|
|
||||||
export default breakpoints;
|
export default breakpoints;
|
||||||
|
|
6
types/Breakpoint/index.d.ts
vendored
6
types/Breakpoint/index.d.ts
vendored
|
@ -1,3 +1,3 @@
|
||||||
export { default as Breakpoint } from "./Breakpoint.svelte";
|
export { default as Breakpoint } from "./Breakpoint.svelte";
|
||||||
export { breakpointObserver } from "./breakpointObserver";
|
export { breakpointObserver } from "./breakpointObserver";
|
||||||
export { breakpoints } from "./breakpoints";
|
export { breakpoints } from "./breakpoints";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue