From 495a63977c3961ab9c8bb27cf5c249d724d1ab4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Wed, 31 May 2023 15:33:19 +0200 Subject: [PATCH] test: add unit tests to pipeline --- .gitignore | 3 + .gitlab-ci.yml | 49 +++- backend/backend/package.json | 8 +- .../backend/test/storage/bulk-storage.spec.ts | 1 - backend/proxy/package.json | 4 +- configuration/projectmanagement/package.json | 4 +- coverage.mjs | 4 +- examples/minimal-connector/package.json | 11 +- .../minimal-connector/test/common.spec.ts | 72 ++--- .../minimal-connector/test/connector.spec.ts | 32 +-- .../test/minimal-connector.spec.ts | 85 +++--- examples/minimal-plugin/package.json | 2 +- frontend/app/package.json | 2 +- package.json | 5 +- packages/api/package.json | 6 +- packages/api/src/connector-client.ts | 6 +- packages/collection-utils/package.json | 6 +- packages/core-tools/package.json | 6 +- packages/core/package.json | 6 +- packages/easy-ast/package.json | 8 +- packages/easy-ast/test/index.spec.ts | 5 +- packages/es-mapping-generator/package.json | 4 +- packages/gitlab-api/package.json | 3 +- packages/logger/package.json | 5 +- pnpm-lock.yaml | 247 +++--------------- sync.mjs | 102 -------- turbo.json | 9 +- typedoc.base.json | 5 + typedoc.json | 16 +- 29 files changed, 232 insertions(+), 484 deletions(-) delete mode 100644 sync.mjs create mode 100644 typedoc.base.json diff --git a/.gitignore b/.gitignore index 24e9ac0c..2e78bdac 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ pids .angular/ www/ +.docs.json +coverage.xml + # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78afc394..80bd4108 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,25 +4,56 @@ before_script: - echo TURBO_API=$TURBO_API >> .env.local - echo TURBO_TOKEN=$TURBO_TOKEN >> .env.local - echo TURBO_TEAM=$TURBO_TEAM >> .env.local + - corepack enable + - corepack prepare pnpm@latest-8 --activate + - pnpm config set store-dir .pnpm-store + +cache: + key: + files: + - pnpm-lock.yaml + paths: + - .pnpm-store stages: - build + - lint + - test + - docs build: stage: build - before_script: - - corepack enable - - corepack prepare pnpm@latest-7 --activate - - pnpm config set store-dir .pnpm-store script: - pnpm install + - pnpm build + +lint: + stage: lint + script: + - pnpm install + - pnpm build - pnpm run syncpack - pnpm lint - pnpm format + +test: + stage: test + script: + - pnpm install - pnpm build - cache: - key: - files: - - pnpm-lock.yaml + - pnpm test + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage.xml + +pages: + stage: docs + script: + - pnpm install + - pnpm run docs + - mv docs public + artifacts: paths: - - .pnpm-store \ No newline at end of file + - public diff --git a/backend/backend/package.json b/backend/backend/package.json index 334e40b7..d192d13a 100644 --- a/backend/backend/package.json +++ b/backend/backend/package.json @@ -20,15 +20,15 @@ "scripts": { "build": "tsup", "dev": "tsup --watch --onSuccess \"pnpm run start\"", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "tsc --noEmit && eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", "start": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node app.js", "start:debug": "cross-env STAPPS_LOG_LEVEL=31 NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true node app.js", - "test": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 c8 mocha", + "test": "pnpm run test:unit", "test:integration": "docker-compose -f integration-test.yml pull && docker-compose -f integration-test.yml up --build --abort-on-container-exit --exit-code-from apicli", - "test:unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 c8 mocha" + "test:unit": "cross-env NODE_CONFIG_ENV=elasticsearch ALLOW_NO_TRANSPORT=true STAPPS_LOG_LEVEL=0 mocha --exit" }, "dependencies": { "@elastic/elasticsearch": "8.4.0", @@ -76,7 +76,7 @@ "@types/sinon-express-mock": "1.3.9", "@types/supertest": "2.0.12", "@types/uuid": "8.3.4", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "chai-as-promised": "7.1.1", "conventional-changelog-cli": "2.2.2", diff --git a/backend/backend/test/storage/bulk-storage.spec.ts b/backend/backend/test/storage/bulk-storage.spec.ts index 493ee16b..4e787768 100644 --- a/backend/backend/test/storage/bulk-storage.spec.ts +++ b/backend/backend/test/storage/bulk-storage.spec.ts @@ -126,6 +126,5 @@ describe('Bulk Storage', function () { expect(caught).to.be.equal(123); }); - ``; }); }); diff --git a/backend/proxy/package.json b/backend/proxy/package.json index 9845ba37..e4bdd11d 100644 --- a/backend/proxy/package.json +++ b/backend/proxy/package.json @@ -17,7 +17,7 @@ "bin": "app.js", "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -52,7 +52,7 @@ "@types/sha1": "1.1.3", "@types/sinon": "10.0.14", "@types/sinon-chai": "3.2.9", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "mocha": "10.2.0", "sinon": "15.0.4", diff --git a/configuration/projectmanagement/package.json b/configuration/projectmanagement/package.json index 9f8c6152..d9c71c2d 100644 --- a/configuration/projectmanagement/package.json +++ b/configuration/projectmanagement/package.json @@ -20,7 +20,7 @@ }, "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -46,7 +46,7 @@ "@types/mustache": "4.2.2", "@types/node": "18.15.3", "@types/tmp": "0.2.3", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "chai-as-promised": "7.1.1", "mocha": "10.2.0", diff --git a/coverage.mjs b/coverage.mjs index 31676c44..cb8f2bcd 100755 --- a/coverage.mjs +++ b/coverage.mjs @@ -2,10 +2,8 @@ import {promisify} from 'node:util'; import {glob} from 'glob'; import {exec} from 'node:child_process'; -import {mkdir} from 'fs/promises'; const files = await glob('./*/*/coverage/cobertura-coverage.xml'); const args = files.map(it => `${it.split('/', 2)[1]}='${it}'`); -await mkdir('./coverage'); -console.log(await promisify(exec)(`cobertura-merge -o ./coverage/cobertura-coverage.xml ${args.join(' ')}`)); +console.log(await promisify(exec)(`cobertura-merge -o ./coverage.xml ${args.join(' ')}`)); diff --git a/examples/minimal-connector/package.json b/examples/minimal-connector/package.json index 99f99292..ac956c17 100644 --- a/examples/minimal-connector/package.json +++ b/examples/minimal-connector/package.json @@ -16,11 +16,11 @@ "types": "lib/index.d.ts", "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", - "test": "nyc mocha 'test/**/*.spec.ts'" + "test": "c8 mocha" }, "dependencies": { "@openstapps/api": "workspace:*", @@ -31,20 +31,18 @@ "devDependencies": { "@openstapps/core-tools": "workspace:*", "@openstapps/eslint-config": "workspace:*", - "@openstapps/nyc-config": "workspace:*", "@openstapps/prettier-config": "workspace:*", "@openstapps/tsconfig": "workspace:*", - "@testdeck/mocha": "0.3.3", "@types/chai": "4.3.5", "@types/chai-as-promised": "7.1.5", "@types/mocha": "10.0.1", "@types/node": "18.15.3", + "c8": "7.14.0", "chai": "4.3.7", "chai-as-promised": "7.1.1", "conventional-changelog-cli": "2.2.2", "mocha": "10.2.0", "nock": "13.3.1", - "nyc": "15.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "4.8.4" @@ -63,8 +61,5 @@ "extends": [ "@openstapps" ] - }, - "nyc": { - "extends": "@openstapps/nyc-config" } } diff --git a/examples/minimal-connector/test/common.spec.ts b/examples/minimal-connector/test/common.spec.ts index 349b57ec..941fd903 100644 --- a/examples/minimal-connector/test/common.spec.ts +++ b/examples/minimal-connector/test/common.spec.ts @@ -13,42 +13,41 @@ * this program. If not, see . */ import {SCThingType, SCBulkResponse, SCLicensePlate} from '@openstapps/core'; -import {expect} from 'chai'; -import {suite, test} from '@testdeck/mocha'; +import chai, {expect} from 'chai'; import {MinimalConnector} from '../src/minimal-connector.js'; import {createUUID, executeConnector, isValidSCNamespace} from '../src/common.js'; import nock = require('nock'); +import chaiAsPromised from 'chai-as-promised'; -@suite -export class CommonSpec { - private static connector: MinimalConnector; +chai.use(chaiAsPromised); - static async before() { - this.connector = new MinimalConnector('f-u', 'minimal-connector'); - } +describe('common', function () { + let connector: MinimalConnector; - @test - public isValidSCNamespace() { - const existingAddedSCLIcensePlate: SCLicensePlate = 'f-u'; - const notASCLicensePlate: string = 'NOT-A-LICENSE'; - const existingButUnaddedLicensePlate: SCLicensePlate = 'a-fh'; - expect(isValidSCNamespace(existingAddedSCLIcensePlate)).to.be.equal(true); + beforeEach(function () { + connector = new MinimalConnector('f-u', 'minimal-connector'); + }); + + it('should be a valid SCNamespace', function () { + const existingAddedSCLicensePlate: SCLicensePlate = 'f-u'; + const notASCLicensePlate = 'NOT-A-LICENSE'; + const existingButNotYetAddedLicensePlate: SCLicensePlate = 'a-fh'; + expect(isValidSCNamespace(existingAddedSCLicensePlate)).to.be.equal(true); expect(isValidSCNamespace(notASCLicensePlate)).to.be.equal(false); - expect(isValidSCNamespace(existingButUnaddedLicensePlate)).to.be.equal(false); - } + expect(isValidSCNamespace(existingButNotYetAddedLicensePlate)).to.be.equal(false); + }); - @test - testCreateUUID() { + it('should create a uuid', function () { const item = { type: 'Not even a thing', }; expect(createUUID(item, 'f-u')).to.equal('3ac2b548-75d3-5326-920a-241e514fe445'); // ID was generated once before! - } + }); - @test - async testExecuteConnector() { - const source = CommonSpec.connector.origin; + it('should exectute the connector', async function () { + const source = connector.origin; + const backendUrl = 'http://localhost:3000'; const bulkOpen: SCBulkResponse = { source: source, @@ -57,33 +56,18 @@ export class CommonSpec { uid: '744321ca-cc95-4967-b8df-42c98b792db6', }; - nock('http://localhost:3000').post('/bulk').reply(200, bulkOpen); + nock(backendUrl).post('/bulk').reply(200, bulkOpen); - const nockBulkAdd = nock('http://localhost:3000') - .post('/bulk/744321ca-cc95-4967-b8df-42c98b792db6') - .reply(201, {}) - .persist(); // otherwise consumed! + const nockBulkAdd = nock(backendUrl).post(`/bulk/${bulkOpen.uid}`).reply(201, {}).persist(); // otherwise consumed! - nock('http://localhost:3000').post('/bulk/744321ca-cc95-4967-b8df-42c98b792db6/done').reply(204, {}); + nock(backendUrl).post(`/bulk/${bulkOpen.uid}/done`).reply(204, {}); // should succeed - expect(await CommonSpec.runExecuteConnector()).to.equal(true); + expect(executeConnector(backendUrl, connector)).not.to.be.rejected; nockBulkAdd.persist(false); // should fail due to nockBulkAdd being consumed - expect(await CommonSpec.runExecuteConnector()).to.equal(false); - } - - /** - * Executes the connector - */ - static async runExecuteConnector(): Promise { - try { - await executeConnector('http://localhost:3000', CommonSpec.connector); - return true; - } catch (err) { - return false; - } - } -} + expect(executeConnector(backendUrl, connector)).to.be.rejected; + }); +}); diff --git a/examples/minimal-connector/test/connector.spec.ts b/examples/minimal-connector/test/connector.spec.ts index 05168611..9d9ff3f3 100644 --- a/examples/minimal-connector/test/connector.spec.ts +++ b/examples/minimal-connector/test/connector.spec.ts @@ -14,33 +14,29 @@ */ import {SCThingOriginType} from '@openstapps/core'; import {expect} from 'chai'; -import {suite, test} from '@testdeck/mocha'; import {MinimalConnector} from '../src/minimal-connector.js'; -@suite -export class ConnectorSpec { - private static connector: MinimalConnector; +describe('connector', function () { + let connector: MinimalConnector; - static async before() { - this.connector = new MinimalConnector('f-u', 'minimal-connector'); - } + beforeEach(function () { + connector = new MinimalConnector('f-u', 'minimal-connector'); + }); - @test - testCreateRemoteOrigin() { - const remoteOrigin = ConnectorSpec.connector.createRemoteOrigin(); - expect(remoteOrigin.name).to.equal(ConnectorSpec.connector.origin); + it('should create remote origin', function () { + const remoteOrigin = connector.createRemoteOrigin(); + expect(remoteOrigin.name).to.equal(connector.origin); expect(remoteOrigin.type).to.equal(SCThingOriginType.Remote); - expect(new Date().valueOf()).to.be.at.least(Date.parse(remoteOrigin.indexed).valueOf()); - } + expect(Date.now()).to.be.at.least(Date.parse(remoteOrigin.indexed).valueOf()); + }); - @test - async testAutomaticMissingUIDGeneration() { + it('should automatically generate missing UIDs', async function () { const uuidRegExp = new RegExp( '^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', ); - const messages = await ConnectorSpec.connector.getItems(); + const messages = await connector.getItems(); for (const message of messages) { expect(message.uid).to.match(uuidRegExp); } - } -} + }); +}); diff --git a/examples/minimal-connector/test/minimal-connector.spec.ts b/examples/minimal-connector/test/minimal-connector.spec.ts index 434021a4..f1982113 100644 --- a/examples/minimal-connector/test/minimal-connector.spec.ts +++ b/examples/minimal-connector/test/minimal-connector.spec.ts @@ -13,47 +13,49 @@ * this program. If not, see . */ import {SCThings, SCThingType} from '@openstapps/core'; -import {Validator} from '@openstapps/core-tools/lib/validate'; +import {Validator} from '@openstapps/core-tools'; import {expect} from 'chai'; -import {suite, test} from '@testdeck/mocha'; -import {join} from 'path'; +import path from 'path'; import {MinimalConnector} from '../src/minimal-connector.js'; +import * as url from 'url'; -@suite -export class MinimalConnectorSpec { - private static connector: MinimalConnector; - private static validator: Validator; +/** + * Gets the `SCThingType`-key as string + * + * @param instance Contains `type` with the value of a SCThingType-key + */ +function getSchemaNameFromType(instance: T): string { + const type = instance.type; + const index = Object.values(SCThingType).indexOf(type); + const key = Object.keys(SCThingType)[index]; + return `SC${key}`; +} - static async before() { - this.validator = new Validator(); - await this.validator.addSchemas( - join(__dirname, '..', 'node_modules', '@openstapps', 'core', 'lib', 'schema'), +describe('minimal-connector', function () { + let connector: MinimalConnector; + let validator: Validator; + + beforeEach(async function () { + validator = new Validator(); + await validator.addSchemas( + path.join( + path.dirname(url.fileURLToPath(import.meta.url)), + '..', + 'node_modules', + '@openstapps', + 'core', + 'lib', + 'schema', + ), ); - this.connector = new MinimalConnector('f-u', 'minimal-connector'); - } + connector = new MinimalConnector('f-u', 'minimal-connector'); + }); - /** - * Gets the `SCThingType`-key as string - * - * @param instance Contains `type` with the value of a SCThingType-key - */ - static getSchemaNameFromType(instance: T): string { - const type = instance.type; - const index = Object.values(SCThingType).indexOf(type); - const key = Object.keys(SCThingType)[index]; - return `SC${key}`; - } - - /** - * Checks, if the items are valid - * - * @param things Items fetched by the connector - */ - static validateThings(things: T[]) { - things.forEach((thing: T) => { - const schemaName = this.getSchemaNameFromType(thing); + it('should get sample things', async function () { + for (const thing of await connector.getItems()) { + const schemaName = getSchemaNameFromType(thing); // validate thing - const validatorResult = MinimalConnectorSpec.validator.validate(thing, schemaName); + const validatorResult = validator.validate(thing, schemaName); expect(validatorResult.errors).to.have.lengthOf( 0, JSON.stringify({ @@ -61,15 +63,6 @@ export class MinimalConnectorSpec { thing: thing, }), ); - }); - } - - @test - getSampleThings() { - return MinimalConnectorSpec.connector.getItems().then((items: T[]) => { - if (items.length > 0) { - MinimalConnectorSpec.validateThings(items); - } - }); - } -} + } + }); +}); diff --git a/examples/minimal-plugin/package.json b/examples/minimal-plugin/package.json index a123c5c5..fa0eec34 100644 --- a/examples/minimal-plugin/package.json +++ b/examples/minimal-plugin/package.json @@ -12,7 +12,7 @@ "bin": "app.js", "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", diff --git a/frontend/app/package.json b/frontend/app/package.json index 29731fda..1e0bee34 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -31,7 +31,7 @@ "docker:run:android": "sudo docker run -v $PWD:/app --privileged -v /dev/bus/usb:/dev/bus/usb --net=host -it registry.gitlab.com/openstapps/app bash -c \"npm run run:android\"", "docker:serve": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm run start:external\"", "e2e": "ng e2e", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "licenses": "license-checker --json > src/assets/about/licenses.json && ts-node ./scripts/accumulate-licenses.ts && git add src/assets/about/licenses.json", "lint": "ng lint", diff --git a/package.json b/package.json index 16c15c4b..39bb8d10 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "build": "dotenv -c -- turbo run build --filter=!@openstapps/app", "dev": "dotenv -c -- turbo run dev", - "docs": "typedoc", + "docs": "dotenv -c -- turbo run docs && typedoc", "format": "dotenv -c -- turbo run format", "format:fix": "dotenv -c -- turbo run format:fix", "lint": "dotenv -c -- turbo run lint --filter=!@openstapps/app", @@ -12,7 +12,8 @@ "publish-packages": "dotenv -c -- turbo run build format lint test && changeset version && changeset publish", "syncpack": "syncpack list-mismatches && syncpack lint-semver-ranges", "syncpack:fix": "syncpack format && syncpack fix-mismatches", - "test": "dotenv -c -- turbo run test --filter=!@openstapps/app && node coverage.mjs" + "test": "dotenv -c -- turbo run test --filter=!@openstapps/app && node coverage.mjs", + "turboify-pipeline": "pnpm build && pnpm run syncpack && pnpm lint && pnpm format && pnpm test && pnpm run docs" }, "devDependencies": { "@changesets/cli": "2.26.1", diff --git a/packages/api/package.json b/packages/api/package.json index 04f12e10..de84b4e9 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -22,7 +22,8 @@ }, "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/index.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -67,7 +68,7 @@ "@types/fs-extra": "9.0.13", "@types/json-schema": "7.0.11", "@types/mocha": "10.0.1", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "chai-as-promised": "7.1.1", "chai-spies": "1.0.0", @@ -77,6 +78,7 @@ "nock": "13.3.1", "ts-node": "10.9.1", "tsup": "6.7.0", + "typedoc": "0.24.7", "typescript": "4.8.4" }, "peerDependencies": { diff --git a/packages/api/src/connector-client.ts b/packages/api/src/connector-client.ts index db66f43e..a287ae19 100644 --- a/packages/api/src/connector-client.ts +++ b/packages/api/src/connector-client.ts @@ -26,7 +26,7 @@ import { SCThingUpdateRoute, } from '@openstapps/core'; import moment from 'moment'; -import clone = require('rfdc'); +import clone from 'rfdc'; import {v5} from 'uuid'; import {Bulk} from './bulk.js'; import {Client} from './client.js'; @@ -210,12 +210,12 @@ export class ConnectorClient extends Client { * @see ConnectorClient.bulk */ async index(things: T[], source?: string, timeout?: number): Promise { - // check that number of things is not zero + // check that the number of things is not zero if (things.length === 0) { throw new EmptyBulkError(); } - // set default source if none is given + // set the default source if none is given const thingSource = typeof source === 'undefined' ? 'stapps-api' : source; // request a new bulk diff --git a/packages/collection-utils/package.json b/packages/collection-utils/package.json index fa8222dd..2fa39fd7 100644 --- a/packages/collection-utils/package.json +++ b/packages/collection-utils/package.json @@ -6,7 +6,8 @@ "main": "lib/index.js", "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/index.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -19,11 +20,12 @@ "@types/chai": "4.3.5", "@types/mocha": "10.0.1", "@types/node": "18.15.3", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "mocha": "10.2.0", "ts-node": "10.9.1", "tsup": "6.7.0", + "typedoc": "0.24.7", "typescript": "4.8.4" }, "tsup": { diff --git a/packages/core-tools/package.json b/packages/core-tools/package.json index 5dc52edf..11e4c332 100644 --- a/packages/core-tools/package.json +++ b/packages/core-tools/package.json @@ -27,7 +27,8 @@ }, "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/index.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -70,12 +71,13 @@ "@types/mocha": "10.0.1", "@types/mustache": "4.2.2", "@types/node": "18.15.3", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "mocha": "10.2.0", "nock": "13.3.1", "ts-node": "10.9.1", "tsup": "6.7.0", + "typedoc": "0.24.7", "typescript": "4.8.4" }, "tsup": { diff --git a/packages/core/package.json b/packages/core/package.json index 2edd8d60..64e92305 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -27,7 +27,8 @@ "types": "./lib/index.d.ts", "scripts": { "build": "tsup --dts && pnpm run mappings && pnpm run schema", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/index.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -59,7 +60,7 @@ "@types/node": "18.15.3", "@typescript-eslint/eslint-plugin": "5.49.0", "@typescript-eslint/parser": "5.49.0", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "conditional-type-checks": "1.0.6", "mocha": "10.2.0", @@ -67,6 +68,7 @@ "surge": "0.23.1", "ts-node": "10.9.1", "tsup": "6.7.0", + "typedoc": "0.24.7", "typescript": "4.8.4" }, "tsup": { diff --git a/packages/easy-ast/package.json b/packages/easy-ast/package.json index dd8e86ec..52679ade 100644 --- a/packages/easy-ast/package.json +++ b/packages/easy-ast/package.json @@ -10,7 +10,8 @@ "types": "./lib/index.d.ts", "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/index.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -29,11 +30,12 @@ "@types/chai": "4.3.5", "@types/mocha": "10.0.1", "@types/node": "18.15.3", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "mocha": "10.2.0", "ts-node": "10.9.1", - "tsup": "6.7.0" + "tsup": "6.7.0", + "typedoc": "0.24.7" }, "tsup": { "entry": [ diff --git a/packages/easy-ast/test/index.spec.ts b/packages/easy-ast/test/index.spec.ts index cc580f0b..c75fc10d 100644 --- a/packages/easy-ast/test/index.spec.ts +++ b/packages/easy-ast/test/index.spec.ts @@ -26,7 +26,10 @@ const tests = await Promise.all( })), ); -describe('Easy AST', async function () { +describe('Easy AST', function () { + this.timeout(5000); + this.slow(2000); + it('should build the project', function () { const project = lightweightProjectFromPath(projectPath, true); expect(Object.keys(project).length).to.equal(tests.length); diff --git a/packages/es-mapping-generator/package.json b/packages/es-mapping-generator/package.json index df64ef8d..8ec9da60 100644 --- a/packages/es-mapping-generator/package.json +++ b/packages/es-mapping-generator/package.json @@ -12,7 +12,7 @@ }, "scripts": { "build": "rimraf lib && tsc", - "format": "prettier . --ignore-path ../../.gitignore", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint -c .eslintrc --ignore-path .eslintignore --ext .ts src/ test/", "lint:fix": "eslint --fix -c .eslintrc --ignore-path .eslintignore --ext .ts src/ test/", @@ -35,7 +35,7 @@ "@types/mocha": "10.0.1", "@types/node": "14.18.38", "@types/rimraf": "3.0.2", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "mocha": "10.2.0", "nock": "13.3.1", diff --git a/packages/gitlab-api/package.json b/packages/gitlab-api/package.json index e52e1771..3fa846b5 100644 --- a/packages/gitlab-api/package.json +++ b/packages/gitlab-api/package.json @@ -16,7 +16,8 @@ }, "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/api.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/" diff --git a/packages/logger/package.json b/packages/logger/package.json index fa49f754..73202336 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -15,7 +15,8 @@ "types": "./lib/index.d.ts", "scripts": { "build": "tsup --dts", - "format": "prettier . --ignore-path ../../.gitignore", + "docs": "typedoc --json ./docs/docs.json --options ../../typedoc.base.json src/index.ts", + "format": "prettier . -c --ignore-path ../../.gitignore", "format:fix": "prettier --write . --ignore-path ../../.gitignore", "lint": "eslint --ext .ts src/", "lint:fix": "eslint --fix --ext .ts src/", @@ -36,7 +37,7 @@ "@types/chai-spies": "1.0.3", "@types/mocha": "10.0.1", "@types/node": "18.15.3", - "c8": "7.13.0", + "c8": "7.14.0", "chai": "4.3.7", "chai-as-promised": "7.1.1", "chai-spies": "1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f918c28..60005adf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,9 +107,6 @@ importers: '@openstapps/eslint-config': specifier: workspace:* version: link:../../configuration/eslint-config - '@openstapps/nyc-config': - specifier: workspace:* - version: link:../../configuration/nyc-config '@openstapps/prettier-config': specifier: workspace:* version: link:../../configuration/prettier-config @@ -177,8 +174,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -316,8 +313,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -494,8 +491,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -556,18 +553,12 @@ importers: '@openstapps/eslint-config': specifier: workspace:* version: link:../../configuration/eslint-config - '@openstapps/nyc-config': - specifier: workspace:* - version: link:../../configuration/nyc-config '@openstapps/prettier-config': specifier: workspace:* version: link:../../configuration/prettier-config '@openstapps/tsconfig': specifier: workspace:* version: link:../../configuration/tsconfig - '@testdeck/mocha': - specifier: 0.3.3 - version: 0.3.3 '@types/chai': specifier: 4.3.5 version: 4.3.5 @@ -586,6 +577,9 @@ importers: '@typescript-eslint/parser': specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) + c8: + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -616,9 +610,6 @@ importers: nock: specifier: 13.3.1 version: 13.3.1 - nyc: - specifier: 15.1.0 - version: 15.1.0 prettier: specifier: 2.8.6 version: 2.8.6 @@ -1163,8 +1154,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -1210,6 +1201,9 @@ importers: tsup: specifier: 6.7.0 version: 6.7.0(ts-node@10.9.1)(typescript@4.8.4) + typedoc: + specifier: 0.24.7 + version: 0.24.7(typescript@4.8.4) typescript: specifier: 4.8.4 version: 4.8.4 @@ -1241,8 +1235,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -1273,6 +1267,9 @@ importers: tsup: specifier: 6.7.0 version: 6.7.0(ts-node@10.9.1)(typescript@4.8.4) + typedoc: + specifier: 0.24.7 + version: 0.24.7(typescript@4.8.4) typescript: specifier: 4.8.4 version: 4.8.4 @@ -1341,8 +1338,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -1382,6 +1379,9 @@ importers: tsup: specifier: 6.7.0 version: 6.7.0(ts-node@10.9.1)(typescript@4.8.4) + typedoc: + specifier: 0.24.7 + version: 0.24.7(typescript@4.8.4) typescript: specifier: 4.8.4 version: 4.8.4 @@ -1489,8 +1489,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -1524,6 +1524,9 @@ importers: tsup: specifier: 6.7.0 version: 6.7.0(ts-node@10.9.1)(typescript@4.8.4) + typedoc: + specifier: 0.24.7 + version: 0.24.7(typescript@4.8.4) typescript: specifier: 4.8.4 version: 4.8.4 @@ -1568,8 +1571,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -1600,6 +1603,9 @@ importers: tsup: specifier: 6.7.0 version: 6.7.0(ts-node@10.9.1)(typescript@4.8.4) + typedoc: + specifier: 0.24.7 + version: 0.24.7(typescript@4.8.4) packages/es-mapping-generator: dependencies: @@ -1653,8 +1659,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@3.8.3) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -1796,8 +1802,8 @@ importers: specifier: 5.49.0 version: 5.49.0(eslint@8.33.0)(typescript@4.8.4) c8: - specifier: 7.13.0 - version: 7.13.0 + specifier: 7.14.0 + version: 7.14.0 chai: specifier: 4.3.7 version: 4.3.7 @@ -7500,13 +7506,6 @@ packages: engines: {node: '>=8'} dev: true - /append-transform@2.0.0: - resolution: {integrity: sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==} - engines: {node: '>=8'} - dependencies: - default-require-extensions: 3.0.1 - dev: true - /aproba@2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} @@ -7514,10 +7513,6 @@ packages: resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==} dev: true - /archy@1.0.0: - resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==} - dev: true - /are-we-there-yet@3.0.1: resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -8272,8 +8267,8 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} - /c8@7.13.0: - resolution: {integrity: sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==} + /c8@7.14.0: + resolution: {integrity: sha512-i04rtkkcNcCf7zsQcSv/T9EbUn4RXQ6mropeMcjFOsQXQ0iGLAr/xT6TImQg4+U9hmNpN9XdvPkjUL1IzbgxJw==} engines: {node: '>=10.12.0'} hasBin: true dependencies: @@ -8401,16 +8396,6 @@ packages: engines: {node: '>=6'} dev: true - /caching-transform@4.0.0: - resolution: {integrity: sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==} - engines: {node: '>=8'} - dependencies: - hasha: 5.2.2 - make-dir: 3.1.0 - package-hash: 4.0.0 - write-file-atomic: 3.0.3 - dev: true - /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: @@ -9759,13 +9744,6 @@ packages: execa: 5.1.1 dev: true - /default-require-extensions@3.0.1: - resolution: {integrity: sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==} - engines: {node: '>=8'} - dependencies: - strip-bom: 4.0.0 - dev: true - /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: @@ -10323,10 +10301,6 @@ packages: next-tick: 1.1.0 dev: true - /es6-error@4.1.1: - resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==} - dev: true - /es6-iterator@2.0.3: resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} dependencies: @@ -11391,10 +11365,6 @@ packages: resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==} dev: true - /fromentries@1.3.2: - resolution: {integrity: sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==} - dev: true - /fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} @@ -11963,14 +11933,6 @@ packages: minimalistic-assert: 1.0.1 dev: true - /hasha@5.2.2: - resolution: {integrity: sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==} - engines: {node: '>=8'} - dependencies: - is-stream: 2.0.1 - type-fest: 0.8.1 - dev: true - /hdr-histogram-js@2.0.3: resolution: {integrity: sha512-Hkn78wwzWHNCp2uarhzQ2SGFLU3JY8SBDDd3TAABK4fc30wm+MuPOrg5QVFVfkKOQd6Bfz3ukJEI+q9sXEkK1g==} dependencies: @@ -12878,25 +12840,6 @@ packages: engines: {node: '>=8'} dev: true - /istanbul-lib-hook@3.0.0: - resolution: {integrity: sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==} - engines: {node: '>=8'} - dependencies: - append-transform: 2.0.0 - dev: true - - /istanbul-lib-instrument@4.0.3: - resolution: {integrity: sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==} - engines: {node: '>=8'} - dependencies: - '@babel/core': 7.21.3 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.0 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true - /istanbul-lib-instrument@5.2.1: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} @@ -12910,18 +12853,6 @@ packages: - supports-color dev: true - /istanbul-lib-processinfo@2.0.3: - resolution: {integrity: sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==} - engines: {node: '>=8'} - dependencies: - archy: 1.0.0 - cross-spawn: 7.0.3 - istanbul-lib-coverage: 3.2.0 - p-map: 3.0.0 - rimraf: 3.0.2 - uuid: 8.3.2 - dev: true - /istanbul-lib-report@3.0.0: resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} engines: {node: '>=8'} @@ -12944,17 +12875,6 @@ packages: - supports-color dev: true - /istanbul-lib-source-maps@4.0.1: - resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} - engines: {node: '>=10'} - dependencies: - debug: 4.3.4(supports-color@5.5.0) - istanbul-lib-coverage: 3.2.0 - source-map: 0.6.1 - transitivePeerDependencies: - - supports-color - dev: true - /istanbul-reports@3.1.5: resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} engines: {node: '>=8'} @@ -13620,6 +13540,7 @@ packages: /lodash.flattendeep@4.4.0: resolution: {integrity: sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==} + dev: false /lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} @@ -14648,13 +14569,6 @@ packages: vm-browserify: 1.1.2 dev: true - /node-preload@0.2.1: - resolution: {integrity: sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==} - engines: {node: '>=8'} - dependencies: - process-on-spawn: 1.0.0 - dev: true - /node-readfiles@0.2.0: resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==} dependencies: @@ -14892,42 +14806,6 @@ packages: - debug dev: true - /nyc@15.1.0: - resolution: {integrity: sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==} - engines: {node: '>=8.9'} - hasBin: true - dependencies: - '@istanbuljs/load-nyc-config': 1.1.0 - '@istanbuljs/schema': 0.1.3 - caching-transform: 4.0.0 - convert-source-map: 1.9.0 - decamelize: 1.2.0 - find-cache-dir: 3.3.2 - find-up: 4.1.0 - foreground-child: 2.0.0 - get-package-type: 0.1.0 - glob: 7.2.0 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-hook: 3.0.0 - istanbul-lib-instrument: 4.0.3 - istanbul-lib-processinfo: 2.0.3 - istanbul-lib-report: 3.0.0 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.5 - make-dir: 3.1.0 - node-preload: 0.2.1 - p-map: 3.0.0 - process-on-spawn: 1.0.0 - resolve-from: 5.0.0 - rimraf: 3.0.2 - signal-exit: 3.0.7 - spawn-wrap: 2.0.0 - test-exclude: 6.0.0 - yargs: 15.4.1 - transitivePeerDependencies: - - supports-color - dev: true - /oas-kit-common@1.0.8: resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} dependencies: @@ -15243,13 +15121,6 @@ packages: engines: {node: '>=6'} dev: true - /p-map@3.0.0: - resolution: {integrity: sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==} - engines: {node: '>=8'} - dependencies: - aggregate-error: 3.1.0 - dev: true - /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -15313,16 +15184,6 @@ packages: netmask: 2.0.2 dev: true - /package-hash@4.0.0: - resolution: {integrity: sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==} - engines: {node: '>=8'} - dependencies: - graceful-fs: 4.2.10 - hasha: 5.2.2 - lodash.flattendeep: 4.4.0 - release-zalgo: 1.0.0 - dev: true - /package-json@6.5.0: resolution: {integrity: sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==} engines: {node: '>=8'} @@ -16142,13 +16003,6 @@ packages: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /process-on-spawn@1.0.0: - resolution: {integrity: sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==} - engines: {node: '>=8'} - dependencies: - fromentries: 1.3.2 - dev: true - /process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} @@ -16797,13 +16651,6 @@ packages: dependencies: jsesc: 0.5.0 - /release-zalgo@1.0.0: - resolution: {integrity: sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==} - engines: {node: '>=4'} - dependencies: - es6-error: 4.1.1 - dev: true - /request-progress@3.0.0: resolution: {integrity: sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==} dependencies: @@ -17694,18 +17541,6 @@ packages: deprecated: Please use @jridgewell/sourcemap-codec instead dev: true - /spawn-wrap@2.0.0: - resolution: {integrity: sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==} - engines: {node: '>=8'} - dependencies: - foreground-child: 2.0.0 - is-windows: 1.0.2 - make-dir: 3.1.0 - rimraf: 3.0.2 - signal-exit: 3.0.7 - which: 2.0.2 - dev: true - /spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} dependencies: diff --git a/sync.mjs b/sync.mjs deleted file mode 100644 index 38221ac7..00000000 --- a/sync.mjs +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env node - -import {glob} from "glob"; -import {readFile, writeFile} from "fs/promises" - -const options = { - format: { - override: { - scripts: { - "format": "prettier . --ignore-path ../../.gitignore", - "format:fix": "prettier --write . --ignore-path ../../.gitignore" - }, - prettier: "@openstapps/prettier-config" - }, - if: "@openstapps/prettier-config" - }, - lint: { - override: { - scripts: { - "lint": "eslint --ext .ts src/", - "lint:fix": "eslint --fix --ext .ts src/" - }, - eslintConfig: { - extends: ["@openstapps"] - } - }, - if: "@openstapps/eslint-config" - }, - build: { - override: { - scripts: { - build: "tsup --dts", - }, - tsup: { - entry: ["src/index.ts"], - sourcemap: true, - clean: true, - format: "esm", - outDir: "lib" - }, - }, - if: "tsup" - } -} - -/** - * @param path {string} - * @returns {Promise} - */ -async function fixPackage(path) { - const file = JSON.parse(await readFile(path, 'utf-8')) - console.log(path) - /** @type {string[]} */ - const overrides = file['openstapps-configuration']?.['overrides'] || [] - /** @type {string[]} */ - const dependencies = Object.keys(file['devDependencies'] || {}) - - for (const option in options) { - if (overrides.includes(option)) continue - - const condition = options[option].if - const override = options[option].override - - if (!dependencies.includes(condition)) continue - if (option === 'build') { - const bin = file['bin'] - const entries = [] - if (typeof bin === 'string') { - entries.push(bin) - } else if (typeof bin === 'object') { - for (const key in bin) { - entries.push(bin[key]) - } - } - const main = file['main'] - if (main) { - entries.push(main) - } - - override['tsup']['entry'] = entries.map(it => it.replace(/^((\.\/)?lib\/)?/, 'src/').replace(/\.js$/, '.ts')) - } - - for (const key in override) { - if (key === 'scripts') { - for (const script in override[key]) { - file[key][script] = override[key][script] - } - } else { - file[key] = override[key] - } - } - } - - await writeFile(path, JSON.stringify(file, null, 2)) -} - -async function run() { - const packages = await glob('*/**/package.json') - await Promise.all(packages.map(fixPackage)) -} - -await run() diff --git a/turbo.json b/turbo.json index 3817ec08..36324396 100644 --- a/turbo.json +++ b/turbo.json @@ -4,6 +4,10 @@ "dependsOn": ["^build"], "outputs": ["lib/**", "www/**", ".angular/**"] }, + "docs": { + "dependsOn": ["^docs"], + "outputs": ["docs/**"] + }, "format": { "dependsOn": ["^format"] }, @@ -18,11 +22,10 @@ }, "test": { "dependsOn": ["^test"], - "outputs": ["coverage"] + "outputs": ["coverage/**"] }, "check-configuration": { "dependsOn": ["^check-configuration"] - }, - "docs": {} + } } } diff --git a/typedoc.base.json b/typedoc.base.json new file mode 100644 index 00000000..59676f00 --- /dev/null +++ b/typedoc.base.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "excludeExternals": true, + "includeVersion": true +} diff --git a/typedoc.json b/typedoc.json index d4cc3a19..6140abc7 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,15 +1,7 @@ { - "entryPointStrategy": "packages", - "entryPoints": [ - "packages/core", - "packages/api", - "packages/core-tools", - "packages/collection-utils", - "packages/gitlab-api", - "packages/logger", - "backend/backend", - "backend/proxy", - "configuration/projectmanagement" - ], + "entryPointStrategy": "merge", + "entryPoints": ["packages/**/docs/docs.json"], + "out": "./docs", + "includeVersion": true, "excludeExternals": true }