-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit removes xo linting, updates dependencies, and refactor tests to no longer require `ts-node`.
- Loading branch information
Showing
14 changed files
with
325 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
import process from 'node:process' | ||
import process from "node:process"; | ||
|
||
export type CustomValues = Record< | ||
string, | ||
{ | ||
main?: string | ||
moon?: string | ||
dawn?: string | ||
main?: string; | ||
moon?: string; | ||
dawn?: string; | ||
} | ||
> | ||
>; | ||
|
||
export type Config = { | ||
__skipReadmeVersion: boolean | ||
template: string | ||
output: string | ||
prefix: string | ||
__skipReadmeVersion: boolean; | ||
template: string; | ||
output: string; | ||
prefix: string; | ||
format: | ||
| 'hex' | ||
| 'hex-ns' | ||
| 'rgb' | ||
| 'rgb-ns' | ||
| 'rgb-array' | ||
| 'rgb-function' | ||
| 'hsl' | ||
| 'hsl-ns' | ||
| 'hsl-array' | ||
| 'hsl-function' | ||
stripSpaces: boolean | ||
watch: boolean | ||
} | ||
| "hex" | ||
| "hex-ns" | ||
| "rgb" | ||
| "rgb-ns" | ||
| "rgb-array" | ||
| "rgb-function" | ||
| "hsl" | ||
| "hsl-ns" | ||
| "hsl-array" | ||
| "hsl-function"; | ||
stripSpaces: boolean; | ||
watch: boolean; | ||
}; | ||
|
||
export type UserOptions = Partial<Config> | ||
export type UserOptions = Partial<Config>; | ||
|
||
export const resolveConfig = (flags?: UserOptions) => { | ||
const defaultConfig: Config = { | ||
__skipReadmeVersion: false, | ||
template: process.cwd() + '/source/template.json', | ||
output: process.cwd() + '/dist', | ||
prefix: '$', | ||
format: 'hex', | ||
template: process.cwd() + "/source/template.json", | ||
output: process.cwd() + "/dist", | ||
prefix: "$", | ||
format: "hex", | ||
stripSpaces: false, | ||
watch: false, | ||
} | ||
}; | ||
|
||
return Object.assign(defaultConfig, flags) | ||
} | ||
return Object.assign(defaultConfig, flags); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import {resolveConfig, type UserOptions} from './config.js' | ||
import {watch} from './watch.js' | ||
import {getPackageVersion} from './utils/get-package-version.js' | ||
import {generateVariants} from './utils/generate-variants.js' | ||
import {updateReadmeVersion} from './utils/update-readme-version.js' | ||
import { resolveConfig, type UserOptions } from "./config.js"; | ||
import { watch } from "./watch.js"; | ||
import { getPackageVersion } from "./utils/get-package-version.js"; | ||
import { generateVariants } from "./utils/generate-variants.js"; | ||
import { updateReadmeVersion } from "./utils/update-readme-version.js"; | ||
|
||
export const build = async (flags?: UserOptions) => { | ||
const config = resolveConfig(flags) | ||
const config = resolveConfig(flags); | ||
|
||
generateVariants(config) | ||
generateVariants(config); | ||
|
||
if (!config.__skipReadmeVersion) { | ||
const version = getPackageVersion() | ||
updateReadmeVersion(version, flags) | ||
const version = getPackageVersion(); | ||
updateReadmeVersion(version, flags); | ||
} | ||
|
||
if (config.watch) { | ||
console.log('👀 Waiting for changes...\n') | ||
await watch(config) | ||
console.log("👀 Waiting for changes...\n"); | ||
await watch(config); | ||
} | ||
} | ||
}; | ||
|
||
export default build | ||
export default build; |
Oops, something went wrong.