From cb6c465b0dcc5090bab7070dc88f695281d74704 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:28:31 +0300 Subject: [PATCH 01/11] Update .prettierignore --- .prettierignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index c2af4d8b2e5..beae0a404b5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,4 +13,5 @@ before_commit /scripts/cli_cache.json /dist/ /lib/ -/test/ +test/* +!/test/ts From b89534092a72a747ef2f60d4ff5979d56b231128 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:28:34 +0300 Subject: [PATCH 02/11] Create index.ts --- test/ts/index.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/ts/index.ts diff --git a/test/ts/index.ts b/test/ts/index.ts new file mode 100644 index 00000000000..52806293382 --- /dev/null +++ b/test/ts/index.ts @@ -0,0 +1,3 @@ +import { fabric } from '../..'; + +fabric.util.animate; From 3c0ba1e39385053b0cb08322a664c87e7a25fb9e Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:30:07 +0300 Subject: [PATCH 03/11] add ts test suite --- package-lock.json | 30 +++++++++++++++++ package.json | 2 ++ rollup.config.js | 11 +++++-- scripts/build.mjs | 28 +++++++++++----- scripts/index.mjs | 83 +++++++++++++++++++++++++---------------------- 5 files changed, 104 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23b56b7c87a..450ba7c0e75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "busboy": "^1.6.0", "chalk": "^2.4.1", "commander": "^9.1.0", + "conditional-type-checks": "^1.0.6", "deep-object-diff": "^1.1.7", "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", @@ -37,6 +38,7 @@ "ps-list": "^8.1.0", "qunit": "^2.17.2", "rollup": "^2.75.6", + "rollup-plugin-no-emit": "^0.0.1", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^3.0.2", "source-map-support": "^0.5.21", @@ -1979,6 +1981,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "devOptional": true }, + "node_modules/conditional-type-checks": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/conditional-type-checks/-/conditional-type-checks-1.0.6.tgz", + "integrity": "sha512-3vyi+yNcmKq+xl1sTX7Ta+4pUvjusMYbC6FSbrS6YJV8TI51wiRn24u4bfdFVhDKKH5GtpKQzxW7bqXbPWllgQ==", + "dev": true + }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -6197,6 +6205,15 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-no-emit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-no-emit/-/rollup-plugin-no-emit-0.0.1.tgz", + "integrity": "sha512-nNMGtFN1GY7vRzI0lYlZfH53jVs1hY/XY7Z0ZbTJIborw3QqIjJuxbD/NMhDY+Uh2uXsT1ccGjRThspPUqL1OQ==", + "dev": true, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, "node_modules/rollup-plugin-terser": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", @@ -8964,6 +8981,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "devOptional": true }, + "conditional-type-checks": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/conditional-type-checks/-/conditional-type-checks-1.0.6.tgz", + "integrity": "sha512-3vyi+yNcmKq+xl1sTX7Ta+4pUvjusMYbC6FSbrS6YJV8TI51wiRn24u4bfdFVhDKKH5GtpKQzxW7bqXbPWllgQ==", + "dev": true + }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -12147,6 +12170,13 @@ "fsevents": "~2.3.2" } }, + "rollup-plugin-no-emit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-no-emit/-/rollup-plugin-no-emit-0.0.1.tgz", + "integrity": "sha512-nNMGtFN1GY7vRzI0lYlZfH53jVs1hY/XY7Z0ZbTJIborw3QqIjJuxbD/NMhDY+Uh2uXsT1ccGjRThspPUqL1OQ==", + "dev": true, + "requires": {} + }, "rollup-plugin-terser": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", diff --git a/package.json b/package.json index 436594ac8a1..497b1d5cd05 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "busboy": "^1.6.0", "chalk": "^2.4.1", "commander": "^9.1.0", + "conditional-type-checks": "^1.0.6", "deep-object-diff": "^1.1.7", "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", @@ -104,6 +105,7 @@ "ps-list": "^8.1.0", "qunit": "^2.17.2", "rollup": "^2.75.6", + "rollup-plugin-no-emit": "^0.0.1", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^3.0.2", "source-map-support": "^0.5.21", diff --git a/rollup.config.js b/rollup.config.js index cf3ee76df32..8445c0694d0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,18 +1,22 @@ import { terser } from 'rollup-plugin-terser'; import ts from 'rollup-plugin-ts'; import json from '@rollup/plugin-json'; +import noEmit from 'rollup-plugin-no-emit'; + +const input = process.env.BUILD_INPUT?.split(',') || ['./index.js']; +const outputType = input.length > 1 ? 'dir' : 'file'; // https://rollupjs.org/guide/en/#configuration-files export default { - input: process.env.BUILD_INPUT?.split(',') || ['./index.js'], + input, output: [ { - file: process.env.BUILD_OUTPUT || './dist/fabric.js', + [outputType]: process.env.BUILD_OUTPUT || './dist/fabric.js', name: 'fabric', format: 'cjs', sourcemap: true, }, - Number(process.env.MINIFY) + Number(process.env.MINIFY) && outputType === 'file' ? { file: process.env.BUILD_MIN_OUTPUT || './dist/fabric.min.js', name: 'fabric', @@ -26,5 +30,6 @@ export default { ts({ /* Plugin options */ }), + noEmit({ emit: !Number(process.env.NO_EMIT) }), ], }; diff --git a/scripts/build.mjs b/scripts/build.mjs index 0cff4de6f2b..9e85dcfbcda 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -10,18 +10,27 @@ import { wd } from './dirname.mjs'; * @see https://rollupjs.org/guide/en/#--watchonstart-cmd---watchonbundlestart-cmd---watchonbundleend-cmd---watchonend-cmd---watchonerror-cmd * @param {*} options */ -export function build({ watch, fast, input, output } = {}) { +export function build({ + watch, + fast, + input, + output, + report = true, + emit = true, +} = {}) { const cmd = [ 'rollup', '-c', watch ? '--watch' : '', '--no-watch.clearScreen', - ...['onStart', 'onError', 'onEnd'].map( - (type) => - `--watch.${type} "node ./scripts/buildReporter.mjs ${type - .toLowerCase() - .slice(2)}"` - ), + ...(report + ? [('onStart', 'onError', 'onEnd')].map( + (type) => + `--watch.${type} "node ./scripts/buildReporter.mjs ${type + .toLowerCase() + .slice(2)}"` + ) + : []), ].join(' '); const processOptions = { stdio: 'inherit', @@ -30,15 +39,16 @@ export function build({ watch, fast, input, output } = {}) { env: { ...process.env, MINIFY: Number(!fast), - BUILD_INPUT: input, + BUILD_INPUT: Array.isArray(input) ? input.join(',') : input, BUILD_OUTPUT: output, BUILD_MIN_OUTPUT: - output && !fast + output && !Array.isArray(input) && !fast ? path.resolve( path.dirname(output), `${path.basename(output, '.js')}.min.js` ) : undefined, + NO_EMIT: Number(!emit), }, }; if (watch) { diff --git a/scripts/index.mjs b/scripts/index.mjs index 72dd1b19231..111fbd83434 100644 --- a/scripts/index.mjs +++ b/scripts/index.mjs @@ -26,13 +26,15 @@ import process from 'node:process'; import os from 'os'; import { build } from './build.mjs'; import { awaitBuild } from './buildLock.mjs'; -import { CLI_CACHE, wd } from './dirname.mjs'; +import { CLI_CACHE, dumpsPath, wd } from './dirname.mjs'; import { listFiles, transform as transformFiles } from './transform_files.mjs'; const program = new commander.Command(); const websiteDir = path.resolve(wd, '../fabricjs.com'); +const TEST_SUITES = ['unit', 'visual', 'ts']; + function execGitCommand(cmd) { return cp .execSync(cmd, { cwd: wd }) @@ -294,7 +296,7 @@ async function runTestem({ /** * - * @param {'unit' | 'visual'} suite + * @param {'unit' | 'visual' | 'ts'} suite * @param {string[] | null} tests file paths * @param {{debug?:boolean,recreate?:boolean,verbose?:boolean,filter?:string}} [options] * @returns {Promise} true if some tests failed @@ -302,6 +304,19 @@ async function runTestem({ async function test(suite, tests, options = {}) { let failed = false; await awaitBuild(); + + if (suite === 'ts') { + console.log(chalk.bold(chalk.blue(`running TS test suite`))); + build({ + fast: true, + input: tests || listTestFiles('ts').map((file) => `test/ts/${file}`), + output: path.resolve(dumpsPath, 'ts_tests'), + report: false, + emit: false, + }); + return false; + } + const qunitEnv = { QUNIT_DEBUG_VISUAL_TESTS: Number(options.debug), QUNIT_RECREATE_VISUAL_REFS: Number(options.recreate), @@ -326,7 +341,7 @@ async function test(suite, tests, options = {}) { cwd: wd, env: { ...env, - // browser takes precendence in golden ref generation + // browser takes precedence in golden ref generation ...(browserContexts.length === 0 ? qunitEnv : {}), }, shell: true, @@ -360,7 +375,7 @@ async function test(suite, tests, options = {}) { /** * - * @param {'unit'|'visual'} type correspondes to the test directories + * @param {'unit'|'visual'|'ts'} type corresponds to the test directories * @returns */ function listTestFiles(type) { @@ -427,11 +442,8 @@ async function selectFileToTransform() { async function selectTestFile() { const selected = readCLIFile(); - const unitTests = listTestFiles('unit').map((file) => - createChoiceData('unit', file) - ); - const visualTests = listTestFiles('visual').map((file) => - createChoiceData('visual', file) + const testChoices = TEST_SUITES.map((suite) => + listTestFiles(suite).map((file) => createChoiceData(suite, file)) ); const { tests: filteredTests } = await inquirer.prompt([ { @@ -444,32 +456,24 @@ async function selectTestFile() { pageSize: Math.max(10, selected.length), source(answersSoFar, input = '') { return new Promise((resolve) => { - const tests = _.concat(unitTests, visualTests); + const tests = _.concat(...Object.values(testChoices)); const value = _.map(this.getCurrentValue(), (value) => createChoiceData(value.type, value.file) ); - if (value.length > 0) { - if ( - value.find( - (v) => v.value && v.value.type === 'unit' && !v.value.file - ) - ) { - _.pullAll(tests, unitTests); - } - if ( - value.find( - (v) => v.value && v.value.type === 'visual' && !v.value.file - ) - ) { - _.pullAll(tests, visualTests); - } - } - const unitChoice = createChoiceData('unit', ''); - const visualChoice = createChoiceData('visual', ''); - !value.find((v) => _.isEqual(v, unitChoice)) && - value.push(unitChoice); - !value.find((v) => _.isEqual(v, visualChoice)) && - value.push(visualChoice); + value.length > 0 && + TEST_SUITES.forEach((suite) => { + if ( + value.find( + (v) => v.value && v.value.type === suite && !v.value.file + ) + ) { + _.pullAll(tests, testChoices[suite]); + } + }); + TEST_SUITES.forEach((suite) => { + const choice = createChoiceData(suite, ''); + !value.find((v) => _.isEqual(v, choice)) && value.push(choice); + }); if (value.length > 0) { value.unshift(new inquirer.Separator()); value.push(new inquirer.Separator()); @@ -488,7 +492,7 @@ async function selectTestFile() { return filteredTests; } -async function runIntreactiveTestSuite(options) { +async function runInteractiveTestSuite(options) { // some tests fail because of some pollution when run from the same context // test(_.map(await selectTestFile(), curr => `test/${curr.type}/${curr.file}`)) const tests = _.reduce( @@ -501,7 +505,10 @@ async function runIntreactiveTestSuite(options) { } return acc; }, - { unit: [], visual: [] } + _.zipObject( + TEST_SUITES, + TEST_SUITES.map(() => []) + ) ); return Promise.all( _.map(tests, (files, suite) => { @@ -556,7 +563,7 @@ program .description('run test suite') .addOption( new commander.Option('-s, --suite ', 'test suite to run').choices( - ['unit', 'visual'] + TEST_SUITES ) ) .option('-f, --file ', 'run a specific test file') @@ -585,7 +592,7 @@ program fs.removeSync(CLI_CACHE); } if (options.all) { - options.suite = ['unit', 'visual']; + options.suite = TEST_SUITES; } const results = []; if (options.suite) { @@ -599,13 +606,13 @@ program } else if (options.file) { results.push( await test( - options.file.startsWith('visual') ? 'visual' : 'unit', + options.file.split(/\\|\//)[0], [`test/${options.file}`], options ) ); } else { - results.push(...(await runIntreactiveTestSuite(options))); + results.push(...(await runInteractiveTestSuite(options))); } if (_.some(results)) { // inform ci that tests have failed From d278ff0ae65c160d52d27a62dbcbf150e35d518d Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:33:06 +0300 Subject: [PATCH 04/11] Update index.ts --- test/ts/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/ts/index.ts b/test/ts/index.ts index 52806293382..6077b06f3f5 100644 --- a/test/ts/index.ts +++ b/test/ts/index.ts @@ -1,3 +1,5 @@ import { fabric } from '../..'; +import { IsAny, assert } from 'conditional-type-checks'; -fabric.util.animate; +assert>(false); +assert>(false); From 9dc9a585a3db7c38a8a2d233dab6409db6b3e213 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:37:01 +0300 Subject: [PATCH 05/11] add workflow test --- .github/workflows/tests.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1dbbdc70783..ad720fc1ae6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,3 +51,22 @@ jobs: run: npm run build -- -f - name: Run ${{ matrix.suite }} tests run: npm run test -- -c node -s ${{ matrix.suite }} + ts: + runs-on: ubuntu-latest + name: TS tests + strategy: + fail-fast: false + matrix: + node-version: [18.x] + ts: [4.0, 4.9] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - name: Build + run: npm run build -- -f + - name: Run tests + run: npm run test -- -s ts From e41d52b04b8db856aba6c1e527787a014b8a507b Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:41:09 +0300 Subject: [PATCH 06/11] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad720fc1ae6..aafc9c3e95b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,7 @@ jobs: run: npm run test -- -c node -s ${{ matrix.suite }} ts: runs-on: ubuntu-latest - name: TS tests + name: TS v${{ matrix.ts }} tests strategy: fail-fast: false matrix: From fdcd54af7e068a20cdafb9dab00ce590a8351394 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:44:21 +0300 Subject: [PATCH 07/11] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aafc9c3e95b..7c5e43bebc2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,7 @@ jobs: run: npm run test -- -c node -s ${{ matrix.suite }} ts: runs-on: ubuntu-latest - name: TS v${{ matrix.ts }} tests + name: TS ${{ matrix.ts }} tests strategy: fail-fast: false matrix: From c2bdf0c7fd2c3e8374f8f83e37cce0382b4b71f3 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Mon, 24 Oct 2022 16:45:06 +0300 Subject: [PATCH 08/11] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ecb5043f4..f60474e54c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- ci(): add TS test suite [#8394](https://github.com/fabricjs/fabric.js/pull/8394) - chore(TS): convert object to es6 class [#8322](https://github.com/fabricjs/fabric.js/pull/8322) - docs(): guides follow up, feature request template [#8379](https://github.com/fabricjs/fabric.js/pull/8379) - docs(): refactor guides, bug report template [#8189](https://github.com/fabricjs/fabric.js/pull/8189) From 64b17e8eaf1da9cb8bb3701bd61f728b0c5320cc Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Wed, 26 Oct 2022 07:47:49 +0300 Subject: [PATCH 09/11] Update tests.yml --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c5e43bebc2..99eebd9017f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,14 +58,16 @@ jobs: fail-fast: false matrix: node-version: [18.x] - ts: [4.0, 4.9] + ts: [4.x, latest] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm ci + - run: | + npm ci + npm i typescript@${{ matrix.ts }} - name: Build run: npm run build -- -f - name: Run tests From 57ee0e6c690eaa42f6e8a33686ceb1b02106e70d Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Sun, 27 Nov 2022 08:24:14 +0200 Subject: [PATCH 10/11] Update package-lock.json --- package-lock.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/package-lock.json b/package-lock.json index ee41470c2eb..4b1210af57d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "busboy": "^1.6.0", "chalk": "^2.4.1", "commander": "^9.1.0", + "conditional-type-checks": "^1.0.6", "deep-object-diff": "^1.1.7", "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", @@ -37,6 +38,7 @@ "ps-list": "^8.1.0", "qunit": "^2.17.2", "rollup": "^2.75.6", + "rollup-plugin-no-emit": "^0.0.1", "rollup-plugin-size-snapshot": "^0.12.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^3.0.2", @@ -2864,6 +2866,12 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/conditional-type-checks": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/conditional-type-checks/-/conditional-type-checks-1.0.6.tgz", + "integrity": "sha512-3vyi+yNcmKq+xl1sTX7Ta+4pUvjusMYbC6FSbrS6YJV8TI51wiRn24u4bfdFVhDKKH5GtpKQzxW7bqXbPWllgQ==", + "dev": true + }, "node_modules/console-browserify": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", @@ -8905,6 +8913,15 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-no-emit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-no-emit/-/rollup-plugin-no-emit-0.0.1.tgz", + "integrity": "sha512-nNMGtFN1GY7vRzI0lYlZfH53jVs1hY/XY7Z0ZbTJIborw3QqIjJuxbD/NMhDY+Uh2uXsT1ccGjRThspPUqL1OQ==", + "dev": true, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, "node_modules/rollup-plugin-size-snapshot": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/rollup-plugin-size-snapshot/-/rollup-plugin-size-snapshot-0.12.0.tgz", @@ -14248,6 +14265,12 @@ } } }, + "conditional-type-checks": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/conditional-type-checks/-/conditional-type-checks-1.0.6.tgz", + "integrity": "sha512-3vyi+yNcmKq+xl1sTX7Ta+4pUvjusMYbC6FSbrS6YJV8TI51wiRn24u4bfdFVhDKKH5GtpKQzxW7bqXbPWllgQ==", + "dev": true + }, "console-browserify": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", @@ -19030,6 +19053,13 @@ "fsevents": "~2.3.2" } }, + "rollup-plugin-no-emit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-no-emit/-/rollup-plugin-no-emit-0.0.1.tgz", + "integrity": "sha512-nNMGtFN1GY7vRzI0lYlZfH53jVs1hY/XY7Z0ZbTJIborw3QqIjJuxbD/NMhDY+Uh2uXsT1ccGjRThspPUqL1OQ==", + "dev": true, + "requires": {} + }, "rollup-plugin-size-snapshot": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/rollup-plugin-size-snapshot/-/rollup-plugin-size-snapshot-0.12.0.tgz", From 6fc2483e51e0699620dd24d1f35b56eae0b994c6 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Sun, 27 Nov 2022 14:34:27 +0200 Subject: [PATCH 11/11] Update text.class.ts --- src/shapes/text.class.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shapes/text.class.ts b/src/shapes/text.class.ts index 215acc9ae1d..64f7f510ded 100644 --- a/src/shapes/text.class.ts +++ b/src/shapes/text.class.ts @@ -363,7 +363,7 @@ export class Text< initialized?: true; - constructor(text: string, options: object): Text { + constructor(text: string, options: object) { super({ ...options, text, styles: options?.styles || {} }); this.initialized = true; if (this.path) {