diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index db0002ada5..21aedd579e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -206,6 +206,7 @@ jobs: - name: install run: | npm ci + npx nx run js-api:bundle npx nx run cli:bundle npx nx run testing:bundle - run: npx nx print-affected $NX_CALCULATION_FLAGS diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml index e5ec83fe25..59cd9f3d45 100644 --- a/.github/workflows/release-branch.yml +++ b/.github/workflows/release-branch.yml @@ -97,6 +97,7 @@ jobs: - name: install run: | npm ci + npx nx run js-api:bundle npx nx run cli:bundle npx nx run testing:bundle - uses: ./.github/actions/upload-node-modules-and-artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42df13e756..e33cfe6137 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,6 +102,7 @@ jobs: - name: install run: | npm ci + npx nx run js-api:bundle npx nx run cli:bundle npx nx run testing:bundle - uses: ./.github/actions/upload-node-modules-and-artifacts diff --git a/angular.json b/angular.json index 94dfb216a3..58eb353c0a 100644 --- a/angular.json +++ b/angular.json @@ -253,6 +253,35 @@ }, "defaultConfiguration": "production" }, + "bundle": { + "executor": "nx:run-commands", + "options": { + "commands": [ + { + "command": "echo cli bundle created" + } + ] + }, + "dependsOn": [ + "copyToNodeModules" + ] + }, + "copyToNodeModules": { + "executor": "nx:run-commands", + "options": { + "commands": [ + { + "command": "rm -rf ./node_modules/@alfresco/js-api/ && mkdir -p ./node_modules/@alfresco/js-api/ && cp -R ./dist/libs/js-api/* ./node_modules/@alfresco/js-api/" + } + ] + }, + "dependsOn": [ + { + "projects": "self", + "target": "build" + } + ] + }, "test": { "executor": "nx:run-commands", "options": { @@ -964,7 +993,7 @@ "options": { "commands": [ { - "command": "rm -rf ./node_modules/@alfresco/adf-testing/ && mkdir -p ./node_modules/@alfresco/adf-testing/ && cp -R ./dist/libs/testing/* ./node_modules/@alfresco/adf-testing/" + "command": "rm -rf ./node_modules/@alfresco/adf-testing/ && mkdir -p ./node_modules/@alfresco/adf-testing/ && cp -R ./dist/libs/testing/* ./node_modules/@alfresco/adf-testing/" } ] }, diff --git a/lib/cli/tsconfig.json b/lib/cli/tsconfig.json index dc0fa2dea1..77703f589a 100644 --- a/lib/cli/tsconfig.json +++ b/lib/cli/tsconfig.json @@ -21,7 +21,10 @@ "baseUrl": ".", "typeRoots": ["node_modules/@types"], "types": ["node"], - "paths": {} + "paths": { + "@alfresco/js-api": ["../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../dist/libs/js-api/*"] + } }, "exclude": ["dist/**/*", "./build.ts", "node_modules"] } diff --git a/lib/extensions/tsconfig.lib.json b/lib/extensions/tsconfig.lib.json index 7818c7e9f7..13687b012a 100644 --- a/lib/extensions/tsconfig.lib.json +++ b/lib/extensions/tsconfig.lib.json @@ -3,6 +3,10 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "declaration": true, - "declarationMap": true + "declarationMap": true, + "paths": { + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] + } } } diff --git a/lib/testing/shared/package.json b/lib/testing/src/lib/shared/package.json similarity index 100% rename from lib/testing/shared/package.json rename to lib/testing/src/lib/shared/package.json diff --git a/lib/testing/src/package.json b/lib/testing/src/package.json deleted file mode 100644 index 0ff46e2ea4..0000000000 --- a/lib/testing/src/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ngPackage": { - "lib": { - "entryFile": "./resources.ts", - "flatModuleFile": "adf-testing-resources" - } - } -} diff --git a/lib/testing/tsconfig.json b/lib/testing/tsconfig.json index 204cc68ba2..c311f0310d 100644 --- a/lib/testing/tsconfig.json +++ b/lib/testing/tsconfig.json @@ -8,9 +8,6 @@ }, { "path": "./tsconfig.lib.prod.json" - }, - { - "path": "./tsconfig.spec.json" } ], "compilerOptions": { diff --git a/lib/testing/tsconfig.lib.json b/lib/testing/tsconfig.lib.json index ebc50244d3..d6772281bc 100644 --- a/lib/testing/tsconfig.lib.json +++ b/lib/testing/tsconfig.lib.json @@ -1,8 +1,13 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/bla", + "outDir": "../../dist/out-tsc", "declaration": true, - "declarationMap": true + "declarationMap": true, + "resolveJsonModule": true, + "paths": { + "@alfresco/js-api": ["../../../dist/libs/js-api"], + "@alfresco/js-api/*": ["../../../dist/libs/js-api/*"] + } } } diff --git a/package-lock.json b/package-lock.json index 0239fa67a8..bea2563a11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@alfresco/js-api": ">=7.6.0", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.2", "@angular/common": "14.1.3", @@ -169,16 +168,6 @@ "node": ">=0.10.0" } }, - "node_modules/@alfresco/js-api": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.6.0.tgz", - "integrity": "sha512-HeWXMfyQLcE0R++LdM+Ex1ORzfF/T6//U3qVRnFzVRjEHlxkuWdZRF78XfK/1rt0PQndYhw9DRacCQyDcPydYw==", - "dependencies": { - "event-emitter": "^0.3.5", - "superagent": "^8.0.9", - "tslib": "^2.6.1" - } - }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "dev": true, diff --git a/package.json b/package.json index 7bd6dbb266..f88acb96a1 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "process services-cloud" ], "dependencies": { - "@alfresco/js-api": ">=7.6.0", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.2", "@angular/common": "14.1.3",