Skip to content

Commit

Permalink
feat: expose list
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyleen77 committed Mar 14, 2024
1 parent 010d52f commit 97a595b
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 41 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "colorblender",
"version": "2.7.1",
"version": "2.7.4",
"description": "A powerful and fully typed color library.",
"repository": {
"type": "git",
Expand All @@ -21,6 +21,42 @@
"require": "./index.js",
"default": "./index.mjs"
},
"./list/copic": {
"types": "./list/copic.d.ts",
"import": "./list/copic.mjs",
"require": "./list/copic.js",
"default": "./list/copic.mjs"
},
"./list/hks": {
"types": "./list/hks.d.ts",
"import": "./list/hks.mjs",
"require": "./list/hks.js",
"default": "./list/hks.mjs"
},
"./list/keywords": {
"types": "./list/keywords.d.ts",
"import": "./list/keywords.mjs",
"require": "./list/keywords.js",
"default": "./list/keywords.mjs"
},
"./list/names": {
"types": "./list/names.d.ts",
"import": "./list/names.mjs",
"require": "./list/names.js",
"default": "./list/names.mjs"
},
"./list/prismacolor": {
"types": "./list/prismacolor.d.ts",
"import": "./list/prismacolor.mjs",
"require": "./list/prismacolor.js",
"default": "./list/prismacolor.mjs"
},
"./list/ral": {
"types": "./list/ral.d.ts",
"import": "./list/ral.mjs",
"require": "./list/ral.js",
"default": "./list/ral.mjs"
},
"./extensions/a11y": {
"types": "./extensions/a11y.d.ts",
"import": "./extensions/a11y.mjs",
Expand Down Expand Up @@ -127,16 +163,17 @@
},
"files": [
"*.{js,mjs,ts,map}",
"extensions/*.{js,mjs,ts,map}"
"extensions/*.{js,mjs,ts,map}",
"list/*.{js,mjs,ts,map}"
],
"husky": {
"hooks": {
"pre-commit": "npm test"
}
},
"scripts": {
"build": "rm -rf ./dist/* && rollup -c --bundleConfigAsCjs",
"start": "rollup -c -w --bundleConfigAsCjs",
"build": "rm -rf ./dist/* && node --max-old-space-size=8192 node_modules/.bin/rollup -c --bundleConfigAsCjs",
"start": "node --max-old-space-size=8192 node_modules/.bin/rollup -c -w --bundleConfigAsCjs",
"index": "tsx ./src/colorblender.ts",
"test": "jest",
"test:watch": "jest --watchAll",
Expand Down
19 changes: 19 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const plugins = (compilerOptions) => {
};

const extensionsPaths = glob.sync('./src/extensions/*.ts');
const listPaths = glob.sync('./src/list/*.ts');

export default [
{
Expand All @@ -38,6 +39,24 @@ export default [
plugins: plugins({ declaration: false }),
},

...listPaths.map((input) => ({
input,
output: {
file: `dist/list/${path.parse(input).name}.mjs`,
format: 'es',
},
plugins: plugins({ declaration: false }),
})),

...listPaths.map((input) => ({
input,
output: {
file: `dist/list/${path.parse(input).name}.js`,
format: 'cjs',
},
plugins: plugins({ declaration: false }),
})),

...extensionsPaths.map((input) => ({
input,
output: {
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/copic.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Extensions } from '../extend';
import type { CopicColor } from '../constants/copic';
import type { CopicColor } from '../list/copic';

import { listToRgb, rgbToList } from '../helpers/converters/list';
import { copic } from '../constants/copic';
import { copic } from '../list/copic';

declare module '../colorblender' {
interface Colorblender {
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/hks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Extensions } from '../extend';
import type { HksColor } from '../constants/hks';
import type { HksColor } from '../list/hks';

import { listToRgb, rgbToList } from '../helpers/converters/list';
import { hks } from '../constants/hks';
import { hks } from '../list/hks';

declare module '../colorblender' {
interface Colorblender {
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/keyword.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Extensions } from '../extend';
import type { KeywordColor } from '../constants/keywords';
import type { KeywordColor } from '../list/keywords';

import { keywords } from '../constants/keywords';
import { keywords } from '../list/keywords';
import { listToRgb, rgbToList } from '../helpers/converters/list';

declare module '../colorblender' {
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/name.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Extensions } from '../extend';
import type { NameColor } from '../constants/names';
import type { NameColor } from '../list/names';

import { names } from '../constants/names';
import { names } from '../list/names';
import { listToRgb, rgbToList } from '../helpers/converters/list';

declare module '../colorblender' {
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/prismacolor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Extensions } from '../extend';
import type { PrismaColor } from '../constants/prismacolor';
import type { PrismaColor } from '../list/prismacolor';

import { listToRgb, rgbToList } from '../helpers/converters/list';
import { prismacolor } from '../constants/prismacolor';
import { prismacolor } from '../list/prismacolor';

declare module '../colorblender' {
interface Colorblender {
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/ral.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Extensions } from '../extend';
import type { RalColor } from '../constants/ral';
import type { RalColor } from '../list/ral';

import { listToRgb, rgbToList } from '../helpers/converters/list';
import { ral } from '../constants/ral';
import { ral } from '../list/ral';

declare module '../colorblender' {
interface Colorblender {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 97a595b

Please sign in to comment.