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

chore(jest): update version #925

Merged
merged 18 commits into from
Oct 21, 2024
56 changes: 56 additions & 0 deletions license-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"ignore": [
"scripts/**",
"**/*.zip",
"**/changelog.txt",
"**/*.tgz",
"**/.git",
"**/*.pegjs",
"packages/concerto-cto/lib/parser.js",
"**/jest.config.js",
"packages/*/scripts/**",
"**/generated/**",
"node_modules",
"**/out/**",
"**/HEADER",
"**/[.]*",
"**/[.]*/**",
"**/test/**",
"**/*.cto",
"**/*.d.ts",
"**/*.md",
"**/coverage/**",
"log",
"LICENSE",
"HEADER",
"packages/concerto-core/api.txt",
"**/*.snap"
],
"license": "HEADER",
"defaultFormat": {
"prepend": "/*",
"append": "*/"
},
"licenseFormats": {
"js": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"ts": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"dotfile|^Dockerfile": {
"eachLine": {
"prepend": "# "
}
}
},
"trailingWhitespace": "TRIM"
}
10,069 changes: 5,518 additions & 4,551 deletions package-lock.json

Large diffs are not rendered by default.

65 changes: 2 additions & 63 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"eslint": "8.2.0",
"jsdoc": "^4.0.2",
"glob": "^7.2.0",
"license-check-and-add": "2.3.6",
"license-check-and-add": "4.0.5",
"nyc": "15.1.0",
"semver": "7.5.4"
},
Expand All @@ -29,73 +29,12 @@
"scripts": {
"coverage": "node ./scripts/coverage.js \"packages/concerto-*\" && nyc report -t coverage --cwd . --report-dir coverage --reporter=lcov && cat ./coverage/lcov.info",
"pretest": "npm run licchk",
"licchk": "license-check-and-add",
"licchk": "license-check-and-add check -f license-config.json",
"test": "npm test -ws",
"build": "npm run build -ws"
},
"repository": {
"type": "git",
"url": "https://github.com/accordproject/concerto"
},
"license-check-and-add-config": {
"folder": ".",
"license": "HEADER",
"exact_paths_method": "EXCLUDE",
"exact_paths": [
".git",
".github",
".gitattributes",
".tern-project",
"node_modules",
"packages",
"softhsm",
"build.cfg",
"README.md",
"CONTRIBUTING.md",
"DEVELOPERS.md",
"NOTICES.md",
"CHARTER.md",
"ISSUE_TEMPLATE.md",
"MAINTAINERS.md",
"contrib-notes",
"log",
"LICENSE",
"HEADER",
"docs/",
"umd/",
"coverage",
".DS_Store",
"packages/concerto-core/api.txt",
"coverage",
"index.d.ts",
"packages/concerto-core/introspect/parser.js",
"node_modules",
".nyc-output"
],
"file_type_method": "EXCLUDE",
"file_types": [
".yml",
".yaml",
".zip",
".tgz"
],
"insert_license": false,
"license_formats": {
"js|njk|pegjs|cto|acl|qry": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"npmrc|editorconfig|txt": {
"eachLine": {
"prepend": "# "
}
},
"md": {
"file": "HEADER.md"
}
}
}
}
7 changes: 7 additions & 0 deletions packages/concerto-analysis/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
testEnvironment: 'node',
transform: {
'^.+.tsx?$': ['ts-jest', {}],
},
};
69 changes: 5 additions & 64 deletions packages/concerto-analysis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
"clean": "rimraf dist",
"prebuild": "npm-run-all clean",
"build": "tsc -p tsconfig.build.json",
"pretest": "npm-run-all licchk lint",
"pretest": "npm-run-all lint",
"lint": "eslint .",
"licchk": "license-check-and-add",
"test": "jest",
"test:watch": "jest --watchAll"
},
Expand All @@ -37,73 +36,15 @@
},
"devDependencies": {
"@accordproject/concerto-cto": "3.19.2",
"@types/jest": "28.1.1",
"@types/jest": "^29.5.13",
"@types/semver": "7.3.10",
"@typescript-eslint/eslint-plugin": "5.27.1",
"@typescript-eslint/parser": "5.27.1",
"eslint": "8.2.0",
"jest": "28.1.1",
"license-check-and-add": "2.3.6",
"jest": "^29.7.0",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"ts-jest": "28.0.4",
"typescript": "5.6.3"
},
"license-check-and-add-config": {
"folder": "./src",
"license": "HEADER",
"exact_paths_method": "EXCLUDE",
"exact_paths": [
"api.txt",
"composer-logs",
"coverage",
"index.d.ts",
"./system",
"./introspect/parser.js",
"LICENSE",
"node_modules",
".nyc-output",
"out",
".tern-project",
"./generated/concerto.ts",
"./generated/concerto.metamodel.ts"
],
"file_type_method": "EXCLUDE",
"file_types": [
".yml",
".yaml",
".zip",
".tgz"
],
"insert_license": false,
"license_formats": {
"js|ts|njk|pegjs|cto|acl|qry": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"npmrc|editorconfig|txt": {
"eachLine": {
"prepend": "# "
}
},
"md": {
"file": "./HEADER.md"
}
}
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"<rootDir>/dist/",
"/node_modules/"
],
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.ts"
]
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
}
}
2 changes: 1 addition & 1 deletion packages/concerto-core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class ModelLoader {
+ ModelManager[] loadModelManagerFromModelFiles(object[],string[],object,boolean?,boolean?,number?)
}
class ModelManager extends BaseModelManager {
+ void constructor(object?,boolean?,Object?,boolean?,boolean?)
+ void constructor(object?,boolean?,Object?,boolean?,boolean?,boolean?,boolean?,object?,string?,string?,processFile?)
+ ModelFile addCTOModel(string,string?,boolean?) throws IllegalModelException
}
+ object getRootModel()
Expand Down
3 changes: 3 additions & 0 deletions packages/concerto-core/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#

Version 3.19.2 {844c910d1f8f61ab31c34e85d8c51546} 2024-10-21
- update options for ModelManager

Version 3.19.2 {56bc38dc7305eee0a06f08a8cf639910} 2024-10-02
- validateDecorators option added to ModelManager
- update DecoratorManager to support validated decorators
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/lib/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class DecoratorManager {
return true;
} else {
Warning.printDeprecationWarning(
'Functionality for namespace targeted Decorator Command Sets has beed changed. Using namespace targets to apply decorators on all declarations in a namespace will be deprecated soon.',
'Functionality for namespace targeted Decorator Command Sets has changed. Using namespace targets to apply decorators on all declarations in a namespace will be deprecated soon.',
ErrorCodes.DEPRECATION_WARNING,
ErrorCodes.CONCERTO_DEPRECATION_001,
'Please refer to https://concerto.accordproject.org/deprecation/001'
Expand Down
3 changes: 0 additions & 3 deletions packages/concerto-core/lib/introspect/decorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ class Decorator {
const decoratedName = this.getParent().getFullyQualifiedName?.();
const mm = mf.getModelManager();
const validationOptions = mm.getDecoratorValidation();
console.log(`ModelManager.validationOptions: ${JSON.stringify(validationOptions)}`);

if (validationOptions.missingDecorator || validationOptions.invalidDecorator) {
try {
// this throws if the type does not exist
Expand Down Expand Up @@ -184,7 +182,6 @@ class Decorator {
}
}
catch (err) {
console.log(err);
this.handleError(validationOptions.missingDecorator, err);
}
}
Expand Down
8 changes: 7 additions & 1 deletion packages/concerto-core/lib/modelmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ class ModelManager extends BaseModelManager {
* @param {object} [options] - ModelManager options, also passed to Serializer
* @param {boolean} [options.strict] - require versioned namespaces and imports
* @param {Object} [options.regExp] - An alternative regular expression engine.
* @param {boolean} [options.metamodelValidation] - When true, modelfiles will be validated
* @param {boolean} [options.addMetamodel] - When true, the Concerto metamodel is added to the model manager
* @param {boolean} [options.enableMapType] - When true, the Concerto Map Type feature is enabled
* @param {boolean} [options.importAliasing] - When true, the Concerto Map Type feature is enabled
* @param {boolean} [options.importAliasing] - When true, the Concerto Aliasing feature is enabled
* @param {object} [options.decoratorValidation] - the decorator validation configuration
* @param {string} [options.decoratorValidation.missingDecorator] - the validation log level for missingDecorator decorators: off, warning, error
* @param {string} [options.decoratorValidation.invalidDecorator] - the validation log level for invalidDecorator decorators: off, warning, error
* @param {*} [processFile] - how to obtain a concerto AST from an input to the model manager
*/
constructor(options) {
super(options, ctoProcessFile(options));
Expand Down
46 changes: 0 additions & 46 deletions packages/concerto-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
"prepublishOnly": "npm run webpack",
"pretest": "npm run lint",
"lint": "eslint .",
"postlint": "npm run licchk",
"licchk": "license-check-and-add",
"postlicchk": "npm run doc",
"doc": "jsdoc --pedantic --recurse -c jsdoc.json",
"test": "node ./scripts/api-changelog.js && cross-env TZ=UTC nyc mocha --recursive -t 10000",
Expand Down Expand Up @@ -54,7 +52,6 @@
"fs-extra": "9.1.0",
"jsdoc": "^4.0.2",
"klaw": "3.0.0",
"license-check-and-add": "2.3.6",
"mocha": "10.0.0",
"mockery": "2.1.0",
"moxios": "0.4.0",
Expand Down Expand Up @@ -84,49 +81,6 @@
"uuid": "9.0.1"
},
"browserslist": "> 0.25%, not dead",
"license-check-and-add-config": {
"folder": "./lib",
"license": "HEADER",
"exact_paths_method": "EXCLUDE",
"exact_paths": [
"api.txt",
"composer-logs",
"coverage",
"index.d.ts",
"./system",
"LICENSE",
"node_modules",
".nyc-output",
"out",
"dist",
".tern-project"
],
"file_type_method": "EXCLUDE",
"file_types": [
".yml",
".yaml",
".zip",
".tgz"
],
"insert_license": false,
"license_formats": {
"js|njk|pegjs|cto|acl|qry": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"npmrc|editorconfig|txt": {
"eachLine": {
"prepend": "# "
}
},
"md": {
"file": "HEADER.md"
}
}
},
"nyc": {
"produce-source-map": "true",
"sourceMap": "inline",
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/test/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('DecoratorManager', () => {
it('should add decorators that target namespace and catch warning - behaviour to be deprecated', async function() {
// event listner to catch the warning
process.once('warning', (warning) => {
chai.expect(warning.message).to.be.equals('DEPRECATED: Functionality for namespace targeted Decorator Command Sets has beed changed. Using namespace targets to apply decorators on all declarations in a namespace will be deprecated soon.');
chai.expect(warning.message).to.be.equals('DEPRECATED: Functionality for namespace targeted Decorator Command Sets has changed. Using namespace targets to apply decorators on all declarations in a namespace will be deprecated soon.');
chai.expect(warning.name).to.be.equals(DEPRECATION_WARNING);
chai.expect(warning.code).to.be.equals(CONCERTO_DEPRECATION_001);
chai.expect(warning.detail).to.be.equals('Please refer to https://concerto.accordproject.org/deprecation/001');
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/test/introspect/decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('Decorators', () => {

describe('#validate', () => {

it.only('should prevent attaching the same decorator twice', () => {
it('should prevent attaching the same decorator twice', () => {

(() => {
const modelManager = new ModelManager();
Expand Down
Loading
Loading