Skip to content

Commit 8af68e3

Browse files
Move from elm references to guida (#124)
Fixes #66
1 parent b2fbe99 commit 8af68e3

File tree

105 files changed

+5596
-2627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5596
-2627
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v23.10.0
1+
v25.1.0

CHANGELOG.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- WIP: Allow running the `make` command in the browser ([#94](https://github.com/guida-lang/compiler/issues/94))
13-
- Initial REPL tests for basic arithmetic evaluation
14-
- New `test` command ([#98](https://github.com/guida-lang/compiler/issues/98))
15-
- Add `elm-explorations/test` dependency as part of `init` ([#65](https://github.com/guida-lang/compiler/issues/65))
16-
- Extend record referred by another record’s field ([#79](https://github.com/guida-lang/compiler/issues/79))
17-
- Add a `CONTRIBUTING.md` file ([#103](https://github.com/guida-lang/compiler/issues/103))
18-
- `guida format` command ([#100](https://github.com/guida-lang/compiler/issues/100))
19-
- Numeric separators ([#109](https://github.com/guida-lang/compiler/issues/109))
20-
- Binary literals support ([#2248](https://github.com/elm/compiler/issues/2248))
12+
- WIP: Allow running the `make` command in the browser ([#94](https://github.com/guida-lang/compiler/issues/94)).
13+
- Initial REPL tests for basic arithmetic evaluation.
14+
- New `test` command ([#98](https://github.com/guida-lang/compiler/issues/98)).
15+
- Add `elm-explorations/test` dependency as part of `init` ([#65](https://github.com/guida-lang/compiler/issues/65)).
16+
- Extend record referred by another record’s field ([#79](https://github.com/guida-lang/compiler/issues/79)).
17+
- Add a `CONTRIBUTING.md` file ([#103](https://github.com/guida-lang/compiler/issues/103)).
18+
- `guida format` command ([#100](https://github.com/guida-lang/compiler/issues/100)).
19+
- Numeric separators ([#109](https://github.com/guida-lang/compiler/issues/109)).
20+
- Binary literals support ([#2248](https://github.com/elm/compiler/issues/2248)).
2121
- Bool type support in WebGL shader interface ([#2120](https://github.com/elm/compiler/issues/2120)).
2222

2323
### Fixed
2424

25-
- Correct reporting of multiple errors ([#99](https://github.com/guida-lang/compiler/issues/99))
26-
- Replaced infinite looping `Crash.crash` with log and exit ([#120](https://github.com/guida-lang/compiler/issues/120))
25+
- Correct reporting of multiple errors ([#99](https://github.com/guida-lang/compiler/issues/99)).
26+
- Replaced infinite looping `Crash.crash` with log and exit ([#120](https://github.com/guida-lang/compiler/issues/120)).
2727

2828
### Changed
2929

30-
- Refactored project structure to support both Node and Browser environments
31-
- Refactoring of `Task` aliases for a more unified approach across the codebase ([#108](https://github.com/guida-lang/compiler/issues/108))
30+
- Refactored project structure to support both Node and Browser environments.
31+
- Refactoring of `Task` aliases for a more unified approach across the codebase ([#108](https://github.com/guida-lang/compiler/issues/108)).
3232

3333
---
3434

@@ -37,17 +37,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3737
### Added
3838

3939
- Initial stable release.
40-
- Allow tuples with 3+ elements ([#75](https://github.com/guida-lang/compiler/issues/75).
40+
- Allow tuples with 3+ elements ([#75](https://github.com/guida-lang/compiler/issues/75)).
4141
- Support for `GUIDA_REGISTRY` environment variable.
4242
- New `--yes` flag for `init` command ([#80](https://github.com/guida-lang/compiler/issues/80)).
4343
* Support modifying records via qualified names ([#78](https://github.com/guida-lang/compiler/issues/78)).
4444
- New `--package` flag for `init` command ([#43](https://github.com/guida-lang/compiler/issues/43)).
4545
- New `--test` flag for `install` command ([#64](https://github.com/guida-lang/compiler/issues/64)).
46-
- `uninstall` command ([#60](https://github.com/guida-lang/compiler/issues/60).
47-
- Source maps support ([#63](https://github.com/guida-lang/compiler/issues/63).
48-
- Guida-specific syntax for underscore wildcard variables ([#59](https://github.com/guida-lang/compiler/issues/59).
46+
- `uninstall` command ([#60](https://github.com/guida-lang/compiler/issues/60)).
47+
- Source maps support ([#63](https://github.com/guida-lang/compiler/issues/63)).
48+
- Guida-specific syntax for underscore wildcard variables ([#59](https://github.com/guida-lang/compiler/issues/59)).
4949
- Format command (`guida format`) ([#58](https://github.com/guida-lang/compiler/issues/58), fixes [#42](https://github.com/guida-lang/compiler/issues/42)).
50-
- Self-hosted environment ([#9](https://github.com/guida-lang/compiler/issues/9)
50+
- Self-hosted environment ([#9](https://github.com/guida-lang/compiler/issues/9)).
5151
- `--optimize` flag for `build` command ([#36](https://github.com/guida-lang/compiler/issues/36)).
5252

5353
### Changed

lib/index.d.ts

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
export interface GuidaConfig {
55
// XMLHttpRequest constructor for making HTTP requests.
6+
// @ts-ignore
67
XMLHttpRequest: typeof XMLHttpRequest;
78

89
// Write text or binary data to a path.
@@ -12,7 +13,7 @@ export interface GuidaConfig {
1213
readFile(path: string): Promise<string | ArrayBuffer | Uint8Array | Buffer | { buffer: ArrayBuffer }>;
1314

1415
// Read a directory and return a list of files.
15-
readDirectory(path: string): Promise<{ files: string[] }>;
16+
readDirectory(path: string): Promise<{ files: string[] | Buffer<ArrayBufferLike>[] }>;
1617

1718
// Create a directory.
1819
createDirectory(path: string): Promise<void>;
@@ -40,12 +41,42 @@ export interface MakeOptions {
4041
// nature of the results coming from the embedded Elm/runner process.
4142
export type GuidaResponse = any;
4243

43-
declare const _default: {
44-
make: (config: GuidaConfig, path: string, options?: MakeOptions) => Promise<GuidaResponse>;
45-
format: (config: GuidaConfig, content: string) => Promise<GuidaResponse>;
46-
install: (config: GuidaConfig, pkg: string) => Promise<GuidaResponse>;
47-
uninstall: (config: GuidaConfig, pkg: string) => Promise<GuidaResponse>;
48-
diagnostics: (config: GuidaConfig, args: { content: string } | { path: string }) => Promise<{ errors?: any }>;
49-
};
44+
export type Message = string | { bold: boolean, underline: boolean, color: null | string, string: string };
5045

51-
export default _default;
46+
export type Problem = {
47+
title: string;
48+
region: {
49+
start: { line: number; column: number; };
50+
end: { line: number; column: number; };
51+
};
52+
message: Message[];
53+
}
54+
55+
export type CompileError = {
56+
path: string;
57+
name: string;
58+
problems: Problem[];
59+
}
60+
61+
export type DiagnosticsResult =
62+
| null
63+
| {
64+
type: "content-error";
65+
error: Problem;
66+
}
67+
| {
68+
type: "compile-errors";
69+
errors: CompileError[];
70+
}
71+
| {
72+
type: "error";
73+
path: null | string;
74+
title: string;
75+
message: Message[];
76+
};
77+
78+
export declare const make: (config: GuidaConfig, path: string, options?: MakeOptions) => Promise<GuidaResponse>;
79+
export declare const format: (config: GuidaConfig, content: string) => Promise<GuidaResponse>;
80+
export declare const install: (config: GuidaConfig, pkg: string) => Promise<GuidaResponse>;
81+
export declare const uninstall: (config: GuidaConfig, pkg: string) => Promise<GuidaResponse>;
82+
export declare const diagnostics: (config: GuidaConfig, args: { content: string } | { path: string }) => Promise<DiagnosticsResult>;

src/API/Format.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module API.Format exposing (run)
22

33
import Common.Format
4-
import Compiler.Elm.Package as Pkg
4+
import Compiler.Guida.Package as Pkg
55
import Compiler.Parse.Module as M
66
import Compiler.Parse.SyntaxVersion as SV
77

0 commit comments

Comments
 (0)