Skip to content

Commit

Permalink
updates on build
Browse files Browse the repository at this point in the history
  • Loading branch information
reebayroo committed Sep 5, 2024
1 parent 759d3f0 commit e5b84cc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 185 deletions.
3 changes: 3 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
9 changes: 5 additions & 4 deletions elm-tooling.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"tools": {
"elm": "0.19.1",
"elm-format": "0.8.5",
"elm-json": "0.2.13"
"elm": "0.19.1",
"elm-format": "0.8.7",
"elm-json": "0.2.13",
"elm-test-rs": "3.0.0"
}
}
}
20 changes: 10 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const buildCLI2 =
makeCLI2
)

const buildMorphirAPI2 = async () => {
export const buildMorphirAPI2 = async () => {
try {
await morphirElmMakeRunOldCli('.', './morphir-ir.json', { typesOnly: true })
await morphirElmGen('./morphir-ir.json', './lib/generated', 'TypeScript')
Expand Down Expand Up @@ -147,7 +147,7 @@ const build =


function morphirElmMake(projectDir, outputPath, options = {}) {
args = ['./cli/morphir-elm.js', 'make', '-p', projectDir, '-o', outputPath]
let args = ['./cli/morphir-elm.js', 'make', '-p', projectDir, '-o', outputPath]
if (options.typesOnly) {
args.push('--types-only')
}
Expand All @@ -156,7 +156,7 @@ function morphirElmMake(projectDir, outputPath, options = {}) {
}

function morphirElmMakeRunOldCli(projectDir, outputPath, options = {}) {
args = ['./cli/morphir-elm.js', 'make', '-f', '-p', projectDir, '-o', outputPath]
let args = ['./cli/morphir-elm.js', 'make', '-f', '-p', projectDir, '-o', outputPath]
if (options.typesOnly) {
args.push('--types-only')
}
Expand All @@ -165,7 +165,7 @@ function morphirElmMakeRunOldCli(projectDir, outputPath, options = {}) {
}

function morphirElmMake2(projectDir, outputPath, options = {}) {
args = ['./cli2/lib/morphir.js', 'make', '-p', projectDir, '-o', outputPath]
let args = ['./cli2/lib/morphir.js', 'make', '-p', projectDir, '-o', outputPath]
if (options.typesOnly) {
args.push('--types-only')
}
Expand All @@ -175,7 +175,7 @@ function morphirElmMake2(projectDir, outputPath, options = {}) {

// Generate the IR for the Json Schema mdel
function morphirElmMakeJsonSchema(projectDir, outputPath, options = {}) {
args = ['./cli2/lib/morphir.js', 'make', '-p', projectDir, '-o', outputPath]
let args = ['./cli2/lib/morphir.js', 'make', '-p', projectDir, '-o', outputPath]
if (options.typesOnly) {
args.push('--types-only')
}
Expand All @@ -184,14 +184,14 @@ function morphirElmMakeJsonSchema(projectDir, outputPath, options = {}) {
}

function morphirElmGen(inputPath, outputDir, target) {
args = ['./cli/morphir-elm.js', 'gen', '-i', inputPath, '-o', outputDir, '-t', target]
let args = ['./cli/morphir-elm.js', 'gen', '-i', inputPath, '-o', outputDir, '-t', target]
console.log("Running: " + args.join(' '));
return execa('node', args, { stdio })
}

// Test the json-schema-gen command.
async function morphirJsonSchemaGen(inputPath, outputDir, target) {
args = ['./cli2/lib/morphir-json-schema-gen.js', 'json-schema-gen', '-i', inputPath, '-o', outputDir, '-t', target]
let args = ['./cli2/lib/morphir-json-schema-gen.js', 'json-schema-gen', '-i', inputPath, '-o', outputDir, '-t', target]
console.log("Running: " + args.join(' '));
try {
await execa('node', args, { stdio })
Expand All @@ -208,7 +208,7 @@ function morphirDockerize(projectDir, options = {}) {
let projectDirFlag = '-p'
let overwriteDockerfileFlag = '-f'
let projectDirArgs = [projectDirFlag, projectDir]
args = [
let args = [
funcLocation,
command,
projectDirArgs.join(' '),
Expand All @@ -224,7 +224,7 @@ async function testUnit(cb) {
}

async function compileCli2Ts() {
src(['./cli2/*.ts', '!./cli2/*.test.ts']).pipe(cliTsProject()).pipe(dest('./cli2/lib/'))
src(['./cli2/*.ts','./cli2/package.json', '!./cli2/*.test.ts']).pipe(cliTsProject()).pipe(dest('./cli2/lib/'))
}


Expand Down Expand Up @@ -478,4 +478,4 @@ export default series(
cleanupMorphirJVM
),
build
);
);
167 changes: 1 addition & 166 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "morphir-elm",
"version": "2.89.0",
"description": "Elm bindings for Morphir",
"description": "Elm bindings for Morphir",
"type": "module",
"types": "lib/dist/main.d.ts",
"main": "lib/dist/main.js",
Expand All @@ -23,7 +23,8 @@
"build-cli2": "gulp buildCLI2",
"test-coverage": "elm-coverage src/ --open",
"build-value-editor": "elm make cli/src/Morphir/Web/Editor.elm --output=cli/web/valueEditor.js",
"setup-elm-tooling": "elm-tooling install"
"setup-elm-tooling": "elm-tooling install",
"postinstall": "elm-tooling install"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -77,8 +78,6 @@
"@typespec/compiler": "^0.59.1",
"@vercel/ncc": "^0.38.1",
"del-cli": "^5.1.0",
"elm": "^0.19.1-5",
"elm-format": "^0.8.5",
"elm-test": "^0.19.1-revision6",
"elm-tooling": "^1.15.0",
"execa": "^5.1.1",
Expand Down Expand Up @@ -123,4 +122,4 @@
"glob": "^11.0.0",
"package-json": "^8.1.1"
}
}
}

0 comments on commit e5b84cc

Please sign in to comment.