diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6585695..c9e21769 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: ref: "" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} @@ -36,17 +36,17 @@ jobs: echo "BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Docker ILC auth run: echo "${{ secrets.DOCKER_HUB_BROTHERS_TOKEN }}" | docker login --username brothers --password-stdin - name: Build the Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: ./ilc platforms: linux/amd64,linux/arm64 @@ -62,12 +62,12 @@ jobs: run: docker run namecheap/ilc_tmp:$SHA npm run test:ci - name: Run server-side tests coverage - run: docker run --volume $(pwd)/artifacts/ilc/.test_output/server:/temporary namecheap/ilc_tmp:$SHA bash -c "npm run test:coverage && mv .nyc_output/* /temporary" + run: docker run --volume $(pwd)/artifacts/ilc/coverage/server:/.coverage namecheap/ilc_tmp:$SHA bash -c "npm run test:coverage && mv .nyc_output/* /.coverage" - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.branch.name }}-server-side-tests-artifacts - path: artifacts/ilc/.test_output/server/ + path: artifacts/ilc/coverage/server - name: Build the Docker image to test client-side run: | @@ -78,12 +78,12 @@ jobs: run: | echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf sudo sysctl -p - docker run --volume $(pwd)/artifacts/ilc/.test_output/client:/temporary ilc:tmp-test-client bash -c "npm run test:client -- --browsers ChromeHeadlessWithoutSecurity && mv .karma_output/* /temporary" + docker run --volume $(pwd)/artifacts/ilc/coverage/client:/.coverage ilc:tmp-test-client bash -c "npm run test:client -- --browsers ChromeHeadlessWithoutSecurity && mv .karma_output/* /.coverage" - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.branch.name }}-client-side-tests-artifacts - path: artifacts/ilc/.test_output/client/ + path: artifacts/ilc/coverage/client build_registry: name: Build Registry @@ -100,7 +100,7 @@ jobs: ref: "" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} @@ -112,7 +112,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 with: buildkitd-flags: --debug @@ -181,7 +181,7 @@ jobs: options: --name=postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch.ref }} @@ -195,7 +195,7 @@ jobs: run: >- bash ./registry/scripts/reset.sh; docker run - --volume $(pwd)/artifacts/registry/.test_output:/temporary + --volume $(pwd)/artifacts/registry/coverage:/.coverage --network ${{ job.container.network }} -e DB_CLIENT=${{ matrix.database.client }} -e DB_HOST=${{ matrix.database.host }} @@ -204,12 +204,12 @@ jobs: -e DB_PASSWORD=pwd -e DB_NAME=$DB_NAME namecheap/ilc_tmp:reg_$SHA - sh -c "npm run test:ci && mv .nyc_output/* /temporary" + sh -c "npm run test:ci && mv .nyc_output/* /.coverage" - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.branch.name }}-${{ matrix.database.client }}-registry-tests-artifacts - path: artifacts/registry/.test_output/ + path: ./artifacts/registry/coverage e2e_tests: name: Run E2E tests @@ -245,10 +245,10 @@ jobs: options: --name=postgres --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.8.0 cache: 'npm' @@ -271,7 +271,7 @@ jobs: DB_PASSWORD: pwd DB_NAME: ilc - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: e2e-tests-artifacts @@ -283,8 +283,8 @@ jobs: needs: [build_ilc, registry_tests] if: github.base_ref steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - name: Create coverage report for ilc/server id: ilc-server-coverage-report uses: namecheap/Coverage-Diff@master @@ -320,7 +320,7 @@ jobs: postComment: false oldCodeCoveragePath: ./dest-merged-registry-tests-artifacts/coverage/coverage-summary.json newCodeCoveragePath: ./src-merged-registry-tests-artifacts/coverage/coverage-summary.json - total_delta: 2 + total_delta: 6 - name: Compose comment if: success() || failure() run: | @@ -377,7 +377,7 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the Docker image run: | diff --git a/ilc/client/AsyncBootUp.js b/ilc/client/AsyncBootUp.js index c68562e8..9af122d5 100644 --- a/ilc/client/AsyncBootUp.js +++ b/ilc/client/AsyncBootUp.js @@ -58,7 +58,7 @@ export default class AsyncBootUp { return res; } - const overridesEl = slotEl.querySelector('script[type="spa-config-override"]'); + const overridesEl = slotEl.querySelector('script[type="text/spa-config-override"]'); if (overridesEl) { const conf = JSON.parse(overridesEl.innerHTML); diff --git a/ilc/client/AsyncBootUp.spec.js b/ilc/client/AsyncBootUp.spec.js index 34395336..5009eade 100644 --- a/ilc/client/AsyncBootUp.spec.js +++ b/ilc/client/AsyncBootUp.spec.js @@ -195,7 +195,7 @@ describe('async boot up', () => { Hello! I am Body SPA. I have SPA override config, so I should override dependencies and return my override SPA config. - +
@@ -203,7 +203,7 @@ describe('async boot up', () => { I have SPA override config, so I should return my override SPA config. But I don't have any dependencies, so I should not override them.
- +
`; @@ -271,10 +271,10 @@ describe('async boot up', () => { ]); chai.expect(document.getElementById(slots.body.id).innerHTML).does.not.include( - ``, + ``, ); chai.expect(document.getElementById(slots.footer.id).innerHTML).does.not.include( - ``, + ``, ); }); @@ -304,7 +304,7 @@ describe('async boot up', () => { routing event. It means I don't have to mark myself as ready and I should not override initial SPA config. - @@ -328,7 +328,7 @@ describe('async boot up', () => { chai.expect(logger.info.called).to.be.false; chai.expect(document.getElementById(slots.footer.id).innerHTML).includes( - ``, + ``, ); }); }); diff --git a/ilc/client/WrapApp.spec.js b/ilc/client/WrapApp.spec.js index 68e80552..d377943e 100644 --- a/ilc/client/WrapApp.spec.js +++ b/ilc/client/WrapApp.spec.js @@ -62,11 +62,11 @@ describe('WrapApp', () => { } /** - * Init fake + * Init fake * @param {Object} config */ function initFakeIlcConfig(config = {}) { - const existentIlcConfigScriptEl = document.querySelector('script[type="ilc-config"]'); + const existentIlcConfigScriptEl = document.querySelector('script[type="text/ilc-config"]'); if (existentIlcConfigScriptEl) { existentIlcConfigScriptEl.innerHTML = JSON.stringify(config); @@ -74,7 +74,7 @@ describe('WrapApp', () => { } const ilcConfigScriptElAttr = document.createAttribute('type'); - ilcConfigScriptElAttr.value = 'ilc-config'; + ilcConfigScriptElAttr.value = 'text/ilc-config'; const ilcConfigScriptEl = document.createElement('script'); ilcConfigScriptEl.innerHTML = JSON.stringify(config); diff --git a/ilc/client/configuration/IlcConfigRoot.js b/ilc/client/configuration/IlcConfigRoot.js index 58e99054..cc473c4e 100644 --- a/ilc/client/configuration/IlcConfigRoot.js +++ b/ilc/client/configuration/IlcConfigRoot.js @@ -2,7 +2,7 @@ import { decodeHtmlEntities } from '../../common/utils'; export class IlcConfigRoot { constructor() { - const ilcConfigurationNode = document.querySelector('script[type="ilc-config"]'); + const ilcConfigurationNode = document.querySelector('script[type="text/ilc-config"]'); if (ilcConfigurationNode === null) { throw new Error("Can't find single-spa configuration node. Looks like server side problem occurs."); diff --git a/ilc/server/tailor/configs-injector.js b/ilc/server/tailor/configs-injector.js index 76ff99c9..be6b09fe 100644 --- a/ilc/server/tailor/configs-injector.js +++ b/ilc/server/tailor/configs-injector.js @@ -197,7 +197,7 @@ module.exports = class ConfigsInjector { dynamicLibs: registryConfig.dynamicLibs, }); - return ``; + return ``; }; #getIlcState = (request) => { diff --git a/ilc/server/tailor/configs-injector.spec.js b/ilc/server/tailor/configs-injector.spec.js index 705b0ca4..5e773ac1 100644 --- a/ilc/server/tailor/configs-injector.spec.js +++ b/ilc/server/tailor/configs-injector.spec.js @@ -281,7 +281,7 @@ describe('configs injector', () => { '' + '' + `` + - `` + + `` + '' + `` + + `` + '' + `` + browserTimingHeader + diff --git a/ilc/server/tailor/fragment-hooks.js b/ilc/server/tailor/fragment-hooks.js index b7b1a8c2..59638a98 100644 --- a/ilc/server/tailor/fragment-hooks.js +++ b/ilc/server/tailor/fragment-hooks.js @@ -78,9 +78,9 @@ function insertStart(logger, stream, attributes, headers) { bundleVersionOverrides, }), }, - 'insert start. Creating spa-config-override tag', + 'insert start. Creating text/spa-config-override tag', ); - stream.write(``); + stream.write(``); } function insertEnd(stream, attributes, headers, index) { diff --git a/ilc/server/tailor/fragment-hooks.spec.js b/ilc/server/tailor/fragment-hooks.spec.js index cdbc00d8..302b5601 100644 --- a/ilc/server/tailor/fragment-hooks.spec.js +++ b/ilc/server/tailor/fragment-hooks.spec.js @@ -38,7 +38,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); @@ -56,7 +56,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( '' + - '', + '', ); }); @@ -74,7 +74,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( '' + - '', + '', ); }); @@ -109,7 +109,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( `` + - ``, + ``, ); }); @@ -126,7 +126,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); @@ -142,7 +142,7 @@ describe('fragment-hooks', () => { const streamData = mockStream.read(); chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); @@ -159,7 +159,7 @@ describe('fragment-hooks', () => { const streamData = mockStream.read(); chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - ``, + ``, ); }); @@ -184,7 +184,7 @@ describe('fragment-hooks', () => { const streamData = mockStream.read(); chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); @@ -201,7 +201,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); @@ -218,7 +218,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); @@ -235,7 +235,7 @@ describe('fragment-hooks', () => { chai.expect(streamData).to.be.instanceOf(Buffer); chai.expect(streamData.toString()).to.be.equal( - '', + '', ); }); }); diff --git a/ilc/tests/karma.index.html b/ilc/tests/karma.index.html index 25247594..480939c2 100644 --- a/ilc/tests/karma.index.html +++ b/ilc/tests/karma.index.html @@ -9,7 +9,7 @@ - +