mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
build: switch to npm
This commit is contained in:
parent
465f35c0f3
commit
23d4bdec4e
8 changed files with 6993 additions and 4168 deletions
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
|
@ -9,17 +9,17 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/cache@v3
|
||||
id: yarn-cache
|
||||
id: npm-cache
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- name: Install dependencies, build, test, and lint the codebase
|
||||
run: |
|
||||
yarn
|
||||
yarn build:lib
|
||||
yarn test:types
|
||||
yarn lint
|
||||
npm i
|
||||
npm run build:lib
|
||||
npm run test:types
|
||||
npm run lint
|
||||
|
||||
- name: Trigger deploy
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
|
|
@ -10,15 +10,15 @@ Before submitting a pull request (PR), consider [filing an issue](https://github
|
|||
- [Component Format](#component-format)
|
||||
- [Editing a component](#editing-a-component)
|
||||
- [Creating a component](#creating-a-component)
|
||||
- [Run `yarn build:docs`](#run-yarn-builddocs)
|
||||
- [Run `npm run build:docs`](#run-npm-run-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)
|
||||
- [Yarn](https://classic.yarnpkg.com/en/docs/install)
|
||||
- [Node.js](https://nodejs.org/en/download/package-manager/) (version >=18)
|
||||
- [npm](https://docs.npmjs.com/cli) (bundled with Node.js)
|
||||
|
||||
## Project set-up
|
||||
|
||||
|
@ -43,7 +43,7 @@ Install the project dependencies:
|
|||
|
||||
```sh
|
||||
# carbon-components-svelte/
|
||||
yarn install
|
||||
npm install
|
||||
```
|
||||
|
||||
## Documentation set-up
|
||||
|
@ -54,7 +54,7 @@ First, create a symbolic link at the root of the project folder:
|
|||
|
||||
```sh
|
||||
# carbon-components-svelte/
|
||||
yarn link
|
||||
npm link
|
||||
```
|
||||
|
||||
Go into the `docs` folder:
|
||||
|
@ -66,8 +66,8 @@ cd docs
|
|||
Link `"carbon-components-svelte"`:
|
||||
|
||||
```sh
|
||||
yarn link "carbon-components-svelte"
|
||||
yarn install
|
||||
npm link "carbon-components-svelte"
|
||||
npm install
|
||||
```
|
||||
|
||||
If linked correctly, any change to a component in the `src` folder should be reflected in the `docs` site.
|
||||
|
@ -87,7 +87,7 @@ Preview changes to components from the `src` folder in the documentation website
|
|||
In the `docs` folder, run:
|
||||
|
||||
```sh
|
||||
yarn dev
|
||||
npm run dev
|
||||
```
|
||||
|
||||
The site should be served at `http://localhost:3000/` (or the next available port).
|
||||
|
@ -134,13 +134,13 @@ export {
|
|||
} from "./ComposedModal";
|
||||
```
|
||||
|
||||
### Run `yarn build:docs`
|
||||
### Run `npm run build:docs`
|
||||
|
||||
Run the following command to re-generate TypeScript definitions and documentation.
|
||||
|
||||
```sh
|
||||
# carbon-components-svelte/
|
||||
yarn build:docs
|
||||
npm run build:docs
|
||||
```
|
||||
|
||||
## Submit a Pull Request
|
||||
|
@ -171,11 +171,11 @@ The workflow is automatically triggered when pushing a tag that begins with `v`
|
|||
|
||||
However, maintainers must perform a few things in preparation for a release.
|
||||
|
||||
Locally, while on `master` and the branch is clean, run `yarn release`. This command will:
|
||||
Locally, while on `master` and the branch is clean, run `npm run release`. This command will:
|
||||
|
||||
- Bump the semantic version in `package.json`
|
||||
- Generate notes in `CHANGELOG.md`
|
||||
- Run `yarn build:docs` to update the generated documentation
|
||||
- Run `npm run build:docs` to update the generated documentation
|
||||
|
||||
This command will not create a commit nor tag. Afterwards, perform the following manually:
|
||||
|
||||
|
|
3144
docs/package-lock.json
generated
Normal file
3144
docs/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "yarn build:index-docs && run-p dev:*",
|
||||
"dev": "npm run build:index-docs && run-p dev:*",
|
||||
"dev:routify": "cross-env NODE_ENV=development routify run",
|
||||
"dev:svite": "vite dev",
|
||||
"build": "run-s build:*",
|
||||
|
|
1688
docs/yarn.lock
1688
docs/yarn.lock
File diff suppressed because it is too large
Load diff
3828
package-lock.json
generated
Normal file
3828
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -32,18 +32,17 @@
|
|||
"build:docs": "node scripts/build-docs",
|
||||
"build:lib": "rollup -c",
|
||||
"format": "prettier --write \"./**/*.{svelte,js,md}\"",
|
||||
"release": "standard-version && yarn build:docs"
|
||||
"release": "standard-version && npm run build:docs"
|
||||
},
|
||||
"dependencies": {
|
||||
"flatpickr": "4.6.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@carbon/styles": "^1.25.0",
|
||||
"@carbon/styles": "^1.47.0",
|
||||
"@rollup/plugin-commonjs": "^21.0.3",
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@tsconfig/svelte": "^4.0.1",
|
||||
"autoprefixer": "^10.4.8",
|
||||
"carbon-components": "10.58.12",
|
||||
"carbon-icons-svelte": "^12.1.0",
|
||||
"postcss": "^8.4.16",
|
||||
"prettier": "^2.7.1",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue