Skip to content

Commit

Permalink
Implemented build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Elius94 committed May 20, 2022
1 parent d9985c9 commit bd164e6
Show file tree
Hide file tree
Showing 14 changed files with 23,518 additions and 2,650 deletions.
10 changes: 0 additions & 10 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@

To view the documentation for a specific component or class, click on the links below.

* [ConsoleGui](docs/ConsoleGui.md)
* [PageBuilder](docs/PageBuilder.md)
* [Screen](docs/Screen.md)
* [DoubleLayout](docs/DoubleLayout.md)
* [ButtonPopup](docs/ButtonPopup.md)
* [ConfirmPopup](docs/ConfirmPopup.md)
* [CustomPopup](docs/CustomPopup.md)
* [FileSelectorPopup](docs/FileSelectorPopup.md)
* [InputPopup](docs/InputPopup.md)
* [OptionPopup](docs/OptionPopup.md)
2 changes: 1 addition & 1 deletion docgen.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const pluginsRootDir = ["src", "src/components", "src/components/layout", "src/c

const pluginModules = pluginsRootDir.map(dir => {
return fs.readdirSync(path.join(__dirname, dir))
.filter(file => file.endsWith(".js") && !file.endsWith("index.js"))
.filter(file => file.endsWith(".ts") && !file.endsWith("index.ts"))
.map(file => path.join(__dirname, dir, file))
})

Expand Down
2 changes: 1 addition & 1 deletion examples/tcp_simulator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const modeList = ["random", "linear"]

const clientManager = new EventEmitter()

import { ConsoleManager, OptionPopup, InputPopup, PageBuilder, ButtonPopup, ConfirmPopup, CustomPopup, FileSelectorPopup } from "../dist/ConsoleGui.js"
import { ConsoleManager, OptionPopup, InputPopup, PageBuilder, ButtonPopup, ConfirmPopup, CustomPopup, FileSelectorPopup } from "../dist/index.js"
const GUI = new ConsoleManager({
title: "TCP Simulator", // Title of the console
logPageSize: 20, // Number of lines to show in logs page
Expand Down
26,067 changes: 23,450 additions & 2,617 deletions package-lock.json

Large diffs are not rendered by default.

54 changes: 45 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
{
"name": "console-gui-tools",
"version": "1.1.17",
"version": "1.1.18",
"description": "A simple library to draw option menu, text popup or other widgets and layout on a Node.js console.",
"main": "dist/ConsoleGui.js",
"type": "module",
"main": "dist/ConsoleGui.js",
"typings": "dist/ConsoleGui.d.ts",
"files": [
"dist",
"src"
],
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"module": "dist/console-gui-tools.esm.js",
"size-limit": [
{
"path": "dist/console-gui-tools.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/console-gui-tools.esm.js",
"limit": "10 KB"
}
],
"engines": {
"node": ">=14"
},
"scripts": {
"lint": "eslint . --ext .ts",
"build": "tsc",
"test": "npm run build && node ./examples/tcp_simulator.mjs",
"start": "npm run build && node lib/ConsoleGui.js",
"docsgen": "node ./docgen.cjs"
"_lint": "eslint . --ext .ts",
"_build": "tsc",
"_test": "npm run build && node ./examples/tcp_simulator.mjs",
"_start": "npm run build && node lib/ConsoleGui.js",
"docsgen": "node ./docgen.cjs",
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -42,6 +73,11 @@
"@typescript-eslint/parser": "^5.25.0",
"eslint": "^8.15.0",
"jsdoc-to-markdown": "^7.1.1",
"typescript": "^4.6.4"
"typescript": "^4.6.4",
"@size-limit/preset-small-lib": "^7.0.8",
"husky": "^8.0.1",
"size-limit": "^7.0.8",
"tsdx": "^0.14.1",
"tslib": "^2.4.0"
}
}
}
2 changes: 1 addition & 1 deletion src/components/layout/DoubleLayout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ForegroundColor } from "chalk"
import { ConsoleManager, PageBuilder } from "../../ConsoleGui.js"
import { ConsoleManager, PageBuilder } from "../../index.js"
import { StyledElement } from "../PageBuilder.js"

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/ButtonPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events"
import { ConsoleManager, KeyListenerArgs } from "../../ConsoleGui.js"
import { ConsoleManager, KeyListenerArgs } from "../../index.js"

/**
* @class ButtonPopup
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/ConfirmPopup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeyListenerArgs } from "../../ConsoleGui.js"
import { KeyListenerArgs } from "../../index.js"
import ButtonPopup from "./ButtonPopup.js"

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/CustomPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events"
import { ConsoleManager, KeyListenerArgs } from "../../ConsoleGui.js"
import { ConsoleManager, KeyListenerArgs } from "../../index.js"
import PageBuilder, { StyledElement } from "../PageBuilder.js"

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/FileSelectorPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events"
import { ConsoleManager, KeyListenerArgs } from "../../ConsoleGui.js"
import { ConsoleManager, KeyListenerArgs } from "../../index.js"
import fs from "fs"
import path from "path"

Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/InputPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events"
import { ConsoleManager, KeyListenerArgs } from "../../ConsoleGui.js"
import { ConsoleManager, KeyListenerArgs } from "../../index.js"

/**
* @class InputPopup
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/OptionPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events"
import { ConsoleManager, KeyListenerArgs } from "../../ConsoleGui.js"
import { ConsoleManager, KeyListenerArgs } from "../../index.js"

/**
* @class OptionPopup
Expand Down
File renamed without changes.
19 changes: 14 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
{
"compilerOptions": {
"target": "es6",
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
"rootDir": "./src",
"noFallthroughCasesInSwitch": true,
// interop between ESM and CJS modules. Recommended by TS
"esModuleInterop": true,
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
"skipLibCheck": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true,
"declaration": true,
"outDir": "./dist",
"strict": true,
"allowJs": false,
"sourceMap": true,
"moduleResolution": "Node",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
Expand All @@ -17,8 +27,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowSyntheticDefaultImports": true,

},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*", "lib"]
"include": ["src", "types"],
"exclude": ["node_modules", "**/__tests__/*", "dist", "examples"]
}

0 comments on commit bd164e6

Please sign in to comment.