Skip to content

Commit

Permalink
chore: move monorepo jest helpers method to o3r-workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-crouzet committed Oct 27, 2023
1 parent 1f24d8d commit 65b1259
Show file tree
Hide file tree
Showing 77 changed files with 142 additions and 205 deletions.
1 change: 0 additions & 1 deletion apps/chrome-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/localization": "workspace:^",
Expand Down
1 change: 0 additions & 1 deletion apps/github-cascading-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@nx/jest": "~16.10.0",
"@nx/js": "~16.10.0",
"@nx/linter": "~16.10.0",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/ejs": "^3.1.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
"@angular/compiler-cli": "~16.2.0",
"@ng-bootstrap/ng-bootstrap": "^15.1.1",
"@nx/eslint-plugin": "~16.10.0",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/workspace": "workspace:^",
"@playwright/test": "~1.39.0",
"@schematics/angular": "~16.2.0",
"@types/bootstrap": "^5.2.6",
Expand Down
1 change: 0 additions & 1 deletion apps/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/schematics": "workspace:^",
"@types/eslint": "^8.42.0",
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getJestProjects } = require('@o3r/dev-tools');
const { getJestProjects } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ut.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

globalThis.ngJest = {
skipNgcc: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@
"@nx/linter": "~16.10.0",
"@nx/workspace": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/workspace": "workspace:^",
"@schematics/angular": "~16.2.0",
"@swc-node/register": "^1.6.7",
"@swc/core": "^1.3.85",
Expand Down
1 change: 0 additions & 1 deletion packages/@ama-sdk/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@schematics/angular": "~16.2.0",
"@swc/cli": "^0.1.57",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"@nx/js": "~16.10.0",
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@o3r/workspace": "workspace:^",
"@types/jest": "~29.5.2",
"@types/minimist": "^1.2.2",
"@types/node": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/create/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/schematics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"dependencies": {
"@angular-devkit/core": "~16.2.0",
"@angular-devkit/schematics": "~16.2.0",
"@o3r/dev-tools": "workspace:^",
"js-yaml": "^4.1.0",
"minimatch": "~9.0.3",
"rxjs": "^7.8.1",
Expand All @@ -70,6 +69,7 @@
"@o3r/build-helpers": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/workspace": "workspace:^",
"@openapitools/openapi-generator-cli": "~2.7.0",
"@schematics/angular": "~16.2.0",
"@types/jest": "~29.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/schematics/schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const registerPackageSchematics = async (tree: Tree, context: SchematicContext)
}
const amaSdkSchematicsPackageJsonContent = JSON.parse(readFileSync(path.resolve(__dirname, '..', '..', 'package.json'), {encoding: 'utf-8'})) as PackageJson;
const amaSdkSchematicsVersion = amaSdkSchematicsPackageJsonContent.version?.replace(/^v/, '');
const schematicsDependencies = ['@o3r/dev-tools', '@o3r/schematics'];
const schematicsDependencies = ['@o3r/schematics'];
for (const dependency of schematicsDependencies) {
context.addTask(new DevInstall({
packageName: dependency + (amaSdkSchematicsVersion ? `@${amaSdkSchematicsVersion}` : ''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
]
},
"dependencies": {
"@o3r/dev-tools": "~<%= sdkCoreVersion %>",
"@swc/helpers": "^0.5.0",
"tslib": "<%= versions['tslib'] %>"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/schematics/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
9 changes: 3 additions & 6 deletions packages/@ama-sdk/showcase-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,22 @@
"lint:ci": "eslint '**/*[jt]s' --quiet --format junit --output-file ./dist-lint/result.xml",
"lint": "eslint '**/*[jt]s' --cache",
"start": "tsc-watch -b tsconfigs/esm2020 --noClear --onFirstSuccess \"yarn run files:pack --watch\"",
"build": "yarn run build:cjs && yarn run build:esm2015 && yarn run build:esm2020 && yarn run build:entries",
"build": "yarn run build:cjs && yarn run build:esm2015 && yarn run build:esm2020 && yarn run files:pack",
"build:cjs": "swc src -d dist/cjs -C module.type=commonjs -q",
"build:esm2015": "swc src -d dist/esm2015 -C module.type=es6 -q",
"build:esm2020": "tsc -b tsconfigs/esm2020",
"build:entries": "yarn run files:pack && yarn exec generate-package-exports",
"set:version": "set-version --placeholder 0.0.0-placeholder",
"resolve": "node -e 'process.stdout.write(require.resolve(process.argv[1]));'",
"generate": "schematics ../schematics/dist:typescript-core --spec-path ./swagger-spec.yaml",
"spec:regen": "yarn run generate --no-dry-run && yarn exec clear-index",
"clear-index": "node scripts/clear-index.js",
"files:pack": "node scripts/files-pack.js",
"spec:regen": "yarn run generate --no-dry-run && amasdk-clear-index",
"files:pack": "amasdk-files-pack",
"test": "jest --passWithNoTests",
"publish:package": "npm publish ./dist",
"generate:mock": "schematics @ama-sdk/schematics:mock",
"doc:generate": "node scripts/override-readme.js && typedoc && node scripts/restore-readme.js",
"tools:changelog": "standard-version"
},
"dependencies": {
"@o3r/dev-tools": "workspace:^",
"@swc/helpers": "^0.5.0",
"tslib": "^2.5.3"
},
Expand Down
1 change: 0 additions & 1 deletion packages/@ama-terasu/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@o3r/amaterasu-otter": "workspace:^",
"@o3r/amaterasu-sdk": "workspace:^",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/minimist": "^1.2.2",
Expand Down
1 change: 0 additions & 1 deletion packages/@ama-terasu/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/minimist": "^1.2.2",
Expand Down
1 change: 0 additions & 1 deletion packages/@ama-terasu/schematics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/node": "^18.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/@o3r/amaterasu/amaterasu-api-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/js-yaml": "^4.0.5",
Expand Down
1 change: 0 additions & 1 deletion packages/@o3r/amaterasu/amaterasu-dodo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/node": "^18.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/@o3r/amaterasu/amaterasu-otter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/js-yaml": "^4.0.5",
Expand Down
1 change: 0 additions & 1 deletion packages/@o3r/amaterasu/amaterasu-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@nx/eslint-plugin": "~16.10.0",
"@nx/jest": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
"@types/js-yaml": "^4.0.5",
Expand Down
3 changes: 1 addition & 2 deletions packages/@o3r/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@angular/router": "~16.2.0",
"@ngrx/store": "~16.3.0",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/schematics": "workspace:^",
"@schematics/angular": "~16.2.0",
"jasmine": "^5.0.0",
Expand Down Expand Up @@ -76,9 +75,9 @@
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@o3r/workspace": "workspace:^",
"@schematics/angular": "~16.2.0",
"@types/jasmine": "~4.6.0",
"@types/jest": "~29.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/analytics/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
3 changes: 1 addition & 2 deletions packages/@o3r/apis-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@angular-devkit/schematics": "~16.2.0",
"@angular/common": "~16.2.0",
"@angular/core": "~16.2.0",
"@o3r/dev-tools": "workspace:^",
"@o3r/schematics": "workspace:^",
"@schematics/angular": "~16.2.0",
"rxjs": "^7.8.1",
Expand Down Expand Up @@ -60,10 +59,10 @@
"@nx/js": "~16.10.0",
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@o3r/workspace": "workspace:^",
"@schematics/angular": "~16.2.0",
"@types/jest": "~29.5.2",
"@types/node": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/apis-manager/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
2 changes: 0 additions & 2 deletions packages/@o3r/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@angular/common": "~16.2.0",
"@angular/core": "~16.2.0",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/logger": "workspace:^",
"@o3r/routing": "workspace:^",
"@o3r/schematics": "workspace:^",
Expand Down Expand Up @@ -68,7 +67,6 @@
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/logger": "workspace:^",
"@o3r/routing": "workspace:^",
Expand Down
3 changes: 1 addition & 2 deletions packages/@o3r/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@ngrx/store": "~16.3.0",
"@o3r/configuration": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/extractors": "workspace:^",
"@o3r/logger": "workspace:^",
"@o3r/schematics": "workspace:^",
Expand Down Expand Up @@ -95,14 +94,14 @@
"@o3r/build-helpers": "workspace:^",
"@o3r/configuration": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/extractors": "workspace:^",
"@o3r/localization": "workspace:^",
"@o3r/logger": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@o3r/testing": "workspace:^",
"@o3r/workspace": "workspace:^",
"@schematics/angular": "~16.2.0",
"@types/jest": "~29.5.2",
"@types/node": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/components/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
3 changes: 1 addition & 2 deletions packages/@o3r/configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@ngrx/entity": "~16.3.0",
"@ngrx/store": "~16.3.0",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/logger": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/testing": "workspace:^",
Expand Down Expand Up @@ -90,12 +89,12 @@
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/core": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/logger": "workspace:^",
"@o3r/schematics": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@o3r/testing": "workspace:^",
"@o3r/workspace": "workspace:^",
"@schematics/angular": "~16.2.0",
"@types/jasmine": "~4.6.0",
"@types/jest": "~29.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/configuration/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
"@nx/js": "~16.10.0",
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@o3r/test-helpers": "workspace:^",
"@o3r/workspace": "workspace:^",
"@schematics/angular": "~16.2.0",
"@types/jest": "~29.5.2",
"@types/minimist": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/core/testing/jest.config.it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('node:path');
const { getJestModuleNameMapper } = require('@o3r/dev-tools');
const { getJestModuleNameMapper } = require('@o3r/workspace');

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
Expand Down
1 change: 0 additions & 1 deletion packages/@o3r/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@nx/js": "~16.10.0",
"@nx/linter": "~16.10.0",
"@o3r/build-helpers": "workspace:^",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
"@o3r/eslint-plugin": "workspace:^",
"@types/jest": "~29.5.2",
Expand Down
1 change: 1 addition & 0 deletions packages/@o3r/dev-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dependencies": {
"@o3r/artifactory-tools": "workspace:^",
"@o3r/azure-tools": "workspace:^",
"@o3r/workspace": "workspace:^",
"@types/request-promise-native": "^1.0.18",
"azure-devops-node-api": "^12.0.0",
"chalk": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/@o3r/dev-tools/src/utils/check-peer-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { satisfies } from 'semver';

/**
* Interface containing a npm package name, needed version and optionally found version
* @deprecated will be removed in Otter v12.
* @deprecated You can use the one expose in `@o3r/schematics`, will be removed in Otter v12.
*/
export interface PackageVersion {
/** Npm package name */
Expand All @@ -18,7 +18,7 @@ export interface PackageVersion {
/**
* Check if the first level of peer deps of a given package are installed.
* List all not installed packages or packages with version mismatch
* @deprecated will be removed in Otter v12.
* @deprecated You can use the one expose in `@o3r/schematics`, will be removed in Otter v12.
* @param packageName
*/
export function getPackagesToInstallOrUpdate(packageName: string) {
Expand Down
Loading

0 comments on commit 65b1259

Please sign in to comment.