Skip to content

Commit

Permalink
feat(v1): rewrite engine, make a monorepo, support react & svelte (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul authored Oct 15, 2023
1 parent ebfec1e commit c1616ac
Show file tree
Hide file tree
Showing 782 changed files with 76,348 additions and 11,403 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

13 changes: 0 additions & 13 deletions .eslintrc

This file was deleted.

60 changes: 20 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,39 @@ name: CI

on:
push:
branches:
- main

branches: ["main"]
pull_request:
branches:
- main
types: [opened, synchronize]

jobs:
lint:
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set node
uses: actions/setup-node@v3
- name: Check out code
uses: actions/checkout@v3
with:
node-version: 16.x

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci
fetch-depth: 2

- name: Lint
run: nr lint

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [14.x, 16.x]
os: [ubuntu-latest, macos-latest] # windows-latest
fail-fast: false
- uses: pnpm/[email protected]
with:
version: 8.9.0

steps:
- uses: actions/checkout@v3
- name: Set node ${{ matrix.node }}
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Setup
run: npm i -g @antfu/ni
node-version: 18
cache: 'pnpm'

- name: Install
run: nci
- run: corepack enable

- name: Prepare
run: nr prepare
- name: Install dependencies
run: pnpm install

- name: Build
run: nr build
run: pnpm build

- name: Test
run: nr test
run: pnpm test
32 changes: 30 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,44 @@ on:

jobs:
release:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm i

- name: PNPM build
run: pnpm run build

- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true

# - name: Publish to VSCE & OVSX
# run: npm run publish
# working-directory: ./packages/vscode
# env:
# VSCE_TOKEN: ${{secrets.VSCE_TOKEN}}
# OVSX_TOKEN: ${{secrets.OVSX_TOKEN}}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ coverage
# nyc test coverage
.nyc_output

# tests
.vscode-test

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

Expand Down Expand Up @@ -70,6 +73,7 @@ typings/

# Nuxt generate
dist
packages/*/dist

# vuepress build output
.vuepress/dist
Expand All @@ -86,3 +90,9 @@ dist

# vite-plugin-inspect
.vite-inspect

# vite
vite.config.ts.timestamp-*

# TurboPack
.turbo
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ignore-workspace-root-check=true
shamefully-hoist=true
auto-install-peers=true
40 changes: 40 additions & 0 deletions .vscode/export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { readFileSync, writeFileSync } from 'node:fs'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { set } from '../packages/core/dist/utils.mjs'
import { walkTokens } from '../packages/theme/dist/runtime.mjs'

const srcPath = resolve(
dirname(fileURLToPath(import.meta.url)),
'./export.json',
)

const outPath = resolve(
dirname(fileURLToPath(import.meta.url)),
'./tokens.json',
)

const exported = JSON.parse(
readFileSync(srcPath),
)['Pinceau Colors']

delete exported.name

console.log(exported)

const map = {
color: {},
}

walkTokens(
exported,
(token) => {
const tokenPath = token.name.split('/').map(p => p.toLowerCase())
set(map, `color.${tokenPath.join('.')}`, token.value)
},
)

writeFileSync(
outPath,
`${JSON.stringify(map, null, 2)}\n`,
)
Loading

0 comments on commit c1616ac

Please sign in to comment.