1ls 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -16
- package/dist/cli/constants.d.ts +3 -0
- package/dist/completions/1ls.bash +63 -0
- package/dist/completions/1ls.zsh +79 -0
- package/dist/completions/install-completions.sh +52 -0
- package/dist/expression/constants.d.ts +1 -0
- package/dist/expression/index.d.ts +43 -0
- package/dist/expression/utils.d.ts +5 -0
- package/dist/formats/constants.d.ts +51 -0
- package/dist/formats/csv.d.ts +4 -0
- package/dist/formats/env.d.ts +2 -0
- package/dist/formats/index.d.ts +4 -0
- package/dist/formats/ini.d.ts +2 -0
- package/dist/formats/javascript.d.ts +2 -0
- package/dist/formats/json5.d.ts +3 -0
- package/dist/formats/ndjson.d.ts +1 -0
- package/dist/formats/protobuf.d.ts +2 -0
- package/dist/formats/toml.d.ts +2 -0
- package/dist/formats/types.d.ts +41 -0
- package/dist/formats/typescript.d.ts +1 -0
- package/dist/formats/utils.d.ts +11 -0
- package/dist/formats/xml.d.ts +5 -0
- package/dist/formats/yaml.d.ts +3 -0
- package/dist/formatter/output.d.ts +1 -1
- package/dist/index.js +73 -28
- package/dist/interactive/app.d.ts +1 -0
- package/dist/interactive/builder.d.ts +10 -0
- package/dist/interactive/fuzzy.d.ts +6 -0
- package/dist/interactive/input.d.ts +7 -0
- package/dist/interactive/methods.d.ts +12 -0
- package/dist/interactive/navigator.d.ts +2 -0
- package/dist/interactive/renderer-builder.d.ts +3 -0
- package/dist/interactive/renderer.d.ts +2 -0
- package/dist/interactive/state.d.ts +5 -0
- package/dist/interactive/terminal.d.ts +19 -0
- package/dist/interactive/types.d.ts +45 -0
- package/dist/lexer/constants.d.ts +4 -0
- package/dist/{parser/lexer.d.ts → lexer/index.d.ts} +3 -1
- package/dist/navigator/json.d.ts +20 -3
- package/dist/navigator/types.d.ts +2 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/file.d.ts +24 -3
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/logger.d.ts +1 -10
- package/dist/utils/stream.d.ts +1 -1
- package/dist/utils/types.d.ts +12 -1
- package/package.json +14 -11
- package/dist/parser/parser.d.ts +0 -25
- package/dist/utils/parsers.d.ts +0 -8
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
readonly ERROR: 0;
|
|
3
|
-
readonly WARN: 1;
|
|
4
|
-
readonly INFO: 2;
|
|
5
|
-
readonly DEBUG: 3;
|
|
6
|
-
};
|
|
7
|
-
export type LogLevelType = (typeof LogLevel)[keyof typeof LogLevel];
|
|
8
|
-
export interface LogData {
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
1
|
+
import { LogLevelType, LogData } from "./types";
|
|
11
2
|
export declare class Logger {
|
|
12
3
|
private level;
|
|
13
4
|
private name;
|
package/dist/utils/stream.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { DataFormat } from "./types";
|
|
2
|
-
export declare function processInput(format?: DataFormat): Promise<
|
|
2
|
+
export declare function processInput(format?: DataFormat): Promise<unknown>;
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface GrepOptions {
|
|
|
21
21
|
maxMatches?: number;
|
|
22
22
|
showLineNumbers?: boolean;
|
|
23
23
|
context?: number;
|
|
24
|
+
verbose?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface GrepResult {
|
|
26
27
|
file: string;
|
|
@@ -29,10 +30,20 @@ export interface GrepResult {
|
|
|
29
30
|
match: string;
|
|
30
31
|
context?: string[];
|
|
31
32
|
}
|
|
32
|
-
export type DataFormat = "json" | "yaml" | "toml" | "csv" | "tsv" | "lines" | "text";
|
|
33
|
+
export type DataFormat = "json" | "json5" | "yaml" | "toml" | "xml" | "ini" | "csv" | "tsv" | "protobuf" | "javascript" | "typescript" | "env" | "ndjson" | "lines" | "text";
|
|
33
34
|
export interface ShortcutMapping {
|
|
34
35
|
short: string;
|
|
35
36
|
full: string;
|
|
36
37
|
description: string;
|
|
37
38
|
type: "array" | "object" | "string" | "any";
|
|
38
39
|
}
|
|
40
|
+
export declare const LogLevel: {
|
|
41
|
+
readonly ERROR: 0;
|
|
42
|
+
readonly WARN: 1;
|
|
43
|
+
readonly INFO: 2;
|
|
44
|
+
readonly DEBUG: 3;
|
|
45
|
+
};
|
|
46
|
+
export type LogLevelType = (typeof LogLevel)[keyof typeof LogLevel];
|
|
47
|
+
export interface LogData {
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"workspaces": [
|
|
3
|
-
"site"
|
|
4
|
-
],
|
|
5
2
|
"name": "1ls",
|
|
6
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
7
4
|
"description": "1 line script - Lightweight JSON CLI with JavaScript syntax",
|
|
8
5
|
"type": "module",
|
|
9
6
|
"main": "dist/index.js",
|
|
@@ -22,17 +19,22 @@
|
|
|
22
19
|
"files": [
|
|
23
20
|
"dist"
|
|
24
21
|
],
|
|
22
|
+
"workspaces": [
|
|
23
|
+
"app"
|
|
24
|
+
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "bun run clean && bun build ./src/cli/index.ts --outdir dist --target bun --minify && tsc --emitDeclarationOnly --outDir dist",
|
|
27
|
-
"clean": "rm -rf dist",
|
|
28
26
|
"dev": "bun run ./src/cli/index.ts",
|
|
29
|
-
"
|
|
27
|
+
"build": "rm -rf dist bin && bun build ./src/cli/index.ts --outdir dist --target bun --minify && tsc --emitDeclarationOnly --outDir dist && cp -r src/completions dist/",
|
|
28
|
+
"build:binary:all": "rm -rf dist bin && mkdir -p bin && bun build ./src/cli/index.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/1ls-darwin-arm64 && bun build ./src/cli/index.ts --compile --minify --target=bun-darwin-x64 --outfile bin/1ls-darwin-x64 && bun build ./src/cli/index.ts --compile --minify --target=bun-linux-x64 --outfile bin/1ls-linux-x64 && bun build ./src/cli/index.ts --compile --minify --target=bun-linux-arm64 --outfile bin/1ls-linux-arm64",
|
|
29
|
+
"clean": "rm -rf dist bin",
|
|
30
|
+
"prepublishOnly": "bun run build && bun run lint && bun test",
|
|
30
31
|
"test": "bun test",
|
|
31
|
-
"
|
|
32
|
+
"test:coverage": "bun test --coverage --coverage-reporter=lcov",
|
|
33
|
+
"test:integration": "bun test test/integration/",
|
|
32
34
|
"lint": "bunx oxlint src/",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"release": "release-it",
|
|
37
|
+
"prepare": "bash scripts/setup-hooks.sh"
|
|
36
38
|
},
|
|
37
39
|
"keywords": [
|
|
38
40
|
"json",
|
|
@@ -54,6 +56,7 @@
|
|
|
54
56
|
"homepage": "https://github.com/yowainwright/1ls",
|
|
55
57
|
"devDependencies": {
|
|
56
58
|
"@types/bun": "latest",
|
|
59
|
+
"release-it": "^19.0.5",
|
|
57
60
|
"turbo": "^2.3.3",
|
|
58
61
|
"typescript": "5.9.2"
|
|
59
62
|
},
|
package/dist/parser/parser.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Token, RootNode } from "../types";
|
|
2
|
-
export declare class Parser {
|
|
3
|
-
private tokens;
|
|
4
|
-
private position;
|
|
5
|
-
private current;
|
|
6
|
-
constructor(tokens: Token[]);
|
|
7
|
-
parse(): RootNode;
|
|
8
|
-
private parseExpression;
|
|
9
|
-
private parsePrimary;
|
|
10
|
-
private parseAccessChain;
|
|
11
|
-
private parseBracketAccess;
|
|
12
|
-
private parseArrayAccess;
|
|
13
|
-
private parseObjectOperation;
|
|
14
|
-
private parseIdentifierOrFunction;
|
|
15
|
-
private parseArrowFunction;
|
|
16
|
-
private parseFunctionBody;
|
|
17
|
-
private parseBinaryExpression;
|
|
18
|
-
private parseFunctionTerm;
|
|
19
|
-
private parseMethodCall;
|
|
20
|
-
private parseFunctionParams;
|
|
21
|
-
private parsePostfix;
|
|
22
|
-
private parseNumber;
|
|
23
|
-
private advance;
|
|
24
|
-
private expect;
|
|
25
|
-
}
|
package/dist/utils/parsers.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DataFormat } from "./types";
|
|
2
|
-
export declare function detectFormat(input: string): DataFormat;
|
|
3
|
-
export declare function parseLines(input: string): string[];
|
|
4
|
-
export declare function parseCSV(input: string, delimiter?: string): any[];
|
|
5
|
-
export declare function parseTSV(input: string): any[];
|
|
6
|
-
export declare function parseYAML(input: string): any;
|
|
7
|
-
export declare function parseTOML(input: string): any;
|
|
8
|
-
export declare function parseInput(input: string, format?: DataFormat): any;
|