Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ EWC/server/*
/demo/images/ribbonimages/*
.DS_Store
.linkconfig
Dist/
55 changes: 55 additions & 0 deletions BuildPackage.apls
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/dyalogscript
⎕PW←500
⎕SE.(⍎⊃2⎕FIX'/StartupSession.aplf',⍨2⎕NQ#'GetEnvironment' 'DYALOG')
⎕ML ⎕IO←1 0
⎕←⎕SE.UCMD 'ureset'
⎕←⎕SE.UCMD 'Tatin.Version'

⍝ Save current directory
cwd←⊃1⎕NPARTS ''

⍝ Create a temp directory
tmp←739⌶0
builddir←tmp,'/ewc-build-',(⍕⎕AI[2])
3 ⎕MKDIR builddir

⍝ Clone ewc-client into temp directory
⎕←⎕SHELL 'git clone https://github.com/Dyalog/ewc-client.git "',builddir,'/ewc-client-repo"'

⍝ Checkout devt branch
⎕←⎕SHELL 'cd "',builddir,'/ewc-client-repo" && git checkout devt'

⍝ Build ewc-client
⎕←⎕SHELL 'cd "',builddir,'/ewc-client-repo" && npm install && npm run build'

⍝ Generate third-party license notices for npm dependencies
⎕←⎕SHELL 'cd "',builddir,'/ewc-client-repo" && npx license-checker --production --out THIRD-PARTY-LICENSES.txt'

⍝ Copy the dist folder into ewc-client/dist (matching the client lookup path in Init)
3 ⎕MKDIR builddir,'/ewc-client'
⎕←⎕SHELL 'cp -r "',builddir,'/ewc-client-repo/dist" "',builddir,'/ewc-client/dist"'

⍝ Include the third-party license notices in the ewc-client folder
⎕←⎕SHELL 'cp "',builddir,'/ewc-client-repo/THIRD-PARTY-LICENSES.txt" "',builddir,'/ewc-client/THIRD-PARTY-LICENSES.txt"'

⍝ Remove the cloned repo, no longer needed
3 ⎕NDELETE builddir,'/ewc-client-repo'

⍝ Copy EWC source folder to temp dir
⎕←⎕SHELL 'cp -r "',cwd,'EWC" "',builddir,'/EWC"'

⍝ Copy apl-package.json and LICENSE to temp dir
⎕←⎕SHELL 'cp "',cwd,'apl-package.json" "',builddir,'/apl-package.json"'
⎕←⎕SHELL 'cp "',cwd,'LICENSE" "',builddir,'/LICENSE"'

⍝ Build the Tatin package
parms←⎕SE.Tatin.CreateBuildParms builddir
parms.targetPath←cwd,'Dist'
parms.dependencyFolder←''
3 ⎕MKDIR parms.targetPath
⎕←⎕SE.Tatin.BuildPackage parms

⍝ Clean up temp directory
3 ⎕NDELETE builddir

⎕←'Done. Package built to: ',cwd,'Dist'
4 changes: 4 additions & 0 deletions EWC/Init.aplf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{prefix}Init args;mode;z;i;t;fn;folder;⎕TRAP;DPR_FORM;_EWC;dc
⎕IO←⎕ML←1
:If '#.EWC'≢⍕⎕THIS
:AndIf ~{9≠#.⎕NC '#.EWC':0 ⋄ (⍕⎕THIS)≡⍕#.EWC}⍬
'EWC must be loaded as #.EWC' ⎕SIGNAL 11
:EndIf

Expand All @@ -11,6 +12,7 @@

:If 0=≢folder←⊃⎕NPARTS ¯1↓⊃⎕NPARTS 4⊃5179⌶⊃⎕SI
:AndIf 0=≢folder←FOLDER
:AndIf 0=≢folder←{0≠⎕NC 'TatinVars': TatinVars.HOME ⋄ ⍵}''
'Please set EWC.FOLDER to identify the EWC source folder' ⎕SIGNAL 11
:EndIf

Expand Down Expand Up @@ -67,6 +69,8 @@
JSClientFolder←folder
:ElseIf ⎕NEXISTS folder←FOLDER,'client/dist/'
JSClientFolder←folder
:ElseIf ⎕NEXISTS folder←'ewc-client/dist/',⍨⊃⎕NPARTS FOLDER
JSClientFolder←folder
:Else
'Unable to locate EWC Client'⎕SIGNAL 11
:EndIf
Expand Down
24 changes: 24 additions & 0 deletions apl-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
api: "",
assets: "ewc-client",
checkLICENSEfile: 1,
description: "A JavaScript-based emulation of Dyalog APL ⎕WC GUI.",
documentation: "",
files: "",
group: "dyalog",
io: 1,
license: "MIT",
lx: "",
maintainer: "support@dyalog.com",
minimumAplVersion: "18.2",
ml: 1,
name: "EWC",
os_lin: 1,
os_mac: 1,
os_win: 1,
project_url: "https://github.com/dyalog/ewc",
source: "EWC",
tags: "gui,javascript,linux,windows,mac,ewc,crossplatform",
userCommandScript: "",
version: "0.1.0+0",
}