Skip to content

Commit 2ad636f

Browse files
pnpm, turborepo, tsup, changesets, workflows, vitest
1 parent 3ad79fa commit 2ad636f

File tree

117 files changed

+5223
-14425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+5223
-14425
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["sampler", "design-sdk"]
11+
}

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, "**"]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: ".nvmrc"
23+
cache: "pnpm"
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Typecheck
29+
run: pnpm typecheck
30+
31+
- name: Build
32+
run: pnpm build
33+
34+
- name: Test
35+
run: pnpm test

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version-file: ".nvmrc"
27+
cache: "pnpm"
28+
registry-url: "https://registry.npmjs.org"
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Build packages
34+
run: pnpm build
35+
36+
- name: Create Release Pull Request or Publish
37+
id: changesets
38+
uses: changesets/action@v1
39+
with:
40+
publish: pnpm release
41+
version: pnpm changeset version
42+
commit: "chore: version packages"
43+
title: "chore: version packages"
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ yarn-debug.log*
66
yarn-error.log*
77
lerna-debug.log*
88

9-
10-
.DS_Store
11-
129
# Diagnostic reports (https://nodejs.org/api/report.html)
1310
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1411

@@ -44,8 +41,8 @@ build/Release
4441
node_modules/
4542
jspm_packages/
4643

47-
# TypeScript v1 declaration files
48-
typings/
44+
# Snowpack dependency directory (https://snowpack.dev/)
45+
web_modules/
4946

5047
# TypeScript cache
5148
*.tsbuildinfo
@@ -56,11 +53,8 @@ typings/
5653
# Optional eslint cache
5754
.eslintcache
5855

59-
# Microbundle cache
60-
.rpt2_cache/
61-
.rts2_cache_cjs/
62-
.rts2_cache_es/
63-
.rts2_cache_umd/
56+
# Optional stylelint cache
57+
.stylelintcache
6458

6559
# Optional REPL history
6660
.node_repl_history
@@ -71,30 +65,49 @@ typings/
7165
# Yarn Integrity file
7266
.yarn-integrity
7367

74-
# dotenv environment variables file
68+
# dotenv environment variable files
7569
.env
76-
.env.test
77-
.env.local
70+
.env.*
71+
!.env.example
7872

7973
# parcel-bundler cache (https://parceljs.org/)
8074
.cache
75+
.parcel-cache
8176

8277
# Next.js build output
8378
.next
79+
out
8480

8581
# Nuxt.js build / generate output
8682
.nuxt
8783
dist
84+
.output
8885

8986
# Gatsby files
9087
.cache/
91-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# Comment in the public line in if your project uses Gatsby and not Next.js
9289
# https://nextjs.org/blog/next-9-1#public-directory-support
9390
# public
9491

9592
# vuepress build output
9693
.vuepress/dist
9794

95+
# vuepress v2.x temp and cache directory
96+
.temp
97+
.cache
98+
99+
# Sveltekit cache directory
100+
.svelte-kit/
101+
102+
# vitepress build output
103+
**/.vitepress/dist
104+
105+
# vitepress cache directory
106+
**/.vitepress/cache
107+
108+
# Docusaurus cache and generated files
109+
.docusaurus
110+
98111
# Serverless directories
99112
.serverless/
100113

@@ -104,5 +117,31 @@ dist
104117
# DynamoDB Local files
105118
.dynamodb/
106119

120+
# Firebase cache directory
121+
.firebase/
122+
107123
# TernJS port file
108124
.tern-port
125+
126+
# Stores VSCode versions used for testing VSCode extensions
127+
.vscode-test
128+
129+
# yarn v3
130+
.pnp.*
131+
.yarn/*
132+
!.yarn/patches
133+
!.yarn/plugins
134+
!.yarn/releases
135+
!.yarn/sdks
136+
!.yarn/versions
137+
138+
# Vite files
139+
vite.config.js.timestamp-*
140+
vite.config.ts.timestamp-*
141+
.vite/
142+
143+
# turbo
144+
.turbo
145+
146+
# macOS
147+
.DS_Store

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

README.md

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DESIGN SDK
22

3-
> Build a single app that supports all figma, sketch, xd and bridged.
3+
> Build a single app that supports all figma, sketch and bridged.
44
55
A mid wrapper for building consistant figma & sketch & reflection plugin, with single api reference
66

@@ -11,24 +11,32 @@ A mid wrapper for building consistant figma & sketch & reflection plugin
1111
- mocks desing platform environment - faster development.
1212
- single api reference - write once, run everywhere.
1313
- reflect standard in the box - based on [reflect](https://reflect-ui.com) DSL, develop with unified api structure.
14-
- UI support - different ui feedback features by platform such as modals (xd), notify (figma) is supported by ui library
14+
- UI support - different ui feedback features by platform such as notify (figma) is supported by ui library
1515
- OOP Based design access objects
1616
- General UI Related utilities in the box
1717
- Testing supported
1818
- Provides Web based development environment
1919

20+
## Tech Stack
21+
22+
- **Package Manager**: pnpm (monorepo workspace)
23+
- **Build Tool**: tsup
24+
- **Test Framework**: vitest
25+
- **TypeScript**: ^5.3.3
26+
- **Monorepo**: Turborepo
27+
- **CI/CD**: GitHub Actions with Changesets for automated publishing
28+
2029
## Packages & Usage
2130

2231
```sh
23-
yarn add @design-sdk/<package>
32+
pnpm add @design-sdk/<package>
2433
```
2534

2635
**Packages**
2736

2837
- figma
2938
- figma-remote
3039
- figma-url
31-
- xd
3240
- sketch
3341

3442
## Are you looking for universal design converter?
@@ -44,6 +52,44 @@ Take a look at [design-file-converter](https://github.com/gridaco/design-file-co
4452

4553
- https://www.figma.com/plugin-docs/api/
4654

47-
## XD reference
55+
## Development
56+
57+
### Setup
58+
59+
```sh
60+
pnpm install
61+
```
62+
63+
### Build
64+
65+
```sh
66+
pnpm build
67+
```
68+
69+
### Test
70+
71+
```sh
72+
pnpm test
73+
```
74+
75+
### Typecheck
76+
77+
```sh
78+
pnpm typecheck
79+
```
80+
81+
### Watch Mode
82+
83+
```sh
84+
pnpm dev
85+
```
86+
87+
## Publishing
88+
89+
This repository uses [Changesets](https://github.com/changesets/changesets) for version management and automated publishing.
90+
91+
1. Create a changeset: `pnpm changeset`
92+
2. Version packages: `pnpm version` (or let CI handle it)
93+
3. Publish: `pnpm release` (or let CI handle it)
4894

49-
- https://adobexdplatform.com/plugin-docs/reference/xd-index.html
95+
Changesets automatically create version bump PRs and publish to npm when merged to main.

core-asset-repository/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Asset Repository
44

55
```bash
6-
yarn add @design-sdk/asset-repository
6+
pnpm add @design-sdk/asset-repository
77
```
88

99
```ts

core-asset-repository/lib/image-repository/image-asset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export interface ImageAsset {
2727
export class TemporaryImageAsset<
2828
P extends string = string
2929
> extends TemporaryAsset<Uint8Array> {
30-
data?: Uint8Array;
31-
url: P;
30+
declare data?: Uint8Array;
31+
declare url: P;
3232
constructor(
3333
readonly key: string,
3434
readonly hash: string,

core-asset-repository/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
"types": "dist/index.d.ts",
99
"scripts": {
1010
"clean": "rimraf dist",
11-
"build": "tsc"
11+
"dev": "tsup --watch",
12+
"build": "tsup lib/index.ts",
13+
"typecheck": "tsc --noEmit"
1214
},
1315
"dependencies": {
1416
"@base-sdk/hosting": "^0.1.2"
1517
},
1618
"devDependencies": {
17-
"@base-sdk/base": "^0.1.4",
18-
"typescript": "^4.2.4"
19+
"@base-sdk/base": "^0.1.4"
1920
},
2021
"files": [
2122
"dist",

core-asset-repository/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.build.json",
2+
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"rootDir": "lib",
55
"outDir": "./dist"

0 commit comments

Comments
 (0)