Skip to content

Commit

Permalink
Fork figures package so it can be published for esm/cjs (#1388)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Simon Boudrias <admin@simonboudrias.com>
  • Loading branch information
jeffsee55 and SBoudrias committed Apr 12, 2024
1 parent 3374a2b commit 7596270
Show file tree
Hide file tree
Showing 15 changed files with 446 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/checkbox/README.md",
"dependencies": {
"@inquirer/core": "^7.1.2",
"@inquirer/figures": "^0.0.0",
"@inquirer/type": "^1.2.1",
"ansi-escapes": "^4.3.2",
"chalk": "^4.1.2",
"figures": "^3.2.0"
"chalk": "^4.1.2"
},
"devDependencies": {
"@inquirer/testing": "^2.1.15"
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@inquirer/core';
import type { PartialDeep } from '@inquirer/type';
import chalk from 'chalk';
import figures from 'figures';
import figures from '@inquirer/figures';
import ansiEscapes from 'ansi-escapes';

type CheckboxTheme = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"license": "MIT",
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/core/README.md",
"dependencies": {
"@inquirer/figures": "^0.0.0",
"@inquirer/type": "^1.2.1",
"@types/mute-stream": "^0.0.4",
"@types/node": "^20.12.4",
Expand All @@ -65,7 +66,6 @@
"chalk": "^4.1.2",
"cli-spinners": "^2.9.2",
"cli-width": "^4.1.0",
"figures": "^3.2.0",
"mute-stream": "^1.0.0",
"signal-exit": "^4.1.0",
"strip-ansi": "^6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/Separator.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import figures from 'figures';
import figures from '@inquirer/figures';

/**
* Separator object
Expand Down
78 changes: 78 additions & 0 deletions packages/figures/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "@inquirer/figures",
"version": "0.0.0",
"description": "Vendored version of figures, for CJS compatibility",
"main": "./dist/cjs/index.js",
"typings": "./dist/cjs/types/index.d.ts",
"files": [
"dist/**/*"
],
"repository": {
"type": "git",
"url": "https://github.com/SBoudrias/Inquirer.js.git"
},
"keywords": [
"answer",
"answers",
"ask",
"base",
"cli",
"command",
"command-line",
"confirm",
"enquirer",
"generate",
"generator",
"hyper",
"input",
"inquire",
"inquirer",
"interface",
"iterm",
"javascript",
"menu",
"node",
"nodejs",
"prompt",
"promptly",
"prompts",
"question",
"readline",
"scaffold",
"scaffolder",
"scaffolding",
"stdin",
"stdout",
"terminal",
"tty",
"ui",
"yeoman",
"yo",
"zsh",
"types",
"typescript"
],
"author": "Simon Boudrias <admin@simonboudrias.com>",
"license": "MIT",
"scripts": {
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
"attw": "attw --pack"
},
"engines": {
"node": ">=18"
},
"exports": {
".": {
"import": {
"types": "./dist/esm/types/index.d.mts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/cjs/types/index.d.ts",
"default": "./dist/cjs/index.js"
}
}
}
}

0 comments on commit 7596270

Please sign in to comment.