Skip to content
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
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/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["sampler", "design-sdk"]
}
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Typecheck
run: pnpm typecheck

- name: Build
run: pnpm build

- name: Test
run: pnpm test
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build packages
run: pnpm build

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm changeset version
commit: "chore: version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
67 changes: 53 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*


.DS_Store

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down Expand Up @@ -44,8 +41,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand All @@ -56,11 +53,8 @@ typings/
# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history
Expand All @@ -71,30 +65,49 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.local
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist
.output

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -104,5 +117,31 @@ dist
# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vite/

# turbo
.turbo

# macOS
.DS_Store
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
58 changes: 52 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DESIGN SDK

> Build a single app that supports all figma, sketch, xd and bridged.
> Build a single app that supports all figma, sketch and bridged.

A mid wrapper for building consistant figma & sketch & reflection plugin, with single api reference

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

## Tech Stack

- **Package Manager**: pnpm (monorepo workspace)
- **Build Tool**: tsup
- **Test Framework**: vitest
- **TypeScript**: ^5.3.3
- **Monorepo**: Turborepo
- **CI/CD**: GitHub Actions with Changesets for automated publishing

## Packages & Usage

```sh
yarn add @design-sdk/<package>
pnpm add @design-sdk/<package>
```

**Packages**

- figma
- figma-remote
- figma-url
- xd
- sketch

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

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

## XD reference
## Development

### Setup

```sh
pnpm install
```

### Build

```sh
pnpm build
```

### Test

```sh
pnpm test
```

### Typecheck

```sh
pnpm typecheck
```

### Watch Mode

```sh
pnpm dev
```

## Publishing

This repository uses [Changesets](https://github.com/changesets/changesets) for version management and automated publishing.

1. Create a changeset: `pnpm changeset`
2. Version packages: `pnpm version` (or let CI handle it)
3. Publish: `pnpm release` (or let CI handle it)

- https://adobexdplatform.com/plugin-docs/reference/xd-index.html
Changesets automatically create version bump PRs and publish to npm when merged to main.
2 changes: 1 addition & 1 deletion core-asset-repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Asset Repository

```bash
yarn add @design-sdk/asset-repository
pnpm add @design-sdk/asset-repository
```

```ts
Expand Down
4 changes: 2 additions & 2 deletions core-asset-repository/lib/image-repository/image-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export interface ImageAsset {
export class TemporaryImageAsset<
P extends string = string
> extends TemporaryAsset<Uint8Array> {
data?: Uint8Array;
url: P;
declare data?: Uint8Array;
declare url: P;
constructor(
readonly key: string,
readonly hash: string,
Expand Down
7 changes: 4 additions & 3 deletions core-asset-repository/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
"types": "dist/index.d.ts",
"scripts": {
"clean": "rimraf dist",
"build": "tsc"
"dev": "tsup --watch",
"build": "tsup lib/index.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@base-sdk/hosting": "^0.1.2"
},
"devDependencies": {
"@base-sdk/base": "^0.1.4",
"typescript": "^4.2.4"
"@base-sdk/base": "^0.1.4"
},
"files": [
"dist",
Expand Down
8 changes: 1 addition & 7 deletions core-asset-repository/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"rootDir": "lib",
"outDir": "./dist"
},
"include": ["./lib"],
"exclude": ["node_modules", "dist", "__test__"]
"extends": "../tsconfig.json"
}
4 changes: 3 additions & 1 deletion core-flags-dashdash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"build": "exit 0"
"clean": "rimraf dist",
"build": "exit 0",
"typecheck": "echo 'no typescript sources' && exit 0"
},
"devDependencies": {
"@types/node": "^16.10.3"
Expand Down
9 changes: 0 additions & 9 deletions core-flags/jest.config.js

This file was deleted.

Loading