From e5b84cc322b9bc29e496ecb45133924a59cf77f8 Mon Sep 17 00:00:00 2001 From: CXN144 Date: Thu, 5 Sep 2024 09:29:10 -0400 Subject: [PATCH] updates on build --- cli/package.json | 3 + elm-tooling.json | 9 +-- gulpfile.js | 20 +++--- package-lock.json | 167 +--------------------------------------------- package.json | 9 ++- 5 files changed, 23 insertions(+), 185 deletions(-) create mode 100644 cli/package.json diff --git a/cli/package.json b/cli/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/cli/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/elm-tooling.json b/elm-tooling.json index e4c63d5bf..7806ab1cf 100644 --- a/elm-tooling.json +++ b/elm-tooling.json @@ -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" } -} +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 9e2bc8a40..c2a82f3d7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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') @@ -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') } @@ -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') } @@ -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') } @@ -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') } @@ -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 }) @@ -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(' '), @@ -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/')) } @@ -478,4 +478,4 @@ export default series( cleanupMorphirJVM ), build -); +); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6d9a5499b..ba281cb88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "morphir-elm", "version": "2.89.0", + "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "ajv": "^8.10.0", @@ -43,8 +44,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", @@ -84,76 +83,6 @@ "node": ">=6.0.0" } }, - "node_modules/@avh4/elm-format-darwin-arm64": { - "version": "0.8.7-2", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@avh4/elm-format-darwin-arm64/-/elm-format-darwin-arm64-0.8.7-2.tgz", - "integrity": "sha512-F5JD44mJ3KX960J5GkXMfh1/dtkXuPcQpX2EToHQKjLTZUfnhZ++ytQQt0gAvrJ0bzoOvhNzjNjUHDA1ruTVbg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@avh4/elm-format-darwin-x64": { - "version": "0.8.7-2", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@avh4/elm-format-darwin-x64/-/elm-format-darwin-x64-0.8.7-2.tgz", - "integrity": "sha512-4pfF1cl0KyTion+7Mg4XKM3yi4Yc7vP76Kt/DotLVGJOSag4ISGic1og2mt8RZZ7XArybBmHNyYkiUbe/cEiCw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@avh4/elm-format-linux-arm64": { - "version": "0.8.7-2", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@avh4/elm-format-linux-arm64/-/elm-format-linux-arm64-0.8.7-2.tgz", - "integrity": "sha512-WkVmuce2zU6s9dupHhqPc886Vaqpea8dZlxv2fpZ4wSzPUbiiKHoHZzoVndMIMTUL0TZukP3Ps0n/lWO5R5+FA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@avh4/elm-format-linux-x64": { - "version": "0.8.7-2", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@avh4/elm-format-linux-x64/-/elm-format-linux-x64-0.8.7-2.tgz", - "integrity": "sha512-kmncfJrTBjVT94JtQvMf4M5Pn2Yl0sZt3wo7AzgFiDnB/CiZ+KjJyXuWM64NeGiv4MQqzPq65tsFXUH1CIJeiQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@avh4/elm-format-win32-x64": { - "version": "0.8.7-2", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@avh4/elm-format-win32-x64/-/elm-format-win32-x64-0.8.7-2.tgz", - "integrity": "sha512-sBdMBGq/8mD8Y5C+fIr5vlb3N50yB7S1MfgeAq2QEbvkr/sKrCZI540i43lZDH9gWsfA1w2W8wCe0penFYzsGw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@babel/code-frame": { "version": "7.24.7", "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@babel/code-frame/-/code-frame-7.24.7.tgz", @@ -816,62 +745,6 @@ "node": ">=0.8.0" } }, - "node_modules/@elm_binaries/darwin_arm64": { - "version": "0.19.1-0", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@elm_binaries/darwin_arm64/-/darwin_arm64-0.19.1-0.tgz", - "integrity": "sha512-mjbsH7BNHEAmoE2SCJFcfk5fIHwFIpxtSgnEAqMsVLpBUFoEtAeX+LQ+N0vSFJB3WAh73+QYx/xSluxxLcL6dA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@elm_binaries/darwin_x64": { - "version": "0.19.1-0", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@elm_binaries/darwin_x64/-/darwin_x64-0.19.1-0.tgz", - "integrity": "sha512-QGUtrZTPBzaxgi9al6nr+9313wrnUVHuijzUK39UsPS+pa+n6CmWyV/69sHZeX9qy6UfeugE0PzF3qcUiy2GDQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@elm_binaries/linux_x64": { - "version": "0.19.1-0", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@elm_binaries/linux_x64/-/linux_x64-0.19.1-0.tgz", - "integrity": "sha512-T1ZrWVhg2kKAsi8caOd3vp/1A3e21VuCpSG63x8rDie50fHbCytTway9B8WHEdnBFv4mYWiA68dzGxYCiFmU2w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@elm_binaries/win32_x64": { - "version": "0.19.1-0", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@elm_binaries/win32_x64/-/win32_x64-0.19.1-0.tgz", - "integrity": "sha512-yDleiXqSE9EcqKtd9SkC/4RIW8I71YsXzMPL79ub2bBPHjWTcoyyeBbYjoOB9SxSlArJ74HaoBApzT6hY7Zobg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@gulpjs/messages": { "version": "1.1.0", "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@gulpjs/messages/-/messages-1.1.0.tgz", @@ -3517,44 +3390,6 @@ "dev": true, "license": "ISC" }, - "node_modules/elm": { - "version": "0.19.1-6", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/elm/-/elm-0.19.1-6.tgz", - "integrity": "sha512-mKYyierHICPdMx/vhiIacdPmTPnh889gjHOZ75ZAoCxo3lZmSWbGP8HMw78wyctJH0HwvTmeKhlYSWboQNYPeQ==", - "dev": true, - "hasInstallScript": true, - "license": "BSD-3-Clause", - "bin": { - "elm": "bin/elm" - }, - "engines": { - "node": ">=7.0.0" - }, - "optionalDependencies": { - "@elm_binaries/darwin_arm64": "0.19.1-0", - "@elm_binaries/darwin_x64": "0.19.1-0", - "@elm_binaries/linux_x64": "0.19.1-0", - "@elm_binaries/win32_x64": "0.19.1-0" - } - }, - "node_modules/elm-format": { - "version": "0.8.7", - "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/elm-format/-/elm-format-0.8.7.tgz", - "integrity": "sha512-sVzFXfWnb+6rzXK+q3e3Ccgr6/uS5mFbFk1VSmigC+x2XZ28QycAa7lS8owl009ALPhRQk+pZ95Eq5ANjpEZsQ==", - "dev": true, - "hasInstallScript": true, - "license": "BSD-3-Clause", - "bin": { - "elm-format": "bin/elm-format" - }, - "optionalDependencies": { - "@avh4/elm-format-darwin-arm64": "0.8.7-2", - "@avh4/elm-format-darwin-x64": "0.8.7-2", - "@avh4/elm-format-linux-arm64": "0.8.7-2", - "@avh4/elm-format-linux-x64": "0.8.7-2", - "@avh4/elm-format-win32-x64": "0.8.7-2" - } - }, "node_modules/elm-solve-deps-wasm": { "version": "1.0.2", "resolved": "https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/elm-solve-deps-wasm/-/elm-solve-deps-wasm-1.0.2.tgz", diff --git a/package.json b/package.json index a4acf8414..b352f64c4 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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", @@ -123,4 +122,4 @@ "glob": "^11.0.0", "package-json": "^8.1.1" } -} +} \ No newline at end of file