jade-lang 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/lib/jade/codegen.rb +5 -1
- data/lib/jade/frontend/type_checking/env.rb +3 -0
- data/lib/jade/module_loader.rb +27 -3
- data/lib/jade/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb2b101369a0d671ca8f2aa020e7113a49f22e700491e5d14f7e574f62ee17ec
|
|
4
|
+
data.tar.gz: 7e017dbe893887f9e7ac3dfcb5c434474085771f5062ee509cf8e9ee9682ddd6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45578bee3ec52655fbba6a0cd7a053a6ad65c9981760edd86e2966fd671958a63fc08fb0120b58fda73298c584773a8e6a4c92eb71b2c11d79228bb88a905e16
|
|
7
|
+
data.tar.gz: 698a60f7e747a8042e32f5da24b8c6c322d25a470e3a65f0ed6dfeb61a89c67cc6394ab993115c8c42e9305e75db9b5445f7b5a42a74974832a2c5cd268fe209
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.1]
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- A module whose dependency failed to compile is no longer type checked. It
|
|
14
|
+
reached for bindings the broken module never produced and raised through the
|
|
15
|
+
compiler, naming the importer rather than the module at fault, and the
|
|
16
|
+
original error was never reported. Dependents now say which dependency
|
|
17
|
+
failed, and modules broken independently of each other are all still
|
|
18
|
+
reported.
|
|
19
|
+
- The load-path line at the top of every compiled entry module appends the
|
|
20
|
+
application's `lib` instead of prepending it. At position 0 it shadowed, for
|
|
21
|
+
the whole process, any gem sharing a name with a directory under `lib` —
|
|
22
|
+
`sidekiq/`, `sentry/`, `warden/`. The line exists so `uses App::Thing` can
|
|
23
|
+
resolve `lib/app/thing.rb`; it never needed to outrank gems.
|
|
24
|
+
|
|
9
25
|
## [0.3.0]
|
|
10
26
|
|
|
11
27
|
### Changed
|
|
@@ -99,7 +115,8 @@ Initial release.
|
|
|
99
115
|
- `jade` CLI dispatcher: `fmt`, `lsp`, `q`.
|
|
100
116
|
- Language server and headless query interface for editor/agent tooling.
|
|
101
117
|
|
|
102
|
-
[Unreleased]: https://github.com/agustinrhcp/jade/compare/v0.3.
|
|
118
|
+
[Unreleased]: https://github.com/agustinrhcp/jade/compare/v0.3.1...HEAD
|
|
119
|
+
[0.3.1]: https://github.com/agustinrhcp/jade/compare/v0.3.0...v0.3.1
|
|
103
120
|
[0.3.0]: https://github.com/agustinrhcp/jade/compare/v0.2.0...v0.3.0
|
|
104
121
|
[0.2.0]: https://github.com/agustinrhcp/jade/compare/v0.1.1...v0.2.0
|
|
105
122
|
[0.1.1]: https://github.com/agustinrhcp/jade/compare/v0.1.0...v0.1.1
|
data/lib/jade/codegen.rb
CHANGED
|
@@ -393,8 +393,12 @@ module Jade
|
|
|
393
393
|
node.is_a?(AST::ImportDeclaration) || node.is_a?(AST::InteropImportDeclaration)
|
|
394
394
|
end
|
|
395
395
|
|
|
396
|
+
# Appended, not prepended: this exists so `uses App::Thing` can find
|
|
397
|
+
# `lib/app/thing.rb`, and an application's lib directory routinely holds
|
|
398
|
+
# directories named after the gems it depends on. At position 0 those
|
|
399
|
+
# shadow the real gems for the whole process.
|
|
396
400
|
def load_path
|
|
397
|
-
'$LOAD_PATH.
|
|
401
|
+
'$LOAD_PATH.push(File.expand_path("lib")).uniq!'
|
|
398
402
|
end
|
|
399
403
|
end
|
|
400
404
|
end
|
|
@@ -53,6 +53,9 @@ module Jade
|
|
|
53
53
|
in Placeholder => placeholder
|
|
54
54
|
Scheme[placeholder.free_vars, placeholder.type, placeholder.constraints]
|
|
55
55
|
.then { Instantiation.instantiate(it, var_gen) }
|
|
56
|
+
|
|
57
|
+
in nil
|
|
58
|
+
fail "no type binding for `#{key}`"
|
|
56
59
|
end
|
|
57
60
|
|
|
58
61
|
Result.init(type, constraints)
|
data/lib/jade/module_loader.rb
CHANGED
|
@@ -51,13 +51,37 @@ module Jade
|
|
|
51
51
|
.modules_in_topo_order
|
|
52
52
|
.reject { Stdlib.is_stdlib?(it) }
|
|
53
53
|
.reduce([registry, {}]) do |(acc, digests), entry|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
case broken_dependency(entry, acc)
|
|
55
|
+
in String => dependency
|
|
56
|
+
[acc.update_module(blocked(entry, dependency)), digests]
|
|
57
|
+
|
|
58
|
+
else
|
|
59
|
+
compile_with_cache(entry, acc, digests, cache_dir, tolerant)
|
|
60
|
+
.then { |(compiled, digest)| [acc.update_module(compiled), digests.merge(entry.name => digest)] }
|
|
61
|
+
end
|
|
57
62
|
end
|
|
58
63
|
.first
|
|
59
64
|
end
|
|
60
65
|
|
|
66
|
+
def broken_dependency(entry, registry)
|
|
67
|
+
direct_deps(entry.name, registry)
|
|
68
|
+
.filter_map { registry.modules[it] }
|
|
69
|
+
.find { it.diagnostics.any_errors? }
|
|
70
|
+
&.name
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def blocked(entry, dependency)
|
|
74
|
+
Diagnostics::List
|
|
75
|
+
.empty
|
|
76
|
+
.add(
|
|
77
|
+
Diagnostics::Diagnostic.error(
|
|
78
|
+
"Not checked: #{dependency} failed to compile",
|
|
79
|
+
primary: nil,
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
.then { entry.with(diagnostics: it) }
|
|
83
|
+
end
|
|
84
|
+
|
|
61
85
|
def compile_with_cache(entry, registry, digests, cache_dir, tolerant)
|
|
62
86
|
return [compile_one(entry, registry, tolerant:), nil] unless cache_dir
|
|
63
87
|
|
data/lib/jade/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jade-lang
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Agustin Cornu
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-07-
|
|
10
|
+
date: 2026-07-31 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: base64
|