Skip to content

Commit 1d1093b

Browse files
authored
chore: store pre-built JS in source tree (#165)
* chore: move JS build dir to widget/js/ * doc: new pre-built strategy * chore: update widget/js * ci: adjust to changes * chore: bump @leanprover-community/proofwidgets4
1 parent 25f4d2f commit 1d1093b

45 files changed

Lines changed: 232 additions & 78 deletions

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
- name: Build package
4949
run: lake build ProofWidgets
5050

51+
- name: Check pre-built JS is up-to-date
52+
run: git diff --exit-code widget/js/
53+
5154
- name: Try publishing @leanprover-community/proofwidgets4
5255
if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-pre') && matrix.os == 'ubuntu-latest' }}
5356
continue-on-error: true
@@ -65,15 +68,5 @@ jobs:
6568
with:
6669
prerelease: ${{ contains(github.ref, '-pre') }}
6770

68-
- name: Upload release archive (Ubuntu)
69-
if: github.ref_type == 'tag' && matrix.os == 'ubuntu-latest'
70-
run: lake upload $RELEASE_TAG
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73-
RELEASE_TAG: ${{ github.ref_name }}
74-
75-
- name: Test release archive (Ubuntu)
76-
if: github.ref_type == 'tag' && matrix.os == 'ubuntu-latest'
77-
run: lake clean && lake build :release && lake build --no-build
7871
env:
7972
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

ProofWidgets/Component/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ preferrable to use the eager `InteractiveCode` in order to avoid the extra clien
7474
needed for the pretty-printing RPC call. -/
7575
@[widget_module]
7676
def InteractiveExpr : Component InteractiveExprProps where
77-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "interactiveExpr.js"
77+
javascript := include_str ".." / ".." / "widget" / "js" / "interactiveExpr.js"
7878

7979
structure InteractiveMessageProps where
8080
msg : Server.WithRpcRef MessageData

ProofWidgets/Component/FilterDetails.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ but also has a filter button
2424
that allows you to switch between filtered and unfiltered states. -/
2525
@[widget_module]
2626
def FilterDetails : Component FilterDetailsProps where
27-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "filterDetails.js"
27+
javascript := include_str ".." / ".." / "widget" / "js" / "filterDetails.js"
2828

2929
end ProofWidgets

ProofWidgets/Component/GraphDisplay.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ end GraphDisplay
140140
/-- Display a graph with an interactive force simulation. -/
141141
@[widget_module]
142142
def GraphDisplay : Component GraphDisplay.Props where
143-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "d3Graph.js"
143+
javascript := include_str ".." / ".." / "widget" / "js" / "d3Graph.js"
144144

145145
end ProofWidgets

ProofWidgets/Component/HtmlDisplay.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ structure HtmlDisplayProps where
1616

1717
@[widget_module]
1818
def HtmlDisplay : Component HtmlDisplayProps where
19-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "htmlDisplay.js"
19+
javascript := include_str ".." / ".." / "widget" / "js" / "htmlDisplay.js"
2020

2121
@[widget_module]
2222
def HtmlDisplayPanel : Component HtmlDisplayProps where
23-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "htmlDisplayPanel.js"
23+
javascript := include_str ".." / ".." / "widget" / "js" / "htmlDisplayPanel.js"
2424

2525
open Lean Server Elab Command
2626

ProofWidgets/Component/MakeEditLink.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ and potentially moves the cursor
6363
or makes a selection. -/
6464
@[widget_module]
6565
def MakeEditLink : Component MakeEditLinkProps where
66-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "makeEditLink.js"
66+
javascript := include_str ".." / ".." / "widget" / "js" / "makeEditLink.js"
6767

6868
end ProofWidgets

ProofWidgets/Component/OfRpcMethod.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public meta section
1010
namespace ProofWidgets
1111
open Lean Server Meta Elab Term
1212

13-
def ofRpcMethodTemplate := include_str ".." / ".." / ".lake" / "build" / "js" / "ofRpcMethod.js"
13+
def ofRpcMethodTemplate := include_str ".." / ".." / "widget" / "js" / "ofRpcMethod.js"
1414

1515
/-- The elaborator `mk_rpc_widget%` allows writing certain widgets in Lean instead of JavaScript.
1616
Specifically, it translates an RPC method of type `MyProps → RequestM (RequestTask Html)`

ProofWidgets/Component/Panel/GoalTypePanel.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ namespace ProofWidgets
99
/-- Display the goal type using known `Expr` presenters. -/
1010
@[widget_module]
1111
def GoalTypePanel : Component PanelWidgetProps where
12-
javascript := include_str ".." / ".." / ".." / ".lake" / "build" / "js" / "goalTypePanel.js"
12+
javascript := include_str ".." / ".." / ".." / "widget" / "js" / "goalTypePanel.js"
1313

1414
end ProofWidgets

ProofWidgets/Component/Panel/SelectionPanel.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ presenter should be used to display each of those expressions.
4949
Expressions can be selected using shift-click. -/
5050
@[widget_module]
5151
def SelectionPanel : Component PanelWidgetProps where
52-
javascript := include_str ".." / ".." / ".." / ".lake" / "build" / "js" / "presentSelection.js"
52+
javascript := include_str ".." / ".." / ".." / "widget" / "js" / "presentSelection.js"
5353

5454
end ProofWidgets

ProofWidgets/Component/PenroseDiagram.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ and can be accessed as, for example, `theme.foreground` in the provided `sty` in
4444
the editor theme. -/
4545
@[widget_module]
4646
def Diagram : Component DiagramProps where
47-
javascript := include_str ".." / ".." / ".lake" / "build" / "js" / "penroseDisplay.js"
47+
javascript := include_str ".." / ".." / "widget" / "js" / "penroseDisplay.js"
4848

4949
/-! # `DiagramBuilderM` -/
5050

0 commit comments

Comments
 (0)