diff --git a/package.json b/package.json index 3de6c234..18f72e8f 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-node-resolve": "13.3.0", "@rollup/plugin-typescript": "8.5.0", + "@swc/core": "1.3.10", "@testing-library/cypress": "8.0.3", "@types/fs-extra": "11.0.1", "@types/json-schema": "7.0.11", diff --git a/packages/core/test/components/variant-handlers/handlers/File.spec.js b/packages/core/test/components/variant-handlers/handlers/File.spec.js index 10990ec3..7708fad4 100644 --- a/packages/core/test/components/variant-handlers/handlers/File.spec.js +++ b/packages/core/test/components/variant-handlers/handlers/File.spec.js @@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed const sinon = require("sinon"); const CoreMocks = require("../../Core.mocks.js"); -const { VariantHandlerFile: File } = require("../../../../src/variant-handlers/handlers/File"); +const { VariantHandlerFile: VHFile } = require("../../../../src/variant-handlers/handlers/File"); describe("File variant handler", () => { const FOO_VARIANT = { @@ -40,7 +40,7 @@ describe("File variant handler", () => { }; coreMocks = new CoreMocks(); coreInstance = coreMocks.stubs.instance; - routesHandler = new File(FOO_VARIANT, coreInstance); + routesHandler = new VHFile(FOO_VARIANT, coreInstance); }); afterEach(() => { @@ -50,13 +50,13 @@ describe("File variant handler", () => { describe("id", () => { it("should have file value", () => { - expect(File.id).toEqual("file"); + expect(VHFile.id).toEqual("file"); }); }); describe("validationSchema", () => { it("should be defined", () => { - expect(File.validationSchema).toBeDefined(); + expect(VHFile.validationSchema).toBeDefined(); }); }); @@ -78,7 +78,7 @@ describe("File variant handler", () => { it("should add headers if they are defined", () => { const FOO_HEADERS = { foo: "foo" }; - routesHandler = new File({ ...FOO_VARIANT, headers: FOO_HEADERS }, coreInstance); + routesHandler = new VHFile({ ...FOO_VARIANT, headers: FOO_HEADERS }, coreInstance); routesHandler.middleware(expressStubs.req, expressStubs.res, expressStubs.next); expect(expressStubs.res.set.getCall(0).args[0]).toEqual(FOO_HEADERS); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b436bd92..9bc8b8a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,7 @@ importers: '@rollup/plugin-commonjs': 21.1.0 '@rollup/plugin-node-resolve': 13.3.0 '@rollup/plugin-typescript': 8.5.0 + '@swc/core': 1.3.10 '@testing-library/cypress': 8.0.3 '@types/fs-extra': 11.0.1 '@types/json-schema': 7.0.11 @@ -78,13 +79,14 @@ importers: '@babel/preset-typescript': 7.18.6_@babel+core@7.18.13 '@cypress/webpack-preprocessor': 5.12.2_cd11677068a882016a7950fd8495bf25 '@nrwl/cli': 13.8.3 - '@nrwl/eslint-plugin-nx': 13.8.3_6d9b42330df4b23aa21b718301d0cca0 + '@nrwl/eslint-plugin-nx': 13.8.3_5261347a9f49ba683c4dc14342475e64 '@nrwl/tao': 13.8.3 '@nrwl/workspace': 13.8.3_2a4aba1520b516d4ab0252879542949e '@rollup/plugin-babel': 5.3.1_803b71eb8edcf0cb2053421f359ef373 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 '@rollup/plugin-typescript': 8.5.0_120c47e83efe3ad03aff6b4ab814546f + '@swc/core': 1.3.10 '@testing-library/cypress': 8.0.3_cypress@9.7.0 '@types/fs-extra': 11.0.1 '@types/json-schema': 7.0.11 @@ -136,7 +138,7 @@ importers: tslib: 2.5.0 typescript: 4.7.4 wait-on: 6.0.1 - webpack: 5.74.0 + webpack: 5.74.0_@swc+core@1.3.10 mocks/admin-api-client-data-provider-e2e-mocks: specifiers: @@ -2086,7 +2088,7 @@ packages: bluebird: 3.7.1 debug: 4.3.4 lodash: 4.17.21 - webpack: 5.74.0 + webpack: 5.74.0_@swc+core@1.3.10 transitivePeerDependencies: - supports-color dev: true @@ -2813,7 +2815,7 @@ packages: tslib: 2.5.0 dev: true - /@nrwl/eslint-plugin-nx/13.8.3_6d9b42330df4b23aa21b718301d0cca0: + /@nrwl/eslint-plugin-nx/13.8.3_5261347a9f49ba683c4dc14342475e64: resolution: {integrity: sha512-fiDGULPfFYFkjIORBCFTkzpUQNlW48/32C3xWVbZlmmnO1KJ5ql3QyQSaDpaentE5nASM8TbgXeVMRqhYkZbOw==} peerDependencies: '@typescript-eslint/parser': ~5.10.0 @@ -2824,7 +2826,7 @@ packages: dependencies: '@nrwl/devkit': 13.8.3 '@nrwl/workspace': 13.8.3_2a4aba1520b516d4ab0252879542949e - '@swc-node/register': 1.6.7_typescript@4.7.4 + '@swc-node/register': 1.6.7_dc1393c749509ca542eb7f5bf55c5f8d '@typescript-eslint/experimental-utils': 5.10.2_eslint@8.24.0+typescript@4.7.4 '@typescript-eslint/parser': 5.48.0_eslint@8.24.0+typescript@4.7.4 chalk: 4.1.0 @@ -3330,21 +3332,24 @@ packages: - supports-color dev: true - /@swc-node/core/1.10.5: + /@swc-node/core/1.10.5_@swc+core@1.3.10: resolution: {integrity: sha512-G+Me0sTApMy6WY9mT0TluFxdO633P1GWMllbT3LWeJlknqQxJo8dAQcV0Uc0+rvBVXt7rRo/BMUZNJp88qarzg==} engines: {node: '>= 10'} peerDependencies: '@swc/core': '>= 1.3' + dependencies: + '@swc/core': 1.3.10 dev: true - /@swc-node/register/1.6.7_typescript@4.7.4: + /@swc-node/register/1.6.7_dc1393c749509ca542eb7f5bf55c5f8d: resolution: {integrity: sha512-+Tccbb4+fN8vYx88fdEGFbsCSnF0zBxbVhZkYkFAbVI7h6zVIgA3Jmlok4ZM+q+1KxzPN7AOfhQVuFOYBzZBeA==} peerDependencies: '@swc/core': '>= 1.3' typescript: '>= 4.3' dependencies: - '@swc-node/core': 1.10.5 + '@swc-node/core': 1.10.5_@swc+core@1.3.10 '@swc-node/sourcemap-support': 0.3.0 + '@swc/core': 1.3.10 colorette: 2.0.20 debug: 4.3.4 pirates: 4.0.6 @@ -3361,6 +3366,77 @@ packages: tslib: 2.5.0 dev: true + /@swc/core-android-arm-eabi/1.3.10: + resolution: {integrity: sha512-yeW0dvv7SSmb0Y1Hhr9+QceoDjn2uulcaY+LUZ9Zt2UBHl/95c7QVgjDaE2B/lSlTV5En/81/q58lXoT/IqjGw==} + engines: {node: '>=10'} + cpu: [arm] + os: [android] + requiresBuild: true + dependencies: + '@swc/wasm': 1.2.122 + dev: true + optional: true + + /@swc/core-android-arm64/1.3.10: + resolution: {integrity: sha512-HXkUXP4Lm3Xc9qfd9J/6/YfxknWk0Esqmu6nFRikXDc691aXHDcDZ2D8SqPlhx2CZT1juuRajphOaUXMTaAP3g==} + engines: {node: '>=10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 + dev: true + optional: true + + /@swc/core-darwin-arm64/1.3.10: + resolution: {integrity: sha512-X1eM5LDk24W/pbGamwpMRGkQW1BC+1xYNzS38hiK5YCS20TDZwI5LIg2pTEecKl/SRt1WFMwAThUwKbp4m1HIA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@swc/core-darwin-x64/1.3.10: + resolution: {integrity: sha512-wrsv6upfEzwCGHB7y7IsdrppyywNV7C5TZDXVYv3GCUQZAFlRBar+1yHMojuPxPvyjjfHtTEr68MOhUwq9ti3w==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@swc/core-freebsd-x64/1.3.10: + resolution: {integrity: sha512-tJ+ncGIZcueU3RVuQtawLvU0zGza4YKH7aD9unaypFE6e0qx34EX7fzObAhTUi881muEFIU/mDKmVpFqdEi7QQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 + dev: true + optional: true + + /@swc/core-linux-arm-gnueabihf/1.3.10: + resolution: {integrity: sha512-4IsAIBk1zdzTINZR5+kPE170yyIQMY76R/yKxtHuzMYxhOaErxsObokttyZ9k9ImlZRujTzEn3A5SsZ/EvibUA==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 + dev: true + optional: true + + /@swc/core-linux-arm64-gnu/1.3.10: + resolution: {integrity: sha512-OaOd+wFbcTQwOD9Ce5luUp8qYoEvdX3s00Bby+j7hybu1fVZK4W40cqzVRp/EDElriG0I+tAdFvQW7PCcEzsPQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-arm64-gnu/1.3.78: resolution: {integrity: sha512-Sis17dz9joJRFVvR/gteOZSUNrrrioo81RQzani0Zr5ZZOfWLMTB9DA+0MVlfnVa2taYcsJHJZFoAv9JkLwbzg==} engines: {node: '>=10'} @@ -3370,6 +3446,15 @@ packages: dev: true optional: true + /@swc/core-linux-arm64-musl/1.3.10: + resolution: {integrity: sha512-AUzQ/5T2hoNIgZlnbflDufWDEfJbw+w8FwKoCp7kKyLLAXG8RHgTsx0TazzQ8PVcAQk8lWI2EBrObLL82n91kQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-arm64-musl/1.3.78: resolution: {integrity: sha512-E5F8/qp+QupnfBnsP4vN1PKyCmAHYHDG1GMyPE/zLFOUYLgw+jK4C9rfyLBR0o2bWo1ay2WCIjusBZD9XHGOSA==} engines: {node: '>=10'} @@ -3379,6 +3464,15 @@ packages: dev: true optional: true + /@swc/core-linux-x64-gnu/1.3.10: + resolution: {integrity: sha512-rjAyQVRkHCWvCA0wyk0nhJdVMfown6wLvDztKZ0wyT6NDDFdvekTMgALQXL5MW4Q0MYBvGMSauoysTZCdZW9aA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-x64-gnu/1.3.78: resolution: {integrity: sha512-iDxa+RknnTQlyy+WfPor1FM6y44ERNI2E0xiUV6gV6uPwegCngi8LFC+E7IvP6+p+yXtAkesunAaiZ8nn0s+rw==} engines: {node: '>=10'} @@ -3388,6 +3482,15 @@ packages: dev: true optional: true + /@swc/core-linux-x64-musl/1.3.10: + resolution: {integrity: sha512-X5KFbPTxcXaycGOrKoiPNCBUOjhCf8GpeNFpM7QASEWulWWM7nkMPrNeXKmQgJBlRT2j3iLine4Pkyc2bLPlVg==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@swc/core-linux-x64-musl/1.3.78: resolution: {integrity: sha512-dWtIYUFL5sMTE2UKshkXTusHcK8+zAhhGzvqWq1wJS45pqTlrAbzpyqB780fle880x3A6DMitWmsAFARdNzpuQ==} engines: {node: '>=10'} @@ -3397,6 +3500,70 @@ packages: dev: true optional: true + /@swc/core-win32-arm64-msvc/1.3.10: + resolution: {integrity: sha512-KcQIERfwGyTAcJOnqGsFbRtU6wSm91xwYFVYjeYy2aNU/SKQ5rtwPTW1UAaUDdwDcS1Y49fNWWj+GPtdaZ+WXQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 + dev: true + optional: true + + /@swc/core-win32-ia32-msvc/1.3.10: + resolution: {integrity: sha512-bNpFGZX8tNkwWbQyFRSO+wJ9BgE38ItEodTUXmBsC1xhsHPYLYMlP+6lDKvkO7+jzRMLbyWWUyoWXCEfkvdYWw==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 + dev: true + optional: true + + /@swc/core-win32-x64-msvc/1.3.10: + resolution: {integrity: sha512-40yeeov6XcJHm99anMeEn/NwhDcoM2fhBQHWRVZfCa43QC45AUjJ3kWrD76U6MPGnGy7MsCOXdFyu1mJOAHKEw==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@swc/core/1.3.10: + resolution: {integrity: sha512-A5YjYFa45ThHOwftKqIQKNbukxJGTsdBQAqoTr+QD1/L6jbRg3xxhU5UDyVdUIULz40PH6YQiulyUVbyrjl1Iw==} + engines: {node: '>=10'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@swc/core-android-arm-eabi': 1.3.10 + '@swc/core-android-arm64': 1.3.10 + '@swc/core-darwin-arm64': 1.3.10 + '@swc/core-darwin-x64': 1.3.10 + '@swc/core-freebsd-x64': 1.3.10 + '@swc/core-linux-arm-gnueabihf': 1.3.10 + '@swc/core-linux-arm64-gnu': 1.3.10 + '@swc/core-linux-arm64-musl': 1.3.10 + '@swc/core-linux-x64-gnu': 1.3.10 + '@swc/core-linux-x64-musl': 1.3.10 + '@swc/core-win32-arm64-msvc': 1.3.10 + '@swc/core-win32-ia32-msvc': 1.3.10 + '@swc/core-win32-x64-msvc': 1.3.10 + dev: true + + /@swc/wasm/1.2.122: + resolution: {integrity: sha512-sM1VCWQxmNhFtdxME+8UXNyPNhxNu7zdb6ikWpz0YKAQQFRGT5ThZgJrubEpah335SUToNg8pkdDF7ibVCjxbQ==} + requiresBuild: true + dev: true + optional: true + + /@swc/wasm/1.2.130: + resolution: {integrity: sha512-rNcJsBxS70+pv8YUWwf5fRlWX6JoY/HJc25HD/F8m6Kv7XhJdqPPMhyX6TKkUBPAG7TWlZYoxa+rHAjPy4Cj3Q==} + requiresBuild: true + dev: true + optional: true + /@szmarczak/http-timer/1.1.2: resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} engines: {node: '>=6'} @@ -5197,7 +5364,7 @@ packages: loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.74.0 + webpack: 5.74.0_@swc+core@1.3.10 dev: true /babel-plugin-istanbul/6.1.1: @@ -16576,7 +16743,7 @@ packages: - bluebird dev: true - /terser-webpack-plugin/5.3.9_webpack@5.74.0: + /terser-webpack-plugin/5.3.9_@swc+core@1.3.10+webpack@5.74.0: resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -16593,11 +16760,12 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.19 + '@swc/core': 1.3.10 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.1 terser: 5.19.2 - webpack: 5.74.0 + webpack: 5.74.0_@swc+core@1.3.10 dev: true /terser/4.8.1: @@ -16801,7 +16969,7 @@ packages: micromatch: 4.0.5 semver: 7.5.4 typescript: 4.7.4 - webpack: 5.74.0 + webpack: 5.74.0_@swc+core@1.3.10 dev: true /ts-pnp/1.2.0_typescript@4.7.4: @@ -17549,7 +17717,7 @@ packages: - supports-color dev: true - /webpack/5.74.0: + /webpack/5.74.0_@swc+core@1.3.10: resolution: {integrity: sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==} engines: {node: '>=10.13.0'} hasBin: true @@ -17580,7 +17748,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.9_webpack@5.74.0 + terser-webpack-plugin: 5.3.9_@swc+core@1.3.10+webpack@5.74.0 watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: