From 6650695b0a22ddae33afffb562bb88c48dd8be26 Mon Sep 17 00:00:00 2001 From: Romain Lenzotti Date: Thu, 26 Oct 2023 10:52:43 +0200 Subject: [PATCH] fix(engines): remove old engines (vue, arc, marko) --- docs/docs/templating.md | 1 - packages/core/jest.config.js | 2 +- packages/engines/.nycrc | 2 +- packages/engines/package.json | 14 +- packages/engines/readme.md | 1 - .../engines/src/components/MarkoEngine.ts | 28 - .../engines/src/components/VueEngine.spec.ts | 40 - packages/engines/src/components/VueEngine.ts | 156 - packages/engines/src/index.ts | 2 - packages/engines/src/utils/getEngines.spec.ts | 2 - .../engines/test/fixtures/marko/user.marko | 1 - packages/engines/test/integration.spec.ts | 1 - yarn.lock | 5349 +++-------------- 13 files changed, 964 insertions(+), 4635 deletions(-) delete mode 100644 packages/engines/src/components/MarkoEngine.ts delete mode 100644 packages/engines/src/components/VueEngine.spec.ts delete mode 100644 packages/engines/src/components/VueEngine.ts delete mode 100644 packages/engines/test/fixtures/marko/user.marko diff --git a/docs/docs/templating.md b/docs/docs/templating.md index 53d80ce8d5c..cb678bb4137 100644 --- a/docs/docs/templating.md +++ b/docs/docs/templating.md @@ -115,7 +115,6 @@ If `dustjs-helpers` is installed, `dustjs-linkedin` will not be used by consolid | [velocityjs](https://github.com/julianshapiro/velocity) | [BETA](https://www.npmjs.com/package/velocity-animate) | [(website)](http://velocityjs.org/) | | [walrus](https://github.com/jeremyruppel/walrus) | [`npm install walrus`](https://www.npmjs.com/package/walrus) | [(website)](http://documentup.com/jeremyruppel/walrus/) | | [whiskers](https://github.com/gsf/whiskers.js) | [`npm install whiskers`](https://www.npmjs.com/package/whiskers) | - | -| [vue](https://github.com/vuejs/vue) | `npm install vue vue-pronto` | [(website)](https://vuejs.org/) | ::: tip Note You must still install the engines you wish to use, add them to your package.json dependencies. diff --git a/packages/core/jest.config.js b/packages/core/jest.config.js index 31296db1365..5a9487759c2 100644 --- a/packages/core/jest.config.js +++ b/packages/core/jest.config.js @@ -6,7 +6,7 @@ module.exports = { coverageThreshold: { global: { statements: 98.99, - branches: 94.93, + branches: 94.98, functions: 95.81, lines: 98.99 } diff --git a/packages/engines/.nycrc b/packages/engines/.nycrc index ea0f737ad7d..05605266113 100644 --- a/packages/engines/.nycrc +++ b/packages/engines/.nycrc @@ -20,7 +20,7 @@ ], "check-coverage": true, "statements": 96.38, - "branches": 75.14, + "branches": 72.9, "functions": 96.26, "lines": 96.32 } diff --git a/packages/engines/package.json b/packages/engines/package.json index 671f0824b76..78d3f49472c 100644 --- a/packages/engines/package.json +++ b/packages/engines/package.json @@ -31,12 +31,11 @@ "@tsed/typescript": "7.39.1", "@types/fs-extra": "^11.0.3", "@types/semver": "^7.3.9", - "arc-templates": "^0.5.3", - "atpl": "^0.9.3", - "babel-core": "^6.26.3", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-preset-es2015": "^6.24.1", - "babel-preset-react": "^6.24.1", + "@babel/core": "7.23.2", + "@babel/plugin-transform-runtime": "7.23.2", + "@babel/preset-env": "7.23.2", + "@babel/preset-react": "7.22.15", + "atpl": "0.9.3", "bracket-template": "^1.1.5", "coffee-script": "^1.12.7", "dot": "^1.1.3", @@ -60,7 +59,6 @@ "liquid-node": "^3.0.1", "liquor": "^0.0.5", "lodash": "^4.17.21", - "marko": "^5.20.3", "mote": "^0.2.0", "mustache": "^4.2.0", "nunjucks": "^3.2.3", @@ -73,7 +71,6 @@ "semver": "^7.3.2", "slm": "^2.0.0", "squirrelly": "^5.1.0", - "swig": "^1.4.2", "swig-templates": "^2.0.3", "teacup": "^2.0.0", "templayed": ">=0.2.3", @@ -84,7 +81,6 @@ "underscore": "^1.11.0", "vash": "^0.13.0", "velocityjs": "^2.0.1", - "vue-pronto": "^2.4.0", "walrus": "^0.10.1", "whiskers": "^0.4.0" }, diff --git a/packages/engines/readme.md b/packages/engines/readme.md index f1677f9dcf3..1015228d16f 100644 --- a/packages/engines/readme.md +++ b/packages/engines/readme.md @@ -86,7 +86,6 @@ If `dustjs-helpers` is installed, `dustjs-linkedin` will not be used by consolid | [velocityjs](https://github.com/julianshapiro/velocity) | [BETA](https://www.npmjs.com/package/velocity-animate) | [(website)](http://velocityjs.org/) | | [walrus](https://github.com/jeremyruppel/walrus) | [`npm install walrus`](https://www.npmjs.com/package/walrus) | [(website)](http://documentup.com/jeremyruppel/walrus/) | | [whiskers](https://github.com/gsf/whiskers.js) | [`npm install whiskers`](https://www.npmjs.com/package/whiskers) | - | -| [vue](https://github.com/vuejs/vue) | `npm install vue vue-pronto` | [(website)](https://vuejs.org/) | > **NOTE**: you must still install the engines you wish to use, add them to your package.json dependencies. diff --git a/packages/engines/src/components/MarkoEngine.ts b/packages/engines/src/components/MarkoEngine.ts deleted file mode 100644 index cf6379b7015..00000000000 --- a/packages/engines/src/components/MarkoEngine.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {promisify} from "util"; -import {ViewEngine} from "../decorators/viewEngine"; -import {Engine, EngineOptions} from "./Engine"; - -@ViewEngine("marko") -export class MarkoEngine extends Engine { - $cacheOptions(template: string, options: any, fromFile: boolean): any { - options.writeToDisk = !!options.cache; - - if (!fromFile) { - options.filename = options.filename || "string.marko"; - } - - return options; - } - - $compileFile(file: string, options: EngineOptions) { - const $cmp = this.engine.load(file, options); - - return promisify($cmp.renderToString.bind($cmp)) as any; - } - - protected $compile(template: string, options: EngineOptions) { - const $cmp = this.engine.load(options.filename, template, options); - - return promisify($cmp.renderToString.bind($cmp)) as any; - } -} diff --git a/packages/engines/src/components/VueEngine.spec.ts b/packages/engines/src/components/VueEngine.spec.ts deleted file mode 100644 index 017a5fb93b4..00000000000 --- a/packages/engines/src/components/VueEngine.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {expect} from "chai"; -import {getEngineFixture} from "../../test/getEngineFixture"; -import {VueEngine} from "./VueEngine"; - -describe("VueEngine", () => { - beforeEach(() => { - process.env.VUE_DEV = String(true); - }); - it("should render the given content (by string - no cache)", async () => { - const {render, $compile} = await getEngineFixture({token: VueEngine}); - await render(); - - expect(await render()).to.eq('

Tobi

'); - expect($compile()).to.have.been.callCount(2); - }); - it("should render the given content (by string - with cache)", async () => { - const {render, $compile} = await getEngineFixture({token: VueEngine, cache: true}); - await render(); - - expect(await render()).to.eq('

Tobi

'); - expect($compile()).to.have.been.callCount(1); - }); - it("should render the given content (by file - no cache)", async () => { - const {renderFile, $compileFile} = await getEngineFixture({token: VueEngine}); - await renderFile(); - const content = await renderFile(); - - expect(content).to.contains('

Tobi