@andrivet/z80-assembler 1.3.2 → 1.4.0
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/.editorconfig +13 -0
- package/.eslintignore +3 -0
- package/.eslintrc.json +35 -0
- package/.github/workflows/node.js.yml +47 -0
- package/.prettierignore +3 -0
- package/.prettierrc +3 -0
- package/.vscode/extensions.json +7 -0
- package/README.md +53 -27
- package/apps/.gitkeep +0 -0
- package/apps/z80-assembler-app/.eslintrc.json +18 -0
- package/apps/z80-assembler-app/index.html +16 -0
- package/apps/z80-assembler-app/postcss.config.js +24 -0
- package/apps/z80-assembler-app/project.json +70 -0
- package/apps/z80-assembler-app/public/favicon.ico +0 -0
- package/apps/z80-assembler-app/public/logo.png +0 -0
- package/apps/z80-assembler-app/public/logo192.png +0 -0
- package/apps/z80-assembler-app/public/logo512.png +0 -0
- package/apps/z80-assembler-app/public/manifest.json +25 -0
- package/apps/z80-assembler-app/public/robots.txt +3 -0
- package/apps/z80-assembler-app/src/app/app.module.css +0 -0
- package/apps/z80-assembler-app/src/app/app.tsx +122 -0
- package/apps/z80-assembler-app/src/app/binary.tsx +39 -0
- package/apps/z80-assembler-app/src/app/editor.tsx +228 -0
- package/apps/z80-assembler-app/src/app/errors.tsx +31 -0
- package/apps/z80-assembler-app/src/app/footer.tsx +20 -0
- package/apps/z80-assembler-app/src/app/header.tsx +57 -0
- package/apps/z80-assembler-app/src/app/misc.ts +13 -0
- package/apps/z80-assembler-app/src/app/opcodes.tsx +335 -0
- package/apps/z80-assembler-app/src/assets/.gitkeep +0 -0
- package/apps/z80-assembler-app/src/assets/images/logo192.png +0 -0
- package/apps/z80-assembler-app/src/main.tsx +22 -0
- package/apps/z80-assembler-app/src/styles.css +8 -0
- package/apps/z80-assembler-app/tailwind.config.js +28 -0
- package/apps/z80-assembler-app/tsconfig.app.json +22 -0
- package/apps/z80-assembler-app/tsconfig.json +21 -0
- package/apps/z80-assembler-app/tsconfig.spec.json +23 -0
- package/apps/z80-assembler-app/vite.config.ts +64 -0
- package/assets/images/compile.png +0 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/menu.png +0 -0
- package/assets/images/opcodes-load8.png +0 -0
- package/assets/images/opcodes.png +0 -0
- package/assets/images/open-dir.png +0 -0
- package/assets/images/z80-assembler-app.png +0 -0
- package/docs/assembly.md +551 -0
- package/docs/images/ZX81-0x00.png +0 -0
- package/docs/images/ZX81-0x0B.png +0 -0
- package/docs/images/ZX81-0x0C.png +0 -0
- package/docs/images/ZX81-0x0D.png +0 -0
- package/docs/images/ZX81-0x0E.png +0 -0
- package/docs/images/ZX81-0x0F.png +0 -0
- package/docs/images/ZX81-0x10.png +0 -0
- package/docs/images/ZX81-0x11.png +0 -0
- package/docs/images/ZX81-0x12.png +0 -0
- package/docs/images/ZX81-0x13.png +0 -0
- package/docs/images/ZX81-0x14.png +0 -0
- package/docs/images/ZX81-0x15.png +0 -0
- package/docs/images/ZX81-0x16.png +0 -0
- package/docs/images/ZX81-0x17.png +0 -0
- package/docs/images/ZX81-0x18.png +0 -0
- package/docs/images/ZX81-0x19.png +0 -0
- package/docs/images/ZX81-0x1A.png +0 -0
- package/docs/images/ZX81-0x1B.png +0 -0
- package/docs/images/ZX81-0x1C.png +0 -0
- package/docs/images/ZX81-0x1D.png +0 -0
- package/docs/images/ZX81-0x1E.png +0 -0
- package/docs/images/ZX81-0x1F.png +0 -0
- package/docs/images/ZX81-0x20.png +0 -0
- package/docs/images/ZX81-0x21.png +0 -0
- package/docs/images/ZX81-0x22.png +0 -0
- package/docs/images/ZX81-0x23.png +0 -0
- package/docs/images/ZX81-0x24.png +0 -0
- package/docs/images/ZX81-0x25.png +0 -0
- package/docs/images/ZX81-0x26.png +0 -0
- package/docs/images/ZX81-0x27.png +0 -0
- package/docs/images/ZX81-0x28.png +0 -0
- package/docs/images/ZX81-0x29.png +0 -0
- package/docs/images/ZX81-0x2A.png +0 -0
- package/docs/images/ZX81-0x2B.png +0 -0
- package/docs/images/ZX81-0x2C.png +0 -0
- package/docs/images/ZX81-0x2D.png +0 -0
- package/docs/images/ZX81-0x2E.png +0 -0
- package/docs/images/ZX81-0x2F.png +0 -0
- package/docs/images/ZX81-0x30.png +0 -0
- package/docs/images/ZX81-0x31.png +0 -0
- package/docs/images/ZX81-0x32.png +0 -0
- package/docs/images/ZX81-0x33.png +0 -0
- package/docs/images/ZX81-0x34.png +0 -0
- package/docs/images/ZX81-0x35.png +0 -0
- package/docs/images/ZX81-0x36.png +0 -0
- package/docs/images/ZX81-0x37.png +0 -0
- package/docs/images/ZX81-0x38.png +0 -0
- package/docs/images/ZX81-0x39.png +0 -0
- package/docs/images/ZX81-0x3A.png +0 -0
- package/docs/images/ZX81-0x3B.png +0 -0
- package/docs/images/ZX81-0x3C.png +0 -0
- package/docs/images/ZX81-0x3D.png +0 -0
- package/docs/images/ZX81-0x3E.png +0 -0
- package/docs/images/ZX81-0x3F.png +0 -0
- package/docs/images/ZX81-0x80.png +0 -0
- package/docs/images/ZX81-0x8B.png +0 -0
- package/docs/images/ZX81-0x8C.png +0 -0
- package/docs/images/ZX81-0x8D.png +0 -0
- package/docs/images/ZX81-0x8E.png +0 -0
- package/docs/images/ZX81-0x8F.png +0 -0
- package/docs/images/ZX81-0x90.png +0 -0
- package/docs/images/ZX81-0x91.png +0 -0
- package/docs/images/ZX81-0x92.png +0 -0
- package/docs/images/ZX81-0x93.png +0 -0
- package/docs/images/ZX81-0x94.png +0 -0
- package/docs/images/ZX81-0x95.png +0 -0
- package/docs/images/ZX81-0x96.png +0 -0
- package/docs/images/ZX81-0x97.png +0 -0
- package/docs/images/ZX81-0x98.png +0 -0
- package/docs/images/ZX81-0x99.png +0 -0
- package/docs/images/ZX81-0x9A.png +0 -0
- package/docs/images/ZX81-0x9B.png +0 -0
- package/docs/images/ZX81-0x9C.png +0 -0
- package/docs/images/ZX81-0x9D.png +0 -0
- package/docs/images/ZX81-0x9E.png +0 -0
- package/docs/images/ZX81-0x9F.png +0 -0
- package/docs/images/ZX81-0xA0.png +0 -0
- package/docs/images/ZX81-0xA1.png +0 -0
- package/docs/images/ZX81-0xA2.png +0 -0
- package/docs/images/ZX81-0xA3.png +0 -0
- package/docs/images/ZX81-0xA4.png +0 -0
- package/docs/images/ZX81-0xA5.png +0 -0
- package/docs/images/ZX81-0xA6.png +0 -0
- package/docs/images/ZX81-0xA7.png +0 -0
- package/docs/images/ZX81-0xA8.png +0 -0
- package/docs/images/ZX81-0xA9.png +0 -0
- package/docs/images/ZX81-0xAA.png +0 -0
- package/docs/images/ZX81-0xAB.png +0 -0
- package/docs/images/ZX81-0xAC.png +0 -0
- package/docs/images/ZX81-0xAD.png +0 -0
- package/docs/images/ZX81-0xAE.png +0 -0
- package/docs/images/ZX81-0xAF.png +0 -0
- package/docs/images/ZX81-0xB0.png +0 -0
- package/docs/images/ZX81-0xB1.png +0 -0
- package/docs/images/ZX81-0xB2.png +0 -0
- package/docs/images/ZX81-0xB3.png +0 -0
- package/docs/images/ZX81-0xB4.png +0 -0
- package/docs/images/ZX81-0xB5.png +0 -0
- package/docs/images/ZX81-0xB6.png +0 -0
- package/docs/images/ZX81-0xB7.png +0 -0
- package/docs/images/ZX81-0xB8.png +0 -0
- package/docs/images/ZX81-0xB9.png +0 -0
- package/docs/images/ZX81-0xBA.png +0 -0
- package/docs/images/ZX81-0xBB.png +0 -0
- package/docs/images/ZX81-0xBC.png +0 -0
- package/docs/images/ZX81-0xBD.png +0 -0
- package/docs/images/ZX81-0xBE.png +0 -0
- package/docs/images/ZX81-0xBF.png +0 -0
- package/libs/.gitkeep +0 -0
- package/libs/z80-assembler/.eslintrc.json +18 -0
- package/libs/z80-assembler/package.json +20 -0
- package/libs/z80-assembler/project.json +35 -0
- package/libs/z80-assembler/public/README.md +54 -0
- package/{index.d.ts → libs/z80-assembler/src/index.ts} +1 -1
- package/libs/z80-assembler/src/lib/assets/code/basic-end.zx81 +4 -0
- package/libs/z80-assembler/src/lib/assets/code/basic-line1.zx81 +4 -0
- package/libs/z80-assembler/src/lib/assets/code/basic-line2.zx81 +9 -0
- package/libs/z80-assembler/src/lib/assets/code/characters.zx81 +190 -0
- package/libs/z80-assembler/src/lib/assets/code/display.zx81 +50 -0
- package/libs/z80-assembler/src/lib/assets/code/system-variables.zx81 +46 -0
- package/{lib/compiler/Assets.d.ts → libs/z80-assembler/src/lib/compiler/Assets.ts} +6 -1
- package/libs/z80-assembler/src/lib/compiler/Ast.ts +545 -0
- package/libs/z80-assembler/src/lib/compiler/Compiler.test.ts +2141 -0
- package/libs/z80-assembler/src/lib/compiler/Compiler.ts +185 -0
- package/libs/z80-assembler/src/lib/compiler/Formatter.ts +43 -0
- package/libs/z80-assembler/src/lib/compiler/Generator.ts +255 -0
- package/libs/z80-assembler/src/lib/compiler/Labels.ts +165 -0
- package/libs/z80-assembler/src/lib/grammar/LowLevel.ts +163 -0
- package/libs/z80-assembler/src/lib/grammar/Parse.ts +128 -0
- package/libs/z80-assembler/src/lib/grammar/z80.peg +1252 -0
- package/libs/z80-assembler/src/lib/grammar/z80.ts +10649 -0
- package/libs/z80-assembler/src/lib/types/Error.ts +105 -0
- package/{lib/types/Types.d.ts → libs/z80-assembler/src/lib/types/Types.ts} +26 -11
- package/libs/z80-assembler/tsconfig.json +23 -0
- package/libs/z80-assembler/tsconfig.lib.json +10 -0
- package/libs/z80-assembler/tsconfig.spec.json +19 -0
- package/libs/z80-assembler/vite.config.ts +58 -0
- package/nx.json +57 -0
- package/package.json +52 -14
- package/tsconfig.base.json +22 -0
- package/index.js +0 -312
- package/index.mjs +0 -6441
- package/lib/compiler/Ast.d.ts +0 -210
- package/lib/compiler/Compiler.d.ts +0 -53
- package/lib/compiler/Formatter.d.ts +0 -23
- package/lib/compiler/Generator.d.ts +0 -40
- package/lib/compiler/Labels.d.ts +0 -47
- package/lib/grammar/LowLevel.d.ts +0 -68
- package/lib/grammar/Parse.d.ts +0 -48
- package/lib/grammar/z80.d.ts +0 -2938
- package/lib/types/Error.d.ts +0 -62
- /package/{CHANGELOG.md → libs/z80-assembler/public/CHANGELOG.md} +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Z80 Assembler in Typescript
|
|
3
|
+
*
|
|
4
|
+
* File: Error.ts
|
|
5
|
+
* Description: Compilation errors
|
|
6
|
+
* Author: Sebastien Andrivet
|
|
7
|
+
* License: GPLv3
|
|
8
|
+
* Copyrights: Copyright (C) 2023 Sebastien Andrivet
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {MatchAttempt, SyntaxErr} from "../grammar/z80";
|
|
12
|
+
import {Position} from "./Types";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A compilation error.
|
|
16
|
+
*/
|
|
17
|
+
class CompilationError extends Error {
|
|
18
|
+
/**
|
|
19
|
+
* Constructor.
|
|
20
|
+
* @param position Position (filename, line, offset) where the error occurred.
|
|
21
|
+
* @param message Description of the error.
|
|
22
|
+
*/
|
|
23
|
+
constructor(public readonly position: Position, message: string) {
|
|
24
|
+
super(message);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Format the error.
|
|
29
|
+
*/
|
|
30
|
+
override toString() {
|
|
31
|
+
return `File '${this.position.filename}', Line ${this.position.pos.line}:${this.position.pos.offset+1} - ${this.message}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Format internal MatchAttempt.
|
|
36
|
+
* @param match The MatchAttempt to format.
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
private static formatMatch(match: MatchAttempt) {
|
|
40
|
+
if(match.kind === 'EOF') return " end of code";
|
|
41
|
+
const not = match.negated ? 'not ' : '';
|
|
42
|
+
const literal = match.literal
|
|
43
|
+
// Escaped chars except escaped backslashes.
|
|
44
|
+
.replace(/\\([^\\])/g, '$1')
|
|
45
|
+
// Escaped backslashes.
|
|
46
|
+
.replace(/\\\\/g, '\\');
|
|
47
|
+
return ` ${not}${literal}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Format a syntax error.
|
|
52
|
+
* @param err a syntax error.
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
private static formatError(err: SyntaxErr): string {
|
|
56
|
+
if(err.expmatches.length === 1) {
|
|
57
|
+
const match = err.expmatches[0];
|
|
58
|
+
const literal = match.kind === 'EOF' ? 'the end of the code' : match.literal;
|
|
59
|
+
return `${match.negated ? 'Does not expect ' : 'Expect '}${literal}`;
|
|
60
|
+
}
|
|
61
|
+
return `Syntax error, expected one of: ${err.expmatches.map(m => CompilationError.formatMatch(m))}`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Create a compilation error from a syntax error.
|
|
66
|
+
* @param filename Filename where the error occurred.
|
|
67
|
+
* @param e Syntax error.
|
|
68
|
+
*/
|
|
69
|
+
static fromSyntaxErr(filename: string, e: SyntaxErr): CompilationError {
|
|
70
|
+
return new CompilationError({filename: filename, pos: e.pos}, this.formatError(e));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Create a compilation error from different errors.
|
|
75
|
+
* @param filename Filename where the error occurred.
|
|
76
|
+
* @param e The error
|
|
77
|
+
*/
|
|
78
|
+
static fromAny(filename: string, e: any) { // eslint-disable-line
|
|
79
|
+
// Already a compilation error? Return it.
|
|
80
|
+
if(e instanceof CompilationError) return e;
|
|
81
|
+
// A syntax error?
|
|
82
|
+
if(e instanceof SyntaxErr) return this.fromSyntaxErr(filename, e);
|
|
83
|
+
// Something else?
|
|
84
|
+
return new CompilationError({filename: filename, pos: {line: 1, offset: 0, overallPos: 0}}, e.toString());
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Check if an error is a compilation error (and cast the error in this case).
|
|
89
|
+
* @param err The error to check.
|
|
90
|
+
*/
|
|
91
|
+
static is(err: any): err is CompilationError { // eslint-disable-line
|
|
92
|
+
return (err as CompilationError).position !== undefined;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if an error is an array of compilation errors (and cast the type in this case).
|
|
97
|
+
* @param err The error to check.
|
|
98
|
+
*/
|
|
99
|
+
static isArray(err: any): err is CompilationError[] { // eslint-disable-line
|
|
100
|
+
const errs = err as CompilationError[];
|
|
101
|
+
return errs.length !== undefined && (errs.length === 0 || errs[0].position !== undefined);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export {CompilationError};
|
|
@@ -7,41 +7,56 @@
|
|
|
7
7
|
* License: GPLv3
|
|
8
8
|
* Copyrights: Copyright (C) 2023 Sebastien Andrivet
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
import {
|
|
10
|
+
|
|
11
|
+
import {Line, PosInfo} from "../grammar/z80";
|
|
12
|
+
import {CompilationError} from "./Error";
|
|
13
|
+
|
|
14
|
+
|
|
12
15
|
/**
|
|
13
16
|
* A byte is represented by a number.
|
|
14
17
|
*/
|
|
15
18
|
type byte = number;
|
|
19
|
+
|
|
16
20
|
/**
|
|
17
21
|
* An array of bytes.
|
|
18
22
|
*/
|
|
19
23
|
type bytes = byte[];
|
|
24
|
+
|
|
20
25
|
/**
|
|
21
26
|
* An address is either a number (known) or null (unknown).
|
|
22
27
|
*/
|
|
23
28
|
type Address = number | null;
|
|
29
|
+
|
|
24
30
|
/**
|
|
25
31
|
* Information about lines.
|
|
26
32
|
*/
|
|
27
33
|
interface LinesInfo {
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
// An array of lines (AST).
|
|
35
|
+
lines: Line[];
|
|
36
|
+
// A filename associated with this lines.
|
|
37
|
+
filename: string;
|
|
30
38
|
}
|
|
39
|
+
|
|
31
40
|
/**
|
|
32
41
|
* The result of a compilation.
|
|
33
42
|
*/
|
|
34
43
|
interface CompilationInfo {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
// The name of the output (output directive).
|
|
45
|
+
outputName: string;
|
|
46
|
+
// The bytes, result of the compilation.
|
|
47
|
+
bytes: bytes;
|
|
48
|
+
// The Source Level Debugging data.
|
|
49
|
+
sld: string;
|
|
50
|
+
// The compilation errors.
|
|
51
|
+
errs: CompilationError[];
|
|
39
52
|
}
|
|
53
|
+
|
|
40
54
|
/**
|
|
41
55
|
* Position in a source file.
|
|
42
56
|
*/
|
|
43
57
|
interface Position {
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
filename: string;
|
|
59
|
+
pos: PosInfo;
|
|
46
60
|
}
|
|
47
|
-
|
|
61
|
+
|
|
62
|
+
export {byte, bytes, Address, LinesInfo, CompilationInfo, Position}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"forceConsistentCasingInFileNames": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noImplicitOverride": true,
|
|
8
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
+
"noImplicitReturns": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true,
|
|
11
|
+
"types": ["vitest", "vite/client"]
|
|
12
|
+
},
|
|
13
|
+
"files": [],
|
|
14
|
+
"include": [],
|
|
15
|
+
"references": [
|
|
16
|
+
{
|
|
17
|
+
"path": "./tsconfig.lib.json"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "./tsconfig.spec.json"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/out-tsc",
|
|
5
|
+
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
|
|
6
|
+
},
|
|
7
|
+
"include": [
|
|
8
|
+
"vite.config.ts",
|
|
9
|
+
"src/**/*.test.ts",
|
|
10
|
+
"src/**/*.spec.ts",
|
|
11
|
+
"src/**/*.test.tsx",
|
|
12
|
+
"src/**/*.spec.tsx",
|
|
13
|
+
"src/**/*.test.js",
|
|
14
|
+
"src/**/*.spec.js",
|
|
15
|
+
"src/**/*.test.jsx",
|
|
16
|
+
"src/**/*.spec.jsx",
|
|
17
|
+
"src/**/*.d.ts"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
|
|
3
|
+
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
4
|
+
import dts from 'vite-plugin-dts';
|
|
5
|
+
import { joinPathFragments } from '@nx/devkit';
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
cacheDir: '../../node_modules/.vite/z80-assembler',
|
|
9
|
+
assetsInclude: ['**/*.zx81'],
|
|
10
|
+
|
|
11
|
+
plugins: [
|
|
12
|
+
dts({
|
|
13
|
+
entryRoot: 'src',
|
|
14
|
+
tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'),
|
|
15
|
+
skipDiagnostics: true,
|
|
16
|
+
}),
|
|
17
|
+
|
|
18
|
+
viteTsConfigPaths({
|
|
19
|
+
root: '../../',
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
|
|
23
|
+
// Uncomment this if you are using workers.
|
|
24
|
+
// worker: {
|
|
25
|
+
// plugins: [
|
|
26
|
+
// viteTsConfigPaths({
|
|
27
|
+
// root: '../../',
|
|
28
|
+
// }),
|
|
29
|
+
// ],
|
|
30
|
+
// },
|
|
31
|
+
|
|
32
|
+
// Configuration for building your library.
|
|
33
|
+
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
34
|
+
build: {
|
|
35
|
+
lib: {
|
|
36
|
+
// Could also be a dictionary or array of multiple entry points.
|
|
37
|
+
entry: 'src/index.ts',
|
|
38
|
+
name: 'z80-assembler',
|
|
39
|
+
fileName: 'index',
|
|
40
|
+
// Change this to the formats you want to support.
|
|
41
|
+
// Don't forgot to update your package.json as well.
|
|
42
|
+
formats: ['es', 'cjs'],
|
|
43
|
+
},
|
|
44
|
+
rollupOptions: {
|
|
45
|
+
// External packages that should not be bundled into your library.
|
|
46
|
+
external: [],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
test: {
|
|
51
|
+
globals: true,
|
|
52
|
+
cache: {
|
|
53
|
+
dir: '../../node_modules/.vitest',
|
|
54
|
+
},
|
|
55
|
+
environment: 'jsdom',
|
|
56
|
+
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
57
|
+
},
|
|
58
|
+
});
|
package/nx.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
|
3
|
+
"affected": {
|
|
4
|
+
"defaultBase": "master"
|
|
5
|
+
},
|
|
6
|
+
"tasksRunnerOptions": {
|
|
7
|
+
"default": {
|
|
8
|
+
"runner": "nx/tasks-runners/default",
|
|
9
|
+
"options": {
|
|
10
|
+
"cacheableOperations": ["build", "lint", "test"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"targetDefaults": {
|
|
15
|
+
"build": {
|
|
16
|
+
"dependsOn": ["^build"],
|
|
17
|
+
"inputs": ["production", "^production"]
|
|
18
|
+
},
|
|
19
|
+
"test": {
|
|
20
|
+
"inputs": ["default", "^production"]
|
|
21
|
+
},
|
|
22
|
+
"lint": {
|
|
23
|
+
"inputs": [
|
|
24
|
+
"default",
|
|
25
|
+
"{workspaceRoot}/.eslintrc.json",
|
|
26
|
+
"{workspaceRoot}/.eslintignore"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"namedInputs": {
|
|
31
|
+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
|
32
|
+
"production": [
|
|
33
|
+
"default",
|
|
34
|
+
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
|
|
35
|
+
"!{projectRoot}/tsconfig.spec.json",
|
|
36
|
+
"!{projectRoot}/.eslintrc.json"
|
|
37
|
+
],
|
|
38
|
+
"sharedGlobals": []
|
|
39
|
+
},
|
|
40
|
+
"generators": {
|
|
41
|
+
"@nx/react": {
|
|
42
|
+
"application": {
|
|
43
|
+
"style": "css",
|
|
44
|
+
"linter": "eslint",
|
|
45
|
+
"bundler": "vite",
|
|
46
|
+
"babel": true
|
|
47
|
+
},
|
|
48
|
+
"component": {
|
|
49
|
+
"style": "css"
|
|
50
|
+
},
|
|
51
|
+
"library": {
|
|
52
|
+
"style": "css",
|
|
53
|
+
"linter": "eslint"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrivet/z80-assembler",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A Z80 assembler entirely written in Typescript and derived from a PEG grammar.",
|
|
5
|
-
"author": "Sebastien Andrivet",
|
|
3
|
+
"version": "1.4.0",
|
|
6
4
|
"license": "GPLv3",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
5
|
+
"homepage": "https://andrivet.github.io/z80-assembler",
|
|
6
|
+
"private": false,
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@swc/helpers": "~0.5.1",
|
|
9
|
+
"@uiw/react-codemirror": "^4.20.2",
|
|
10
|
+
"browser-fs-access": "^0.34.1",
|
|
11
|
+
"codemirror": "^6.0.1",
|
|
12
|
+
"daisyui": "^3.9.4",
|
|
13
|
+
"react": "^18.2.0",
|
|
14
|
+
"react-daisyui": "^4.1.2",
|
|
15
|
+
"react-dom": "^18.2.0",
|
|
16
|
+
"react-icons": "^4.9.0"
|
|
15
17
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@nx/eslint-plugin": "^16.3.1",
|
|
20
|
+
"@nx/js": "^16.3.1",
|
|
21
|
+
"@nx/linter": "^16.3.1",
|
|
22
|
+
"@nx/react": "^16.3.1",
|
|
23
|
+
"@nx/vite": "^16.3.1",
|
|
24
|
+
"@nx/workspace": "^16.3.1",
|
|
25
|
+
"@swc/cli": "^0.5.1",
|
|
26
|
+
"@swc/core": "~1.3.61",
|
|
27
|
+
"@testing-library/react": "^14.0.0",
|
|
28
|
+
"@types/node": "^20.2.5",
|
|
29
|
+
"@types/react": "^18.2.8",
|
|
30
|
+
"@types/react-dom": "^18.2.4",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
32
|
+
"@typescript-eslint/parser": "^5.59.8",
|
|
33
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
34
|
+
"@vitest/coverage-c8": "~0.32.2",
|
|
35
|
+
"@vitest/ui": "~0.32.2",
|
|
36
|
+
"autoprefixer": "^10.4.14",
|
|
37
|
+
"eslint": "^8.57.1",
|
|
38
|
+
"eslint-config-prettier": "^8.8.0",
|
|
39
|
+
"eslint-plugin-cypress": "^2.13.3",
|
|
40
|
+
"eslint-plugin-import": "^2.27.5",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
42
|
+
"eslint-plugin-react": "^7.32.2",
|
|
43
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
+
"gh-pages": "^5.0.0",
|
|
45
|
+
"jsdom": "~22.1.0",
|
|
46
|
+
"nx": "^16.3.1",
|
|
47
|
+
"postcss": "^8.4.24",
|
|
48
|
+
"prettier": "^2.8.8",
|
|
49
|
+
"tailwindcss": "^3.3.2",
|
|
50
|
+
"tspeg": "^3.3.2",
|
|
51
|
+
"typescript": "^5.1.3",
|
|
52
|
+
"vite": "^4.5.5",
|
|
53
|
+
"vite-plugin-dts": "^2.3.0",
|
|
54
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
55
|
+
"vite-tsconfig-paths": "^4.2.0",
|
|
56
|
+
"vitest": "~0.32.2"
|
|
19
57
|
}
|
|
20
58
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": ".",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"declaration": false,
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"emitDecoratorMetadata": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"importHelpers": true,
|
|
11
|
+
"target": "es2015",
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"lib": ["es2020", "dom"],
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"skipDefaultLibCheck": true,
|
|
16
|
+
"baseUrl": ".",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@andrivet/z80-assembler": ["libs/z80-assembler/src/index.ts"]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"exclude": ["node_modules", "tmp"]
|
|
22
|
+
}
|