Skip to content

Commit

Permalink
feat(pigments): rename palette to pigments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Nov 28, 2023
1 parent 8e18cf7 commit 807030e
Show file tree
Hide file tree
Showing 43 changed files with 6,220 additions and 2,484 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ Example: [`examples/vite-react/vite.config.ts`](./examples/vite-react/vite.confi
<details>
<summary>Use our theme or create yours</summary><br>

Use our default theme, [🎨 Palette](./packages/palette):
Use our default theme, [🎨 Pigments](./packages/pigments):

```ts
// vite.config.ts
export default defineConfig({
plugins: [
Pinceau({
theme: {
layers: ['@pinceau/palette']
layers: ['@pinceau/pigments']
}
})
]
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.styling/0.your-first-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ For this button, we have multiple requirements, it must:

::div{style="margin-bottom: var(--space-8);"}
::list
- Support all existing and future colors from our theme color palette
- Support all existing and future colors from our theme color pigments.
- Have `sm`, `md`, `lg` and `xl` sizes
- Support `--button-primary` and `--button-secondary` local tokens for advanced customization
- Have type-safe component properties
Expand Down
2 changes: 1 addition & 1 deletion docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineNuxtConfig({
buildDir: resolve('./node_modules/.pinceau'),
layers: [
{
path: resolve('../../packages/palette/'),
path: resolve('../../packages/pigments/'),
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@nuxt/content": "^2.9.0",
"@nuxt/devtools": "latest",
"@pinceau/nuxt": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@vueuse/motion": "^2.0.0",
"nuxt": "^3.8.1",
"nuxt-icon": "^0.6.6",
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default antfu(
'**/*.md',
'**/examples/**',
'**/package.json',
'packages/palette/output/',
'packages/pigments/output/',
'**/tests/fixtures/',
'**/tests/tmp/',
'.vscode',
Expand Down
2 changes: 1 addition & 1 deletion examples/astro-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/svelte": "^4.0.4",
"@pinceau/astro": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/svelte": "workspace:*",
"astro": "^3.5.5"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/astro-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astrojs/vue": "^3.0.4",
"@pinceau/astro": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/vue": "workspace:*",
"astro": "^3.5.5"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
},
"dependencies": {
"@pinceau/nuxt": "workspace:*",
"@pinceau/palette": "workspace:*"
"@pinceau/pigments": "workspace:*"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "nuxt": "^3.8.1"
},
"stackblitz": {
Expand Down
2 changes: 1 addition & 1 deletion examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/svelte": "workspace:*",
"@sveltejs/adapter-auto": "^2.1.1",
"@sveltejs/kit": "^1.27.6",
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"typescript": "^5.2.2",
"vite": "^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-lib/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineConfig({
theme: {
layers: [
{
path: resolve('../../packages/palette/'),
path: resolve('../../packages/pigments/'),
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/react": "workspace:*",
"@preact/preset-vite": "^2.7.0",
"@prefresh/vite": "^2.4.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/react": "workspace:*",
"@types/node": "20.9.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*", "@pinceau/react": "workspace:*",
"typescript": "^5.2.2",
"vite": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/vue": "workspace:*",
"@vitejs/plugin-vue": "^4.5.0",
Expand Down
4 changes: 3 additions & 1 deletion examples/vite-vue/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<template>
Hello World
<div :styled="{ color: '$color.red.9' }">
Hello World
</div>
</template>
8 changes: 4 additions & 4 deletions integrations/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
"require": "./react-runtime.js",
"types": "./react-runtime.d.ts"
},
"./palette": {
"import": "./palette.js",
"require": "./palette.js",
"types": "./palette.d.ts"
"./pigments": {
"import": "./pigments.js",
"require": "./pigments.js",
"types": "./pigments.d.ts"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion integrations/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@nuxt/kit": "^3.8.1",
"@pinceau/integration": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/vue": "workspace:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion integrations/repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@microsoft/api-extractor": "^7.38.3",
"@pinceau/browser": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/pigments": "workspace:*",
"@pinceau/react": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@pinceau/vue": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions integrations/repl/src/store/session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import palette from '@pinceau/palette/theme.config?raw'
import pigments from '@pinceau/pigments/theme.config?raw'
import type { ReplStore, StoreState } from '..'
import { File, importMapFile, setFile, themeFile, tsconfigFile } from '.'

Expand Down Expand Up @@ -46,8 +46,8 @@ export class SessionProvider {
// Set main file from transformer
setFile(files, this.store.transformer.defaultMainFile, this.store.transformer.welcomeCode)

// Set main theme file from palette
setFile(files, themeFile, palette)
// Set main theme file from pigments
setFile(files, themeFile, pigments)

files[tsconfigFile] = new File(tsconfigFile, JSON.stringify(this.store.transformer.tsconfig, null, 2))

Expand Down
2 changes: 1 addition & 1 deletion integrations/repl/vite.preview.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineConfig({
theme: {
layers: [
{
path: resolve('../../packages/palette/'),
path: resolve('../../packages/pigments/'),
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"docs": "nuxi dev docs",
"lint": "eslint --cache .",
"lint:fix": "eslint --cache . --fix",
"palette": "pnpm -r --filter=\"./(packages|integrations)/palette\" run build:base",
"pigments": "pnpm -r --filter=\"./(packages|integrations)/pigments\" run build:base",
"prepare": "pnpm stub",
"release": "bumpp -r package.json packages/*/package.json integrations/*/package.json",
"stub": "pnpm -r --filter=\"./(packages|integrations)/*\" run stub && pnpm -r run build:post",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getDefaultOptions(): { [key in keyof PinceauUserOptions]: any }
definitions: true,
schema: true,
imports: true,
palette: true,
pigments: true,
transformIndexHtml: true,
pinceauHtmlTag: true,
enforceHtmlInject: true,
Expand Down
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions packages/pigments/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@pinceau/pigments",
"version": "1.0.0-beta.25",
"homepage": "https://github.com/Tahul/pinceau#readme",
"bugs": {
"url": "https://github.com/Tahul/pinceau/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Tahul/pinceau.git"
},
"type": "module",
"exports": {
".": {
"types": "./theme.config.ts",
"import": "./theme.config.ts",
"require": "./theme.config.ts"
},
"./theme.config": {
"types": "./theme.config.ts",
"import": "./theme.config.ts",
"require": "./theme.config.ts"
}
},
"main": "./theme.config.ts",
"module": "./theme.config.ts",
"types": "./theme.config.ts",
"files": [
"theme.config.ts"
],
"scripts": {
"build:prepare": "pnpm run build:base",
"build:base": "vite build -c vite.config.base.ts && rm -rf dist",
"build:react": "vite build -c vite.config.react.ts && rm -rf dist",
"build:svelte": "vite build -c vite.config.svelte.ts && rm -rf dist",
"build:vue": "vite build -c vite.config.vue.ts && rm -rf dist",
"clean": "rm -rf dist"
},
"devDependencies": {
"@pinceau/core": "workspace:*",
"@pinceau/configs": "workspace:*",
"@pinceau/outputs": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@pinceau/react": "workspace:*",
"@pinceau/vue": "workspace:*",
"@pinceau/theme": "workspace:*",
"@pinceau/style": "workspace:*",
"@pinceau/runtime": "workspace:*",
"pinceau": "workspace:*",
"vite": "^5.0.0"
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default defineConfig({
},
}),
{
name: '@pinceau/palette-end',
name: '@pinceau/pigments-end',
configResolved(_config) {
config = _config
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/theme/src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ export interface PinceauThemeOptions {
definitions: boolean

/**
* Inject `@pinceau/palette` automatically
* Inject `@pinceau/pigments` automatically
*/
palette: boolean
pigments: boolean

/**
* Toggles the tranformIndexHtml hook from the theme plugin.
Expand Down
10 changes: 5 additions & 5 deletions packages/theme/src/utils/config-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ export function resolveConfigSources(
options: PinceauOptions,
ctx: PinceauContext,
) {
// Inject palette if options set to true
if (options.theme.palette) {
const paletteSource = configSourceFromModulePath('@pinceau/palette', ctx)
if (paletteSource) { options.theme.layers.push(paletteSource) }
// Inject pigments if options set to true
if (options.theme.pigments) {
const pigmentsSource = configSourceFromModulePath('@pinceau/pigments', ctx)
if (pigmentsSource) { options.theme.layers.push(pigmentsSource) }
}

let sources: ConfigLayer[] = options.theme.layers.reduce(
Expand All @@ -105,7 +105,7 @@ export function resolveConfigSources(

// Check if the config layer path passed as string in the array
if (typeof layerOrPath === 'string') {
// Supports passing a package like `@pinceau/palette`
// Supports passing a package like `@pinceau/pigments`
if (!layerOrPath.startsWith('/')) {
const resolvedModuleSource = configSourceFromModulePath(layerOrPath, ctx)
if (resolvedModuleSource) { configLayer = resolvedModuleSource }
Expand Down
Loading

1 comment on commit 807030e

@MrHBS
Copy link

@MrHBS MrHBS commented on 807030e Dec 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tahul Do you mind explaining why you did this change, ie, renaming palette to pigments.

Please sign in to comment.