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

Release workflow improvements #1627

Merged
merged 5 commits into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/lib
/css
/types
.svelte-kit
.routify
dist
client
build
*.svx
*.svx
7 changes: 1 addition & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
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.

## [0.71.0](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.71.0) - 2022-12-31

Expand Down
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

- [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

- [Node.js](https://nodejs.org/en/download/package-manager/) (version >=12)
Expand Down Expand Up @@ -145,3 +158,30 @@ git merge upstream/master
### 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`.

## Release

theetrain marked this conversation as resolved.
Show resolved Hide resolved
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

# 5. Generate release notes on GitHub, and comment on issues and pull requests
```
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 && yarn prepack"
},
"dependencies": {
"flatpickr": "4.6.9"
Expand All @@ -29,25 +30,23 @@
"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",
"rollup": "^2.78.1",
"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"
"standard-version": {
"skip": {
"commit": true
}
},
"prettier": {
"svelteStrictMode": true
Expand All @@ -73,6 +72,6 @@
],
"contributors": [
"Eric Liu (https://github.com/metonym)",
"Josef Aidt (https://github.com/josefaidt)"
theetrain marked this conversation as resolved.
Show resolved Hide resolved
"Enrico Sacchetti (https://github.com/theetrain)"
]
}
56 changes: 28 additions & 28 deletions src/Breakpoint/breakpointObserver.d.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 11 deletions src/Breakpoint/breakpoints.d.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 3 deletions src/Breakpoint/index.d.ts
Original file line number Diff line number Diff line change
@@ -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";
56 changes: 28 additions & 28 deletions types/Breakpoint/breakpointObserver.d.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 11 deletions types/Breakpoint/breakpoints.d.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 3 deletions types/Breakpoint/index.d.ts
Original file line number Diff line number Diff line change
@@ -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