forked from finos/morphir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Towards getting a compiler script running
- Loading branch information
1 parent
1f9db2e
commit f3978d0
Showing
11 changed files
with
102 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[extensions] | ||
directories = ["${WorkspaceRoot}/.${CliName}/extensions/"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
language: typescript | ||
language: typescript | ||
platform: bun | ||
|
||
tasks: | ||
type-check-cjs: | ||
#TODO: Remove no-op when typescript config is added | ||
command: no-op | ||
type-check-esm: | ||
#TODO: Remove no-op when typescript config is added | ||
command: no-op | ||
fetch-quickjs: | ||
command: 'bun run fetch-quickjs' | ||
local: true | ||
platform: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
{ | ||
"name": "@finos/morphir-cli", | ||
"version": "0.0.0" | ||
"name": "@finos/morphir-js-cli", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"fetch-quickjs": "bun scripts/fetch-quickjs.ts" | ||
}, | ||
"devDependencies": { | ||
"@terascope/fetch-github-release": "0.8.10", | ||
"@tsconfig/node18": "^18.2.4", | ||
"typescript": "5.4.5" | ||
}, | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { downloadRelease } from "@terascope/fetch-github-release"; | ||
import os from "node:os"; | ||
|
||
const user = "quickjs-ng"; | ||
const repo = "quickjs"; | ||
const outputDir = "out/quickjs/"; | ||
const leaveZipped = false; | ||
const disableLogging = false; | ||
|
||
function filterRelease(release) { | ||
return release.prerelease === false; | ||
} | ||
|
||
function filterAsset(asset) { | ||
const platform = os.platform(); | ||
if (asset.name.includes("wasi")) return true; | ||
if (asset.name.includes(platform)) return true; | ||
return false; | ||
} | ||
|
||
async function fetch() { | ||
try { | ||
await downloadRelease( | ||
user, | ||
repo, | ||
outputDir, | ||
filterRelease, | ||
filterAsset, | ||
leaveZipped, | ||
disableLogging | ||
); | ||
console.log("QuickJS downloaded successfully"); | ||
} catch (error) { | ||
console.error("Error downloading QuickJS", error); | ||
} | ||
} | ||
|
||
await fetch(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
{ | ||
"extends": "../../tsconfig.options.json", | ||
"include": [ | ||
"**/*" | ||
], | ||
"extends": "@tsconfig/node18/tsconfig.json", | ||
"include": ["src/**/*"], | ||
"references": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
language: typescript | ||
type: application | ||
platform: bun | ||
|
||
fileGroups: | ||
vite: | ||
- "vite.config.ts" | ||
- "**/*.ts" | ||
- "**/*.tsx" | ||
- "src/**/*.js" | ||
- "src/**/*.jsx" | ||
- "src/**/*.elm" | ||
elmSources: | ||
- "src" | ||
tags: | ||
- "elm" | ||
- "elm" | ||
|
||
tasks: | ||
bundle: | ||
command: "bunx --bun vite build --ssr" | ||
inputs: | ||
- '@globs(vite)' | ||
outputs: | ||
- "dist" | ||
build: | ||
deps: | ||
- target: "~:bundle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import CLI from "./elm/Morphir/Elm/CLI.elm"; | ||
const worker = CLI.init(); | ||
|
||
export function compileSource(source: string) { | ||
console.log("Compiling source: ", source); | ||
console.log("Worker: ", worker); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters