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

Refactor Sync CLI for initial release #3

Merged
merged 16 commits into from
Nov 13, 2023
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
7 changes: 7 additions & 0 deletions .changeset/hot-taxis-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@design-sync/w3c-dtfm': minor
'@design-sync/utils': minor
'@design-sync/sync': minor
---

Release design sync CLI
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 21
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint
- run: pnpm test:types
- run: pnpm build
- run: pnpm vitest --coverage
- run: pnpm test
- uses: codecov/codecov-action@v3
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Changesets
on:
push:
branches:
- main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
version:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 21.x
- name: install pnpm
run: npm i pnpm@latest -g
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- name: create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions apps/cli/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
coverage
dist
4 changes: 4 additions & 0 deletions apps/cli/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@design-sync/eslint-config/node',
};
4 changes: 0 additions & 4 deletions apps/cli/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion apps/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
debug.json
src/tokens.ts
generated
96 changes: 96 additions & 0 deletions apps/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# @design-sync/sync

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
<!-- [![bundle][bundle-src]][bundle-href]
[![Codecov][codecov-src]][codecov-href] -->

Design Sync CLI

## Usage

Install package:

```sh
# npm
npm install -D @design-sync/sync

# yarn
yarn add --dev @design-sync/sync

# pnpm
pnpm install @design-sync/sync

# bun
bun install @design-sync/sync
```

Initialize:

```sh
# npm
npm run design-sync init

# yarn
yarn design-sync init

# pnpm
pnpm design-sync init

# bun
bun design-sync init
```

follow the prompt to create a `design-sync.config` file or pass `-y` to skip the prompt and use the default values.


Sync:

```sh
# npm
npm run design-sync sync

# yarn
yarn dlx design-sync sync

# pnpm
pnpm dlx design-sync sync

# bun
bun design-sync sync
```

## Configuration
WIP

## Plugins
WIP

## Schema Extensions
WIP


## Development

- Clone this repository
- Install latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`

## License

Made with 💛

Published under [MIT License](./LICENSE).

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/@design-sync/sync?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/@design-sync/sync
[npm-downloads-src]: https://img.shields.io/npm/dm/@design-sync/sync?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/@design-sync/sync
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/unjs/@design-sync/sync/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/@design-sync/sync
[bundle-src]: https://img.shields.io/bundlephobia/minzip/@design-sync/sync?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=@design-sync/sync -->
Empty file modified apps/cli/bin/design-sync.mjs
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions apps/cli/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: ['src/main'],
entries: ['src/index.ts', 'src/cli.ts'],
rollup: {
inlineDependencies: true,
emitCJS: true,
},
clean: true,
declaration: true,
externals: ['prettier'],
});
8 changes: 8 additions & 0 deletions apps/cli/design-sync.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig, vanillaExtractPlugin } from '.';

export default defineConfig({
repo: 'gh:salamaashoush/design-sync-examples#main',
out: 'generated',
tokensPath: 'tokens.json',
plugins: [vanillaExtractPlugin()],
});
Loading
Loading