Skip to content

Commit

Permalink
try test ink and publish 0.0.4 alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
linkb15 committed Aug 5, 2024
1 parent 30694b8 commit 3fbf553
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 128 deletions.
28 changes: 15 additions & 13 deletions packages/ink-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "borristw-ui",
"version": "0.0.3",
"version": "0.0.4-alpha-1",
"license": "MIT",
"bin": "dist/cli.js",
"type": "module",
Expand All @@ -9,6 +9,7 @@
},
"scripts": {
"build": "tsc",
"build2": "tsup source/cli.tsx",
"dev": "tsc --watch",
"ink-cli": "node dist/cli.js",
"test": "ava"
Expand All @@ -19,7 +20,18 @@
"dependencies": {
"ink": "^4.1.0",
"meow": "^11.0.0",
"strip-ansi": "^7.1.0"
"strip-ansi": "^7.1.0",
"ink-big-text": "^2.0.0",
"ink-gradient": "^3.0.0",
"ink-link": "^4.1.0",
"ink-multi-select": "^2.0.0",
"ink-progress-bar": "^3.0.0",
"ink-select-input": "^6.0.0",
"ink-spinner": "^5.0.0",
"ink-task-list": "^2.0.0",
"ink-testing-library": "^3.0.0",
"react": "^18.3.1",
"cli-spinners": "^3.1.0"
},
"devDependencies": {
"@sindresorhus/tsconfig": "^3.0.1",
Expand All @@ -29,23 +41,13 @@
"@vdemedes/prettier-config": "^2.0.1",
"ava": "^5.2.0",
"chalk": "^5.2.0",
"cli-spinners": "^3.1.0",
"eslint-config-xo-react": "^0.27.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fs-extra": "^11.2.0",
"ink-big-text": "^2.0.0",
"ink-gradient": "^3.0.0",
"ink-link": "^4.1.0",
"ink-multi-select": "^2.0.0",
"ink-progress-bar": "^3.0.0",
"ink-select-input": "^6.0.0",
"ink-spinner": "^5.0.0",
"ink-task-list": "^2.0.0",
"ink-testing-library": "^3.0.0",
"prettier": "^2.8.7",
"react": "^18.3.1",
"ts-node": "^10.9.1",
"tsup": "^8.0.2",
"type-fest": "^4.23.0",
"typescript": "^5.0.3",
"xo": "^0.53.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/ink-cli/source/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default function App({name = 'Stranger'}: Props) {

function Robot() {
const {exit} = useApp();
const [x, setX] = React.useState(1);
const [y, setY] = React.useState(1);
const [x, setX] = useState(1);
const [y, setY] = useState(1);

useInput((input, key) => {
if (input === 'q') {
Expand Down
7 changes: 7 additions & 0 deletions packages/ink-cli/source/cjs-shim.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {createRequire} from 'node:module';
import path from 'node:path';
import url from 'node:url';

globalThis.require = createRequire(import.meta.url);
globalThis.__filename = url.fileURLToPath(import.meta.url);
globalThis.__dirname = path.dirname(__filename);
5 changes: 4 additions & 1 deletion packages/ink-cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"outDir": "dist",
"strict": false,
"noUnusedLocals": false,
"module": "ESNext",
"moduleResolution": "Bundler",

"noUnusedParameters": false,

"noUnusedParameters": false
},
"include": ["source"]
}
25 changes: 25 additions & 0 deletions packages/ink-cli/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import path from 'node:path';
import {defineConfig} from 'tsup';

export default defineConfig({
minify: true,
clean: true,
shims: true,
target: 'esnext',
inject: ['./source/cjs-shim.ts'],
banner: {
js: '/* cli */',
},
tsconfig: path.resolve(__dirname, './tsconfig.json'),

// external: ['react'],
// sourcemap: true,
// dts: true,
format: ['esm'],
entry: ['source/cli.tsx'],
// esbuildOptions(options) {
// options.banner = {
// js: '"use client"',
// };
// },
});
Loading

0 comments on commit 3fbf553

Please sign in to comment.