Skip to content

Commit

Permalink
Builds again entirely
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Lischke <mike@lischke-online.de>
  • Loading branch information
mike-lischke committed Dec 11, 2023
1 parent d4f13c5 commit 5fc671e
Show file tree
Hide file tree
Showing 333 changed files with 2,749 additions and 3,107 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@
],
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/no-duplicate-type-constituents": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "off",
"jsdoc/require-param-type": "off",
Expand Down
2 changes: 1 addition & 1 deletion examples/GetFileInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { java, S } from "../src";
import { java, S } from "../src/index.js";

// Example taken from https://www.w3schools.com/java/showjava.asp?filename=demo_files_get.
export class GetFileInfo {
Expand Down
2 changes: 1 addition & 1 deletion examples/HelloWorld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Mike Lischke. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { java, S } from "../src";
import { java, S } from "../src/index.js";

export class HelloWorld {
public static main(args: java.lang.String[]): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/IteratorLoop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { java, S } from "../src";
import { java, S } from "../src/index.js";

// Example taken from https://www.w3schools.com/java/tryjava.asp?filename=demo_iterator_loop.
export class IteratorLoop {
Expand Down
2 changes: 1 addition & 1 deletion examples/PrintArguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { java, S } from "../src";
import { java, S } from "../src/index.js";

export class PrintArguments {
public static main(args: java.lang.String[]): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/UseHashSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { I, java, S } from "../src";
import { I, java, S } from "../src/index.js";

// Example taken from https://www.w3schools.com/java/tryjava.asp?filename=demo_hashset_integer.
export class UseHashSet {
Expand Down
1,883 changes: 1,040 additions & 843 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,31 @@
"main": "./lib",
"author": "Mike Lischke",
"license": "MIT",
"type": "module",
"dependencies": {
"immutable": "4.3.0",
"minimatch": "9.0.1",
"minimatch": "9.0.3",
"printf": "0.6.1",
"unicode-properties": "1.4.1"
},
"devDependencies": {
"@types/jest": "29.5.1",
"@types/node": "20.2.3",
"@types/unicode-properties": "1.3.0",
"@typescript-eslint/eslint-plugin": "5.59.7",
"@typescript-eslint/parser": "5.59.7",
"eslint": "8.41.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jsdoc": "44.2.4",
"@types/jest": "29.5.11",
"@types/node": "20.10.4",
"@types/unicode-properties": "1.3.2",
"@typescript-eslint/eslint-plugin": "6.13.2",
"@typescript-eslint/parser": "6.13.2",
"eslint": "8.55.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jsdoc": "46.9.0",
"eslint-plugin-prefer-arrow": "1.2.3",
"jest": "29.5.0",
"ts-jest": "29.1.0",
"ts-node": "10.9.1",
"typescript": "5.0.4"
"jest": "29.7.0",
"ts-jest": "29.1.1",
"ts-node": "10.9.2",
"typescript": "5.3.3"
},
"scripts": {
"prepublishOnly": "npm run build && npm run test",
"hello-world": "ts-node src/runner ./examples/HelloWorld.ts",
"hello-world": "node --experimental-vm-modules --no-warnings --loader ts-node/esm src/runner.ts ./examples/HelloWorld.ts",
"build": "tsc",
"test": "jest --testMatch [ \"**/tests/**/*.spec.ts\" ] --no-coverage --watchAll=false --max-worker=1",
"test-ci": "jest --testMatch [ \"**/tests/**/*.spec.ts\" ] --no-coverage --watchAll=false --silent",
Expand Down
8 changes: 4 additions & 4 deletions src/DefaultJavaEqualityComparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { isEquatable } from "./type-guards";
import { Arrays } from "./java/util/Arrays";
import { JavaEqualityComparator } from "./JavaEqualityComparator";
import { isEquatable } from "./type-guards.js";
import { Arrays } from "./java/util/Arrays.js";
import { JavaEqualityComparator } from "./JavaEqualityComparator.js";

import { MurmurHash } from "./MurmurHash";
import { MurmurHash } from "./MurmurHash.js";

/**
* A class implementing Java's comparison semantics, which are based on object equality, that is, equality based on
Expand Down
8 changes: 4 additions & 4 deletions src/IteratorWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { JavaObject } from "./java/lang/Object";
import { UnsupportedOperationException } from "./java/lang/UnsupportedOperationException";
import { JavaIterator } from "./java/util/Iterator";
import { Consumer } from "./java/util/function";
import { JavaObject } from "./java/lang/Object.js";
import { UnsupportedOperationException } from "./java/lang/UnsupportedOperationException.js";
import { JavaIterator } from "./java/util/Iterator.js";
import { Consumer } from "./java/util/function/index.js";

/** A JRE iterator which wraps a Typescript iterator. */
export class IteratorWrapper<T> extends JavaObject implements JavaIterator<T> {
Expand Down
12 changes: 6 additions & 6 deletions src/JavaMapEntryIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { JavaObject } from "./java/lang/Object";
import { UnsupportedOperationException } from "./java/lang/UnsupportedOperationException";
import { HashMapEntry } from "./java/util/HashMapEntry";
import { JavaIterator } from "./java/util/Iterator";
import { JavaMap } from "./java/util/Map";
import { Consumer } from "./java/util/function";
import { JavaObject } from "./java/lang/Object.js";
import { UnsupportedOperationException } from "./java/lang/UnsupportedOperationException.js";
import { HashMapEntry } from "./java/util/HashMapEntry.js";
import { JavaIterator } from "./java/util/Iterator.js";
import { JavaMap } from "./java/util/Map.js";
import { Consumer } from "./java/util/function/index.js";

/** A specialized JRE iterator for Map entries, which wraps a Typescript iterator. */
export class JavaMapEntryIterator<K, V> extends JavaObject implements JavaIterator<JavaMap.Entry<K, V>> {
Expand Down
2 changes: 1 addition & 1 deletion src/MurmurHash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { isEquatable } from "./type-guards";
import { isEquatable } from "./type-guards.js";

/**
* @author Sam Harwell
Expand Down
2 changes: 1 addition & 1 deletion src/ReverseIteratorWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { JavaIterator } from "./java/util/Iterator";
import { JavaIterator } from "./java/util/Iterator.js";

/**
* This is the opposite of the IteratorWrapper class. It wraps a Java iterator (with proper modification checking)
Expand Down
32 changes: 16 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

export * as java from "./java/index";
export * as java from "./java/index.js";

export * from "./java/lang/Object";
export * from "./java/lang/String";
export * from "./java/lang/Boolean";
export * from "./java/lang/Number";
export * from "./java/lang/Object.js";
export * from "./java/lang/String.js";
export * from "./java/lang/Boolean.js";
export * from "./java/lang/Number.js";

export * from "./decorators";
export * from "./DefaultJavaEqualityComparator";
export * from "./JavaEqualityComparator";
export * from "./IteratorWrapper";
export * from "./JavaMapEntryIterator";
export * from "./MurmurHash";
export * from "./NotImplementedError";
export * from "./templates";
export * from "./resource-helpers";
export * from "./string-helpers";
export * from "./types";
export * from "./decorators.js";
export * from "./DefaultJavaEqualityComparator.js";
export * from "./JavaEqualityComparator.js";
export * from "./IteratorWrapper.js";
export * from "./JavaMapEntryIterator.js";
export * from "./MurmurHash.js";
export * from "./NotImplementedError.js";
export * from "./templates.js";
export * from "./resource-helpers.js";
export * from "./string-helpers.js";
export * from "./types.js";
16 changes: 8 additions & 8 deletions src/java/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

export * from "./lang/lang";
export * from "./util/util";
export * from "./io/io";
export * from "./nio/nio";
export * from "./text/text";
export * from "./time/time";
export * from "./security/security";
export * from "./net/net";
export * from "./lang/lang.js";
export * from "./util/util.js";
export * from "./io/io.js";
export * from "./nio/nio.js";
export * from "./text/text.js";
export * from "./time/time.js";
export * from "./security/security.js";
export * from "./net/net.js";
6 changes: 3 additions & 3 deletions src/java/io/BufferedOutputStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { IllegalArgumentException } from "../lang/IllegalArgumentException";
import { FilterOutputStream } from "./FilterOutputStream";
import { OutputStream } from "./OutputStream";
import { IllegalArgumentException } from "../lang/IllegalArgumentException.js";
import { FilterOutputStream } from "./FilterOutputStream.js";
import { OutputStream } from "./OutputStream.js";

export class BufferedOutputStream extends FilterOutputStream {

Expand Down
24 changes: 12 additions & 12 deletions src/java/io/BufferedReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { NotImplementedError } from "../../NotImplementedError";

import type { int, long } from "../../types";
import { OutOfMemoryError, StringBuilder } from "../lang";

import { IllegalArgumentException } from "../lang/IllegalArgumentException";
import { IndexOutOfBoundsException } from "../lang/IndexOutOfBoundsException";
import type { JavaString } from "../lang/String";
import { CharBuffer } from "../nio";
import type { Stream } from "../util/stream/Stream";
import { IOException } from "./IOException";
import { Reader } from "./Reader";
import { NotImplementedError } from "../../NotImplementedError.js";

import type { int, long } from "../../types.js";
import { OutOfMemoryError, StringBuilder } from "../lang/index.js";

import { IllegalArgumentException } from "../lang/IllegalArgumentException.js";
import { IndexOutOfBoundsException } from "../lang/IndexOutOfBoundsException.js";
import type { JavaString } from "../lang/String.js";
import { CharBuffer } from "../nio/index.js";
import type { Stream } from "../util/stream/Stream.js";
import { IOException } from "./IOException.js";
import { Reader } from "./Reader.js";

/**
* Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of
Expand Down
18 changes: 9 additions & 9 deletions src/java/io/BufferedWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { S } from "../../templates";
import type { int } from "../../types";
import { S } from "../../templates.js";
import type { int } from "../../types.js";

import { JavaString } from "../lang/String";
import { IllegalArgumentException } from "../lang/IllegalArgumentException";
import { IndexOutOfBoundsException } from "../lang/IndexOutOfBoundsException";
import { System } from "../lang/System";
import { IOException } from "./IOException";
import { JavaString } from "../lang/String.js";
import { IllegalArgumentException } from "../lang/IllegalArgumentException.js";
import { IndexOutOfBoundsException } from "../lang/IndexOutOfBoundsException.js";
import { System } from "../lang/System.js";
import { IOException } from "./IOException.js";

import { Writer } from "./Writer";
import { convertStringToUTF16 } from "../../string-helpers";
import { Writer } from "./Writer.js";
import { convertStringToUTF16 } from "../../string-helpers.js";

/**
* Writes text to a character-output stream, buffering characters so as to provide for the efficient writing of single
Expand Down
10 changes: 5 additions & 5 deletions src/java/io/ByteArrayOutputStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import type { int } from "../../types";
import { JavaString } from "../lang/String";
import { ByteBuffer } from "../nio/ByteBuffer";
import { Charset } from "../nio/charset";
import { OutputStream } from "./OutputStream";
import type { int } from "../../types.js";
import { JavaString } from "../lang/String.js";
import { ByteBuffer } from "../nio/ByteBuffer.js";
import { Charset } from "../nio/charset/Charset.js";
import { OutputStream } from "./OutputStream.js";

/**
* This class implements an output stream in which the data is written into a byte array. The buffer automatically
Expand Down
18 changes: 9 additions & 9 deletions src/java/io/CharArrayWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* Copyright (c) Mike Lischke. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import type { char, int } from "../../types";
import type { char, int } from "../../types.js";

import { IllegalArgumentException } from "../lang/IllegalArgumentException";
import type { CharSequence } from "../lang/CharSequence";
import { Writer } from "./Writer";
import { JavaString } from "../lang/String";
import { convertStringToUTF16 } from "../../string-helpers";
import { IndexOutOfBoundsException } from "../lang/IndexOutOfBoundsException";
import { IllegalArgumentException } from "../lang/IllegalArgumentException.js";
import type { CharSequence } from "../lang/CharSequence.js";
import { Writer } from "./Writer.js";
import { JavaString } from "../lang/String.js";
import { convertStringToUTF16 } from "../../string-helpers.js";
import { IndexOutOfBoundsException } from "../lang/IndexOutOfBoundsException.js";

/**
* This class implements a character buffer that can be used as an Writer. The buffer automatically grows when data is
Expand Down Expand Up @@ -53,7 +53,7 @@ export class CharArrayWriter extends Writer {
const length = arg?.length() ?? "null".length;
this.expandBuffer(length);

const s = arg?.toString().valueOf() ?? "null";
const s = arg?.toString().valueOf() ?? "null.js";
const text = convertStringToUTF16(s);
this.buf.set(text, this.count);

Expand All @@ -70,7 +70,7 @@ export class CharArrayWriter extends Writer {
throw new IndexOutOfBoundsException();
}

const s = csq?.toString().valueOf() ?? "null";
const s = csq?.toString().valueOf() ?? "null.js";
const text = convertStringToUTF16(s.substring(start, end));
this.buf.set(text, this.count);

Expand Down
2 changes: 1 addition & 1 deletion src/java/io/Closeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { AutoCloseable } from "../lang/AutoCloseable";
import { AutoCloseable } from "../lang/AutoCloseable.js";

export interface Closeable extends AutoCloseable {
/** Closes this stream and releases any system resources associated with it. */
Expand Down
2 changes: 1 addition & 1 deletion src/java/io/Console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import { JavaObject } from "../lang/Object";
import { JavaObject } from "../lang/Object.js";

export class JavaConsole extends JavaObject {
}
Loading

0 comments on commit 5fc671e

Please sign in to comment.