Skip to content

Commit

Permalink
sort all library modules into their own folders
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Nov 21, 2024
1 parent f2c4e77 commit 62e7ba3
Show file tree
Hide file tree
Showing 467 changed files with 9,053 additions and 508 deletions.
3 changes: 1 addition & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"node_modules/",
"dist/",
"output/",
"examples/external/terkelg/**/*.ts",
"examples/external/cronvel/**/*.ts"
"examples/deprecated/**/*.ts"
],
"rules": {
"recommended": true,
Expand Down
5 changes: 3 additions & 2 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ export default defineBuildConfig({
declaration: true,
entries: [
{
outDir: "output",
builder: "mkdist",
input: "src",
outDir: "output",
format: "esm",
input: "src",
ext: "js",
},
],
rollup: {
emitCJS: false,
inlineDependencies: true,
esbuild: {
exclude: ["**/*.test.ts"],
target: "es2022",
minify: true,
},
Expand Down
4 changes: 1 addition & 3 deletions build.optim.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-expect-error -- TODO: Module '"C:/B/L/reliverse/relinka/node_modules/@types/fs-extra/index"' has no default export.
import fs from "fs-extra";
import path from "pathe";

import { spinnerPrompts } from "./src/main";
import { spinnerPrompts } from "~/unsorted/main";

const outputDir = path.resolve(__dirname, "output");

Expand Down Expand Up @@ -83,7 +82,6 @@ async function optimizeBuildForProduction(dir: string) {
});
}

// @ts-expect-error -- TODO: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.
await optimizeBuildForProduction(outputDir).catch((error) => {
console.error("An error occurred:", error);
process.exit(1);
Expand Down
Binary file modified bun.lockb
Binary file not shown.
33 changes: 27 additions & 6 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,67 @@
{
"version": "0.2",
"language": "en",
"import": [
"@cspell/dict-npm/cspell-ext.json"
],
"ignorePaths": [
"examples/external/cronvel"
],
"import": ["@cspell/dict-npm/cspell-ext.json"],
"ignorePaths": ["examples/deprecated"],
"words": [
"alacritty",
"alternar",
"Approximative",
"appts",
"arethetypeswrong",
"Arryn",
"astro",
"attw",
"Baratheon",
"blefnk",
"browserlist",
"browserlistrc",
"Brun",
"bumpp",
"bunp",
"bunx",
"Clooney",
"cmder",
"confirmtoggle",
"continuar",
"cristal",
"cronvel",
"datepart",
"dateparts",
"deafult",
"defu",
"deno",
"derhuerst",
"dflt",
"Doesnt",
"Dont",
"Downey",
"emojify",
"favourite",
"figliolia",
"Fireship",
"Focusable",
"forgetme",
"Geralt",
"Greyjoy",
"Gyllenhaal",
"Haha",
"hoverable",
"iife",
"invertir",
"jetbrains",
"jiejie",
"keypresses",
"Korniienko",
"Lannister",
"lazyness",
"lockb",
"madrun",
"Martell",
"Mikey",
"Misrefactored",
"mkdist",
"Mkey",
"montag",
"Nazarii",
"nenc",
Expand All @@ -61,35 +72,45 @@
"ntqry",
"nypm",
"optim",
"optionception",
"outro",
"pagedown",
"pageup",
"picocolors",
"printj",
"rawlist",
"redrun",
"relinka",
"reliverse",
"Rivia",
"rxvt",
"sbuf",
"selección",
"seleccionar",
"sentencer",
"shadcn",
"signup",
"Silverhand",
"sisteransi",
"subchoices",
"Targ",
"Targaryen",
"terkelg",
"termkit",
"tseslint",
"Tully",
"typebox",
"typecheck",
"typesafe",
"typesafety",
"Tyrell",
"unjs",
"unstub",
"valign",
"venv",
"vsprintf",
"Whoo",
"Yadxh",
"ytrewq"
]
}
4 changes: 3 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default tseslint.config(
ignores: [
"**/.{git,next,astro,wxt}/",
"**/{node_modules,dist,output,public,drizzle}/",
"examples/external/{cronvel,terkelg}/**/*.{js,ts}",
"examples/deprecated/**/*.{js,ts}",
],
},
eslint.configs.recommended,
Expand Down Expand Up @@ -69,6 +69,8 @@ export default tseslint.config(
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-deprecated": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-imports": [
"warn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ import {
showTextPrompt,
showSelectPrompt,
showMultiSelectPrompt,
} from "@/reliverse/main-prompts";
import { type UserInput } from "@/reliverse/main-schema";
} from "@/extended/modules/prompts";
import { type UserInput } from "@/extended/modules/schema";

import { rangePrompt } from "~/components/range";
import { errorHandler } from "~/utils/errors";
import { errorHandler } from "~/unsorted/utils/errors";

const hexRegEx = /(\d|[a-f])/gim;
const isHex = (value: string) =>
(value.match(hexRegEx) || []).length === value.length &&
(value.length === 3 || value.length === 6);

export async function detailedExample() {
await showStartPrompt();
Expand All @@ -50,8 +54,8 @@ export async function detailedExample() {
features,
// deps,
} satisfies UserInput;
// await showResults(userInput);
// await doSomeFunStuff(userInput);
await showResults(userInput);
await doSomeFunStuff(userInput);
await showNextStepsPrompt();
await showAnimatedText();
await showEndPrompt();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 2-mono-example.ts: A fun example of a quiz game. Inspired by CLI-game created by Fireship. The example demonstrates how to use a mono prompt() component.

import { createAsciiArt } from "~/components/ascii-art";
import { prompt } from "~/components/mono";
import { spinnerPrompts } from "~/components/spinner";
import { colorize } from "~/utils/colorize";
import { errorHandler } from "~/utils/errors";
import { createAsciiArt } from "~/unsorted/components/ascii-art";
import { prompt } from "~/unsorted/components/mono";
import { spinnerPrompts } from "~/unsorted/components/spinner";
import { colorize } from "~/unsorted/utils/colorize";
import { errorHandler } from "~/unsorted/utils/errors";

async function main() {
await prompt({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// 3-basic-example.ts: A basic example demonstrating core functionalities of @reliverse/relinka. Everything in a single file.

import { showSpinner } from "@/reliverse/main-prompts";
import { showSpinner } from "@/extended/modules/prompts";

import type { OptionalPromptOptions } from "~/types/prod";
import type { OptionalPromptOptions } from "~/unsorted/types/general";

import { numberPrompt, textPrompt } from "~/main";
import { errorHandler } from "~/utils/errors";
import { numberPrompt, textPrompt } from "~/unsorted/main";
import { errorHandler } from "~/unsorted/utils/errors";

export const basicConfig = {
titleColor: "cyanBright",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { TreeItem } from "~/utils/tree";
import type { TreeItem } from "~/unsorted/utils/tree";

import { rangePrompt } from "~/components/range";
import { relinka, createRelinka } from "~/create";
import { errorHandler } from "~/utils/errors";
import { formatTree } from "~/utils/tree";
import { rangePrompt } from "~/unsorted/components/range";
import { relinka, createRelinka } from "~/unsorted/create";
import { errorHandler } from "~/unsorted/utils/errors";
import { formatTree } from "~/unsorted/utils/tree";

import { reporterDemo } from "./reliverse/experiments/utils/index";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
select,
spinner,
text,
} from "~/components/component";
import { confirmPrompt } from "~/main";
import { errorHandler } from "~/utils/errors";
} from "~/unsorted/components/component";
import { confirmPrompt } from "~/unsorted/main";
import { errorHandler } from "~/unsorted/utils/errors";

async function main() {
console.log();
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SelectList.prototype.toggle = function (showMenu = null, noDraw = false) {
this.buttons[i].hidden = !this.showMenu;
}

// Adjust outputHeight, to avoid the list to be clickable when reduced
// We're adjusting outputHeight here to avoid the list to be clickable when reduced
this.outputHeight = this.showMenu ? this.pageHeight : 1;

if (this.showMenu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ SelectListMulti.prototype.toggle = function (showMenu = null, noDraw = false) {
this.buttons[i].hidden = !this.showMenu;
}

// Adjust outputHeight, to avoid the list to be clickable when reduced
// We're adjusting outputHeight here to avoid the list to be clickable when reduced
this.outputHeight = this.showMenu ? this.pageHeight : 1;

if (this.showMenu) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ TextTable.prototype.expand = function (contentSize, outputSize, sizeArray) {
var noBorderSize = contentSize - (this.hasBorder ? count + 1 : 0),
rate = noBorderWantedSize / noBorderSize;

// Adjust from left to right
// We're adjusting column widths from left to right
for (x = 0; x < count; x++) {
floatSize = sizeArray[x] * rate + remainder;
sizeArray[x] = Math.max(1, Math.round(floatSize));
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import prompt from "./index";
import { errorHandler } from "~/utils/errors";
import { errorHandler } from "~/unsorted/utils/errors";
let interval: number | Timer;

async function main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
// @ts-nocheck

// Definitions migrated from DefinitelyTyped.
//
// Special Thanks to: Berkay GURSOY <https://github.com/Berkays>
// Daniel Perez Alvarez <https://github.com/unindented>
// Kamontat Chantrachirathumrong <https://github.com/kamontat>
// theweirdone <https://github.com/theweirdone>
// whoaa512 <https://github.com/whoaa512>
// John Reilly <https://github.com/johnnyreilly>
// Christopher Hiller <https://github.com/boneskull>

export = prompts;

import { Readable, Writable } from "stream";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class MultiselectPrompt extends Prompt {
}
return "\n" + styledOptions.join("\n");
}
// shared with autocomleteMultiselect
// shared with autocompleteMultiselect
renderOptions(options) {
if (!this.done) {
return this.paginateOptions(options);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ $.date = (args) => toPrompt("DatePrompt", args);
*/
$.confirm = (args) => toPrompt("ConfirmPrompt", args);
/**
* List prompt, split intput string by `seperator`
* List prompt, split input string by `separator`
* @param {string} args.message Prompt message to display
* @param {string} [args.initial] Default string value
* @param {string} [args.style="default"] Render style ('default', 'password', 'invisible')
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.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as prompts from "../index";
{
type: "text",
name: "language",
message: "What langauge is the next greatest thing since sliced bread?",
message: "What language is the next greatest thing since sliced bread?",
},
{
type: (prev, values) => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import type { TSchema, Static } from "@sinclair/typebox";

import { symbol } from "@/reliverse/experiments/utils/symbols";
import { symbol } from "../utils/symbols";

import type { PromptStateDeprecated } from "~/types/dev";
import type { PromptStateDeprecated } from "~/unsorted/types/internal";

import { confirmPrompt } from "~/components/confirm-two";
import { datePrompt } from "~/components/date";
import { endPrompt } from "~/components/end";
import { nextStepsPrompt } from "~/components/next-steps";
// import { multiSelectPrompt } from "~/components/num-multi-select";
import { numberPrompt } from "~/components/number";
import { passwordPrompt } from "~/components/password-two";
import { confirmPrompt } from "~/unsorted/components/confirm-two";
import { datePrompt } from "~/unsorted/components/date";
import { endPrompt } from "~/unsorted/components/end";
import { nextStepsPrompt } from "~/unsorted/components/next-steps";
// import { multiSelectPrompt } from "~/unsorted/components/num-multi-select";
import { numberPrompt } from "~/unsorted/components/number";
import { passwordPrompt } from "~/unsorted/components/password-two";

import type { PromptOptionsWithState } from "./types-wth-state";

import { startPrompt } from "./ui/start-with-state";
import { textPrompt } from "./ui/text-with-state";

// export { createSpinner } from "~/components/spinner";
// export { createSpinner } from "~/unsorted/components/spinner";

export async function prompts<T extends TSchema>(
options: PromptOptionsWithState<T>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
PromptType,
TypographyName,
Variant,
} from "~/types/prod";
} from "~/unsorted/types/general";

export type StateDeprecated =
| "initial"
Expand Down
Loading

0 comments on commit 62e7ba3

Please sign in to comment.