Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): fix browser build for concerto-util #970

Merged
merged 4 commits into from
Dec 12, 2024
Merged
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
2,606 changes: 1,151 additions & 1,455 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"name": "concerto",
"description": "Define and introspect data models",
"version": "3.19.9",
"version": "3.20.1",
"private": true,
"scripts": {
"coverage": "node ./scripts/coverage.js \"packages/concerto-*\" && nyc report -t coverage --cwd . --report-dir coverage --reporter=lcov && cat ./coverage/lcov.info",
Expand Down
92 changes: 46 additions & 46 deletions packages/concerto-analysis/package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"name": "@accordproject/concerto-analysis",
"version": "3.19.9",
"description": "Analysis of Concerto model files",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
"node": ">=18",
"npm": ">=10"
},
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"clean": "rimraf dist",
"prebuild": "npm-run-all clean",
"build": "tsc -p tsconfig.build.json",
"pretest": "npm-run-all lint",
"lint": "eslint .",
"test": "jest",
"test:watch": "jest --watchAll"
},
"repository": {
"type": "git",
"url": "https://github.com/accordproject/concerto.git",
"directory": "packages/concerto-analysis"
},
"keywords": [
"concerto",
"tools",
"modeling"
],
"author": "accordproject.org",
"license": "Apache-2.0",
"dependencies": {
"@accordproject/concerto-core": "3.19.6",
"semver": "7.6.3"
},
"devDependencies": {
"@accordproject/concerto-cto": "3.19.6",
"@types/semver": "7.5.8",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"eslint": "8.57.1",
"jest": "^29.7.0",
"npm-run-all": "4.1.5",
"ts-jest": "^29.2.5",
"typescript": "^5.7.2"
}
"name": "@accordproject/concerto-analysis",
"version": "3.20.1",
"description": "Analysis of Concerto model files",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
"node": ">=18",
"npm": ">=10"
},
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"clean": "rimraf dist",
"prebuild": "npm-run-all clean",
"build": "tsc -p tsconfig.build.json",
"pretest": "npm-run-all lint",
"lint": "eslint .",
"test": "jest",
"test:watch": "jest --watchAll"
},
"repository": {
"type": "git",
"url": "https://github.com/accordproject/concerto.git",
"directory": "packages/concerto-analysis"
},
"keywords": [
"concerto",
"tools",
"modeling"
],
"author": "accordproject.org",
"license": "Apache-2.0",
"dependencies": {
"@accordproject/concerto-core": "3.20.1",
"semver": "7.6.3"
},
"devDependencies": {
"@accordproject/concerto-cto": "3.20.1",
"@types/semver": "7.5.8",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"eslint": "8.57.1",
"jest": "^29.7.0",
"npm-run-all": "4.1.5",
"ts-jest": "^29.2.5",
"typescript": "^5.7.2"
}
}
6 changes: 3 additions & 3 deletions packages/concerto-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/concerto-core",
"version": "3.19.9",
"version": "3.20.1",
"description": "Core Implementation for the Concerto Modeling Language",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
Expand Down Expand Up @@ -64,9 +64,9 @@
"yargs": "17.7.2"
},
"dependencies": {
"@accordproject/concerto-cto": "3.19.6",
"@accordproject/concerto-cto": "3.20.1",
"@accordproject/concerto-metamodel": "3.10.4",
"@accordproject/concerto-util": "3.19.6",
"@accordproject/concerto-util": "3.20.1",
"dayjs": "1.11.13",
"debug": "4.3.7",
"lorem-ipsum": "2.0.8",
Expand Down
5 changes: 3 additions & 2 deletions packages/concerto-cto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/concerto-cto",
"version": "3.19.9",
"version": "3.20.1",
"description": "Parser for Concerto CTO files",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
Expand Down Expand Up @@ -45,14 +45,15 @@
"eslint": "8.57.1",
"jsdoc": "^4.0.4",
"mocha": "10.8.2",
"node-polyfill-webpack-plugin": "4.0.0",
"nyc": "17.1.0",
"peggy": "4.2.0",
"sinon": "19.0.2",
"typescript": "5.7.2"
},
"dependencies": {
"@accordproject/concerto-metamodel": "3.10.4",
"@accordproject/concerto-util": "3.19.6"
"@accordproject/concerto-util": "3.20.1"
},
"browserslist": "> 0.25%, not dead",
"nyc": {
Expand Down
17 changes: 15 additions & 2 deletions packages/concerto-cto/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

let path = require('path');
const webpack = require('webpack');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

const packageJson = require('./package.json');

Expand Down Expand Up @@ -45,6 +46,7 @@ module.exports = {
'NODE_ENV': JSON.stringify('production')
}
}),
new NodePolyfillPlugin(),
],
module: {
rules: [
Expand All @@ -64,7 +66,18 @@ module.exports = {
// Webpack 5 no longer polyfills Node.js core modules automatically.
// see https://webpack.js.org/configuration/resolve/#resolvefallback
// for the list of Node.js core module polyfills.
'path': 'path-browserify'
'fs': false,
'tls': false,
'net': false,
'child_process': false,
'os': false,
'path': false,
// 'crypto': require.resolve('crypto-browserify'),
// 'stream': require.resolve('stream-browserify'),
// 'http': require.resolve('stream-http'),
// 'https': require.resolve('https-browserify'),
// 'zlib': require.resolve('browserify-zlib'),
// 'vm2': require.resolve('vm-browserify'),
}
}
};
};
106 changes: 53 additions & 53 deletions packages/concerto-types/package.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
{
"name": "@accordproject/concerto-types",
"version": "3.19.9",
"description": "Types for the Concerto Modeling Language",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
"node": ">=18",
"npm": ">=10"
},
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"clean": "rimraf src/generated dist",
"codegen": "node scripts/codegen.js",
"prebuild": "npm-run-all clean codegen",
"build": "tsc",
"pretest": "npm-run-all prebuild lint",
"lint": "eslint .",
"test": "jest --passWithNoTests",
"test:watch": "jest --watchAll"
},
"repository": {
"type": "git",
"url": "https://github.com/accordproject/concerto.git",
"directory": "packages/concerto-types"
},
"keywords": [
"concerto",
"tools",
"modeling"
"name": "@accordproject/concerto-types",
"version": "3.20.1",
"description": "Types for the Concerto Modeling Language",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
"node": ">=18",
"npm": ">=10"
},
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"clean": "rimraf src/generated dist",
"codegen": "node scripts/codegen.js",
"prebuild": "npm-run-all clean codegen",
"build": "tsc",
"pretest": "npm-run-all prebuild lint",
"lint": "eslint .",
"test": "jest --passWithNoTests",
"test:watch": "jest --watchAll"
},
"repository": {
"type": "git",
"url": "https://github.com/accordproject/concerto.git",
"directory": "packages/concerto-types"
},
"keywords": [
"concerto",
"tools",
"modeling"
],
"author": "accordproject.org",
"license": "Apache-2.0",
"devDependencies": {
"@accordproject/concerto-codegen": "3.30.1",
"@accordproject/concerto-core": "3.20.1",
"@accordproject/concerto-util": "3.20.1",
"eslint": "8.57.1",
"jest": "29.7.0",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"ts-jest": "29.2.5"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"<rootDir>/dist/",
"/node_modules/"
],
"author": "accordproject.org",
"license": "Apache-2.0",
"devDependencies": {
"@accordproject/concerto-codegen": "3.30.1",
"@accordproject/concerto-core": "3.19.6",
"@accordproject/concerto-util": "3.19.6",
"eslint": "8.57.1",
"jest": "29.7.0",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"ts-jest": "29.2.5"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"<rootDir>/dist/",
"/node_modules/"
],
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.ts"
]
}
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.ts"
]
}
}
2 changes: 1 addition & 1 deletion packages/concerto-util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/concerto-util",
"version": "3.19.9",
"version": "3.20.1",
"description": "Utilities for Concerto Modeling Language",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/concerto-vocabulary/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@accordproject/concerto-vocabulary",
"version": "3.19.9",
"version": "3.20.1",
"description": "Associate human-readable text to model declarations",
"homepage": "https://github.com/accordproject/concerto",
"engines": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"author": "accordproject.org",
"license": "Apache-2.0",
"devDependencies": {
"@accordproject/concerto-core": "3.19.6",
"@accordproject/concerto-core": "3.20.1",
"chai": "4.3.6",
"chai-as-promised": "7.1.1",
"chai-things": "0.2.0",
Expand Down
Loading