From 8ba498c13eb6ecd274ffc249e0a242c7a41351a3 Mon Sep 17 00:00:00 2001 From: Robbie Wagner Date: Mon, 15 Jul 2024 14:41:14 -0400 Subject: [PATCH 1/4] Remove config and use dynamic imports for modules --- .eslintrc.js | 5 +- README.md | 45 +-- .../{high-charts.js => high-charts.ts} | 84 ++++- .../{build-options.js => build-options.ts} | 14 +- addon/utils/{chart-data.js => chart-data.ts} | 0 .../{option-loader.js => option-loader.ts} | 5 +- ember-cli-build.js | 14 +- index.js | 91 +---- package.json | 15 +- .../components/chart-bar-basic.hbs | 0 .../components/chart-column-drilldown.hbs | 0 .../components/chart-funnel.hbs | 0 .../components/chart-heat-map.hbs | 0 .../chart-highstock-interactive.hbs | 0 .../components/chart-line-basic.hbs | 0 .../components/chart-line-interactive.hbs | 0 .../components/chart-map-basic.hbs | 0 .../components/chart-scatter.hbs | 0 .../components/chart-solid-gauge.hbs | 0 .../components/chart-waterfall.hbs | 0 tsconfig.json | 23 ++ types/global.d.ts | 7 + yarn.lock | 320 +++++++++++++++++- 23 files changed, 455 insertions(+), 168 deletions(-) rename addon/components/{high-charts.js => high-charts.ts} (57%) rename addon/utils/{build-options.js => build-options.ts} (67%) rename addon/utils/{chart-data.js => chart-data.ts} (100%) rename addon/utils/{option-loader.js => option-loader.ts} (82%) rename tests/dummy/app/{templates => }/components/chart-bar-basic.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-column-drilldown.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-funnel.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-heat-map.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-highstock-interactive.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-line-basic.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-line-interactive.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-map-basic.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-scatter.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-solid-gauge.hbs (100%) rename tests/dummy/app/{templates => }/components/chart-waterfall.hbs (100%) create mode 100644 tsconfig.json create mode 100644 types/global.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 72edcb35..5ce9e914 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', + parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 'latest', sourceType: 'module', @@ -22,9 +22,6 @@ module.exports = { env: { browser: true, }, - globals: { - Highcharts: false, - }, rules: {}, overrides: [ // node files diff --git a/README.md b/README.md index 6feafdae..989b2929 100644 --- a/README.md +++ b/README.md @@ -132,57 +132,16 @@ You can add the `emberHighCharts` option to your `ember-cli-build.js` file to lo var app = new EmberApp({ emberHighCharts: { includeHighCharts: false, - includeHighStock: true, - includeHighMaps: false, includeHighChartsMore: true, includeHighCharts3D: true, - includeModules: ['map', 'broken-axis', 'heatmap', ... ] - /* Some available modules include: - boost, broken-axis, canvas-tools, data, drilldown, exporting, funnel, - heatmap, map, no-data-to-display, offline-exporting, solid-gauge, treemap. - */ } }); ``` All modules can be found [here](https://github.com/highcharts/highcharts/tree/master/ts/masters/modules). -### Highstock +### Highstock, Highmaps, etc -Highcharts is already included in Highstock, so it is not necessary to load both. -Using the following configuration to load Highstock: - -```js -var app = new EmberApp({ - emberHighCharts: { - includeHighCharts: false, - includeHighStock: true - } -}); -``` - -### Highmaps - -Highcharts is not included in Highmaps. If you only need to use Highmaps use the following configuration: - -```js -var app = new EmberApp({ - emberHighCharts: { - includeHighCharts: false, - includeHighMaps: true - } -}); -``` - -If you need to use Highmaps and Highcharts then use the following configuration: - -```js -var app = new EmberApp({ - emberHighCharts: { - includeHighCharts: true, - includeModules: ['map'] - } -}); -``` +We now use dynamic imports to import the Highcharts packages you need based on the `mode` argument passed. ### Global Highcharts Config Options diff --git a/addon/components/high-charts.js b/addon/components/high-charts.ts similarity index 57% rename from addon/components/high-charts.js rename to addon/components/high-charts.ts index 8dcb8599..4e202ec5 100644 --- a/addon/components/high-charts.js +++ b/addon/components/high-charts.ts @@ -9,18 +9,33 @@ import { scheduleOnce } from '@ember/runloop'; import buildOptions from '../utils/build-options'; import { setDefaultHighChartOptions } from '../utils/option-loader'; import { getSeriesMap, getSeriesChanges } from '../utils/chart-data'; +import type Owner from '@ember/owner'; + +let Highcharts; /* Map ember-highcharts modes to Highcharts methods * https://api.highcharts.com/class-reference/Highcharts.html */ -const CHART_TYPES = Object.freeze({ +const CHART_TYPES = { StockChart: 'stockChart', Map: 'mapChart', Gantt: 'ganttChart', undefined: 'chart', -}); +} as const; + +interface HighChartsSignature { + Element: HTMLDivElement; + Args: { + chartOptions?: Highcharts.Options; + mode?: 'Gantt' | 'Map' | 'StockChart'; + theme?: string; + }; + Blocks: { + default: [chart: Highcharts.Chart | null]; + }; +} -export default class HighCharts extends Component { +export default class HighCharts extends Component { get content() { return this.args.content ?? undefined; } @@ -42,17 +57,17 @@ export default class HighCharts extends Component { } @tracked - el = undefined; + el: HTMLDivElement | undefined = undefined; @tracked - chart = null; + chart: Highcharts.Chart | null = null; get buildOptions() { return buildOptions(this.theme, this.chartOptions, this.content); } drawAfterRender() { - scheduleOnce('afterRender', this, 'draw'); + scheduleOnce('afterRender', this, this.draw); } draw() { @@ -69,10 +84,11 @@ export default class HighCharts extends Component { } @action - onDidInsert(el) { + async onDidInsert(el: HTMLDivElement) { + await this._importHighchartsDeps(); this.el = el; this.drawAfterRender(); - setDefaultHighChartOptions(getOwner(this)); + setDefaultHighChartOptions(getOwner(this) as Owner); } @action @@ -133,9 +149,57 @@ export default class HighCharts extends Component { return chart.redraw(); } - willDestroy(...args) { - super.willDestroy(...args); + willDestroy() { + super.willDestroy(); this.chart?.destroy(); } + + async _importHighchartsDeps() { + if (this.args.mode === 'Map') { + Highcharts = await import('highcharts/highmaps'); + } else if (this.args.mode === 'StockChart') { + Highcharts = await import('highcharts/highstock'); + } else { + Highcharts = await import('highcharts'); + } + + // 3d support + if (this.args.chartOptions?.chart?.options3d) { + const Boost = await import('highcharts/modules/boost'); + Boost.default(Highcharts); + const Highcharts3d = await import('highcharts/highcharts-3d'); + Highcharts3d.default(Highcharts); + } + + // Drilldown support + if (this.args.chartOptions?.drilldown) { + const Drilldown = await import('highcharts/modules/drilldown'); + Drilldown.default(Highcharts); + } + + if (this.args.chartOptions?.chart?.type === 'funnel') { + const Funnel = await import('highcharts/modules/funnel'); + Funnel.default(Highcharts); + } + + if (this.args.chartOptions?.chart?.type === 'heatmap') { + const Heatmap = await import('highcharts/modules/heatmap'); + const More = await import('highcharts/highcharts-more'); + More.default(Highcharts); + Heatmap.default(Highcharts); + } + + if (this.args.chartOptions?.chart?.type === 'solidgauge') { + const SolidGauge = await import('highcharts/modules/solid-gauge'); + const More = await import('highcharts/highcharts-more'); + More.default(Highcharts); + SolidGauge.default(Highcharts); + } + + if (this.args.chartOptions?.chart?.type === 'waterfall') { + const More = await import('highcharts/highcharts-more'); + More.default(Highcharts); + } + } } diff --git a/addon/utils/build-options.js b/addon/utils/build-options.ts similarity index 67% rename from addon/utils/build-options.js rename to addon/utils/build-options.ts index 86eca29c..71a99f17 100644 --- a/addon/utils/build-options.js +++ b/addon/utils/build-options.ts @@ -1,17 +1,23 @@ import merge from 'deepmerge'; +import Highcharts from 'highcharts'; export const EMPTY_CHART_CONTENT = [ - Object.freeze({ + { id: 'noData', data: 0, color: '#aaaaaa', - }), -]; + }, +] as const; -export default function buildOptions(theme, options = {}, content) { +export default function buildOptions( + theme: Highcharts.Options, + options = {}, + content?: Array, +) { // if 'no-data-to-display' module has been imported, keep empty series // and leave it to highcharts to show no data label. + // @ts-expect-error TODO: determine is we still need showNoData const isEmpty = !Highcharts.Chart.prototype.showNoData && !content?.length; const chartOptions = merge(theme, options); const defaults = { diff --git a/addon/utils/chart-data.js b/addon/utils/chart-data.ts similarity index 100% rename from addon/utils/chart-data.js rename to addon/utils/chart-data.ts diff --git a/addon/utils/option-loader.js b/addon/utils/option-loader.ts similarity index 82% rename from addon/utils/option-loader.js rename to addon/utils/option-loader.ts index ec7387a3..009a2005 100644 --- a/addon/utils/option-loader.js +++ b/addon/utils/option-loader.ts @@ -1,6 +1,9 @@ +import type Owner from '@ember/owner'; +import Highcharts from 'highcharts'; + let localConfig = null; -export function setDefaultHighChartOptions(owner) { +export function setDefaultHighChartOptions(owner: Owner) { if (!localConfig) { // use options defined in highcharts-configs/application.js if they exist const configFactory = owner.factoryFor('highcharts-config:application'); diff --git a/ember-cli-build.js b/ember-cli-build.js index 3432f374..40e857b2 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -4,20 +4,12 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function (defaults) { const app = new EmberAddon(defaults, { + 'ember-cli-babel': { + enableTypeScriptTransform: true, + }, emberHighCharts: { - includeHighCharts: false, - includeHighStock: true, - useStyledMode: false, includeHighChartsMore: true, includeHighCharts3D: true, - includeModules: [ - 'boost', - 'map', - 'drilldown', - 'solid-gauge', - 'funnel', - 'heatmap', - ], }, }); diff --git a/index.js b/index.js index 6f94e6fb..dc9ef9dd 100644 --- a/index.js +++ b/index.js @@ -1,91 +1,14 @@ 'use strict'; -const Funnel = require('broccoli-funnel'); -const mergeTrees = require('broccoli-merge-trees'); -const path = require('path'); - module.exports = { name: require('./package').name, - included(app) { - this._super.included.apply(this, arguments); - - // The app argument passed to included is the host app or parent addon. - // And the addon has a `import` api exposed since ember-cli/ember-cli#5877. - // If the `app.import` is available we can just use that. - if (typeof app.import !== 'function') { - // If the addon has the _findHost() method (in ember-cli >= 2.7.0), we'll just - // use that. - if (typeof this._findHost === 'function') { - app = this._findHost(); - } else { - // Otherwise, we'll use this implementation borrowed from the _findHost() - // method in ember-cli. - let current = this; - do { - app = current.app || app; - } while (current.parent.parent && (current = current.parent)); - } - } - - const options = app.options.emberHighCharts || { includeHighCharts: true }; - const highchartsPath = options.useStyledMode - ? 'vendor/highcharts/js' - : 'vendor/highcharts'; - - if (options.includeHighCharts) { - app.import(path.join(highchartsPath, 'highcharts.src.js')); - } - - if (options.includeHighStock) { - app.import(path.join(highchartsPath, 'highstock.src.js')); - } - - if (options.includeHighMaps) { - app.import(path.join(highchartsPath, 'highmaps.src.js')); - } - - if (options.includeHighChartsMore) { - app.import(path.join(highchartsPath, 'highcharts-more.src.js')); - } - - if (options.includeHighCharts3D) { - // boost module need to be imported before highcharts-3d - if (options.includeModules) { - const boostIndex = options.includeModules.indexOf('boost'); - if (boostIndex !== -1) { - app.import(path.join(highchartsPath, 'modules', 'boost.src.js')); - options.includeModules.splice(boostIndex, 1); - } - } - - app.import(path.join(highchartsPath, 'highcharts-3d.src.js')); - } - - if (options.includeModules) { - const modules = options.includeModules; - for (let i = 0; i < modules.length; i++) { - const moduleFilename = `${modules[i]}.src.js`; - app.import(path.join(highchartsPath, 'modules', moduleFilename)); - } - } - }, - - treeForVendor(vendorTree) { - const trees = []; - // eslint-disable-next-line n/no-unpublished-require - const highchartsPath = path.dirname(require.resolve('highcharts')); - - if (vendorTree) { - trees.push(vendorTree); - } - - trees.push( - new Funnel(highchartsPath, { - destDir: 'highcharts', - }), - ); - - return mergeTrees(trees); + options: { + babel: { + plugins: [require.resolve('ember-auto-import/babel-plugin')], + }, + 'ember-cli-babel': { + enableTypeScriptTransform: true, + }, }, }; diff --git a/package.json b/package.json index 3f32dc61..6ee0d2d2 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", + "lint:types": "glint", "release": "release-it", "start": "ember serve", "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"", @@ -33,9 +34,7 @@ }, "dependencies": { "@babel/core": "^7.24.4", - "@ember/render-modifiers": "^2.0.0", - "broccoli-funnel": "^3.0.3", - "broccoli-merge-trees": "^4.2.0", + "@ember/render-modifiers": "^2.1.0", "deepmerge": "^4.3.1", "ember-auto-import": "^2.7.2", "ember-cli-babel": "^8.2.0", @@ -54,7 +53,14 @@ "@embroider/test-setup": "^3.0.3", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", + "@glint/core": "^1.4.0", + "@glint/environment-ember-loose": "^1.4.0", + "@glint/template": "^1.4.0", "@release-it-plugins/lerna-changelog": "^7.0.0", + "@tsconfig/ember": "^3.0.8", + "@types/ember__component": "^4.0.22", + "@typescript-eslint/eslint-plugin": "^7.16.0", + "@typescript-eslint/parser": "^7.16.0", "babel-plugin-dynamic-import-node": "^2.3.3", "bootstrap": "^4.5.0", "broccoli-asset-rev": "^3.0.0", @@ -87,7 +93,8 @@ "release-it": "^17.5.0", "stylelint": "^15.11.0", "stylelint-config-standard": "^34.0.0", - "stylelint-prettier": "^4.1.0" + "stylelint-prettier": "^4.1.0", + "typescript": "^5.5.3" }, "peerDependencies": { "ember-source": ">= 3.28.0", diff --git a/tests/dummy/app/templates/components/chart-bar-basic.hbs b/tests/dummy/app/components/chart-bar-basic.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-bar-basic.hbs rename to tests/dummy/app/components/chart-bar-basic.hbs diff --git a/tests/dummy/app/templates/components/chart-column-drilldown.hbs b/tests/dummy/app/components/chart-column-drilldown.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-column-drilldown.hbs rename to tests/dummy/app/components/chart-column-drilldown.hbs diff --git a/tests/dummy/app/templates/components/chart-funnel.hbs b/tests/dummy/app/components/chart-funnel.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-funnel.hbs rename to tests/dummy/app/components/chart-funnel.hbs diff --git a/tests/dummy/app/templates/components/chart-heat-map.hbs b/tests/dummy/app/components/chart-heat-map.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-heat-map.hbs rename to tests/dummy/app/components/chart-heat-map.hbs diff --git a/tests/dummy/app/templates/components/chart-highstock-interactive.hbs b/tests/dummy/app/components/chart-highstock-interactive.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-highstock-interactive.hbs rename to tests/dummy/app/components/chart-highstock-interactive.hbs diff --git a/tests/dummy/app/templates/components/chart-line-basic.hbs b/tests/dummy/app/components/chart-line-basic.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-line-basic.hbs rename to tests/dummy/app/components/chart-line-basic.hbs diff --git a/tests/dummy/app/templates/components/chart-line-interactive.hbs b/tests/dummy/app/components/chart-line-interactive.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-line-interactive.hbs rename to tests/dummy/app/components/chart-line-interactive.hbs diff --git a/tests/dummy/app/templates/components/chart-map-basic.hbs b/tests/dummy/app/components/chart-map-basic.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-map-basic.hbs rename to tests/dummy/app/components/chart-map-basic.hbs diff --git a/tests/dummy/app/templates/components/chart-scatter.hbs b/tests/dummy/app/components/chart-scatter.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-scatter.hbs rename to tests/dummy/app/components/chart-scatter.hbs diff --git a/tests/dummy/app/templates/components/chart-solid-gauge.hbs b/tests/dummy/app/components/chart-solid-gauge.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-solid-gauge.hbs rename to tests/dummy/app/components/chart-solid-gauge.hbs diff --git a/tests/dummy/app/templates/components/chart-waterfall.hbs b/tests/dummy/app/components/chart-waterfall.hbs similarity index 100% rename from tests/dummy/app/templates/components/chart-waterfall.hbs rename to tests/dummy/app/components/chart-waterfall.hbs diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..bdbb9660 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "@tsconfig/ember/tsconfig.json", + "include": ["addon/**/*", "types/**/*"], + "glint": { + "environment": ["ember-loose"] + }, + "compilerOptions": { + "allowJs": true, + "declarationDir": "declarations", + + /** + We don't want to include types dependencies in our compiled output, so tell TypeScript + to enforce using `import type` instead of `import` for Types. + */ + "verbatimModuleSyntax": true, + + /** + We want our tooling to know how to resolve our custom files so the appropriate plugins + can do the proper transformations on those files. + */ + "allowImportingTsExtensions": true + } +} \ No newline at end of file diff --git a/types/global.d.ts b/types/global.d.ts new file mode 100644 index 00000000..2c0ac599 --- /dev/null +++ b/types/global.d.ts @@ -0,0 +1,7 @@ +import '@glint/environment-ember-loose'; + +import type RenderModifiersRegistry from '@ember/render-modifiers/template-registry'; + +declare module '@glint/environment-ember-loose/registry' { + export default interface Registry extends RenderModifiersRegistry {} +} diff --git a/yarn.lock b/yarn.lock index 86ff5f4e..3adc1917 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1132,7 +1132,7 @@ mkdirp "^1.0.4" silent-error "^1.1.1" -"@ember/render-modifiers@^2.0.0": +"@ember/render-modifiers@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@ember/render-modifiers/-/render-modifiers-2.1.0.tgz#f4fff95a8b5cfbe947ec46644732d511711c5bf9" integrity sha512-LruhfoDv2itpk0fA0IC76Sxjcnq/7BC6txpQo40hOko8Dn6OxwQfxkPIbZGV0Cz7df+iX+VJrcYzNIvlc3w2EQ== @@ -1228,7 +1228,7 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.11.0", "@eslint-community/regexpp@^4.6.1": +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.11.0", "@eslint-community/regexpp@^4.6.1": version "4.11.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== @@ -1269,7 +1269,7 @@ "@glimmer/vm" "^0.87.1" "@glimmer/wire-format" "^0.87.1" -"@glimmer/component@^1.1.2": +"@glimmer/component@^1.1.0", "@glimmer/component@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@glimmer/component/-/component-1.1.2.tgz#892ec0c9f0b6b3e41c112be502fde073cf24d17c" integrity sha512-XyAsEEa4kWOPy+gIdMjJ8XlzA3qrGH55ZDv6nA16ibalCR17k74BI0CztxuRds+Rm6CtbUVgheCVlcCULuqD7A== @@ -1551,6 +1551,31 @@ "@glimmer/interfaces" "^0.87.1" "@glimmer/util" "^0.87.1" +"@glint/core@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@glint/core/-/core-1.4.0.tgz#cc977d295788dd25fa3049830abc2c8044ec4a74" + integrity sha512-nq27a/1R6kc3lsuciz8z9IZO1NQCbNkEBxf5KJI7AUrnps6RzQzmq3pmwO24zQYmFcH4sqpod8fleNIpg8YEqg== + dependencies: + "@glimmer/syntax" "^0.84.3" + escape-string-regexp "^4.0.0" + semver "^7.5.2" + silent-error "^1.1.1" + uuid "^8.3.2" + vscode-languageserver "^8.0.1" + vscode-languageserver-textdocument "^1.0.5" + vscode-uri "^3.0.8" + yargs "^17.5.1" + +"@glint/environment-ember-loose@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@glint/environment-ember-loose/-/environment-ember-loose-1.4.0.tgz#282cdc5967345c696be40d046d9bcb3fc231bdd6" + integrity sha512-vFR3qgPTisGzS36e04195wTUrtUc6GuVwm6hsC/XXx6PeRw/6rtMxhK08Aw/VtDc00UqQzM9sIEghPVKHwqVVQ== + +"@glint/template@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@glint/template/-/template-1.4.0.tgz#1c9a2f5b84f2944abe52f4e209e3c00b5c6bd710" + integrity sha512-yD271NhLei/HSQ6utm6hKgoU+B5D5DY+B1irPvgI4KsDEcZI7v/INf5HAMJfzCg92bP1sIxSOuXu5DU6VsY7Mw== + "@handlebars/parser@~2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-2.0.0.tgz#5e8b7298f31ff8f7b260e6b7363c7e9ceed7d9c5" @@ -1892,6 +1917,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== +"@tsconfig/ember@^3.0.8": + version "3.0.8" + resolved "https://registry.yarnpkg.com/@tsconfig/ember/-/ember-3.0.8.tgz#5ebda83389b4f8dad4edf94ad0c734bc8038f39a" + integrity sha512-OVnIsZIt/8q0VEtcdz3rRryNrm6gdJTxXlxefkGIrkZnME0wqslmwHlUEZ7mvh377df9FqBhNKrYNarhCW8zJA== + "@types/body-parser@*": version "1.19.5" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" @@ -1938,6 +1968,151 @@ dependencies: "@types/ms" "*" +"@types/ember@*": + version "4.0.11" + resolved "https://registry.yarnpkg.com/@types/ember/-/ember-4.0.11.tgz#3a624a8018ef4b0015a299ecf1481401d60ec18b" + integrity sha512-v7VIex0YILK8fP87LkIfzeeYKNnu74+xwf6U56v6MUDDGfSs9q/6NCxiUfwkxD+z5nQiUcwvfKVokX8qzZFRLw== + dependencies: + "@types/ember__application" "*" + "@types/ember__array" "*" + "@types/ember__component" "*" + "@types/ember__controller" "*" + "@types/ember__debug" "*" + "@types/ember__engine" "*" + "@types/ember__error" "*" + "@types/ember__object" "*" + "@types/ember__polyfills" "*" + "@types/ember__routing" "*" + "@types/ember__runloop" "*" + "@types/ember__service" "*" + "@types/ember__string" "*" + "@types/ember__template" "*" + "@types/ember__test" "*" + "@types/ember__utils" "*" + "@types/rsvp" "*" + +"@types/ember__application@*": + version "4.0.11" + resolved "https://registry.yarnpkg.com/@types/ember__application/-/ember__application-4.0.11.tgz#1912f56dda02a04222b726a75c37f6f75ef2be1f" + integrity sha512-U1S7XW0V70nTWbFckWoraJbYGBJK69muP/CsPFLeAuUYHfkkDiwh1SfqgAUN9aHtrEJM5SuSYVYp2YsTI2yLuA== + dependencies: + "@glimmer/component" "^1.1.0" + "@types/ember" "*" + "@types/ember__engine" "*" + "@types/ember__object" "*" + "@types/ember__owner" "*" + "@types/ember__routing" "*" + +"@types/ember__array@*": + version "4.0.10" + resolved "https://registry.yarnpkg.com/@types/ember__array/-/ember__array-4.0.10.tgz#948bb232722095673e94e971337f4aeebbef6190" + integrity sha512-UrhDbopLI3jB0MqV14y8yji2IuPNmeDrtT1PRYJL4CThLHrRkfeYyFvxqvrxWxn0wXKjbbjfH1gOe7BU57QrLQ== + dependencies: + "@types/ember" "*" + "@types/ember__object" "*" + +"@types/ember__component@*", "@types/ember__component@^4.0.22": + version "4.0.22" + resolved "https://registry.yarnpkg.com/@types/ember__component/-/ember__component-4.0.22.tgz#10db1bf9405c3cb1d5cfac694608794947ed76a9" + integrity sha512-m72EtmBN/RxOChXqRsyOg4RR5+AiB4LQ8s1CEKNYAfvANt18m4hjqxtA7QZYLTq2ZjEVJGpdMsrdDuONWjwRSQ== + dependencies: + "@types/ember" "*" + "@types/ember__object" "*" + +"@types/ember__controller@*": + version "4.0.12" + resolved "https://registry.yarnpkg.com/@types/ember__controller/-/ember__controller-4.0.12.tgz#b8e3d9ffd6cd6091160f829a1cc8585a54580256" + integrity sha512-80rdnSC0UJBqoUX5/vkQcM2xkRdTPTvY0dPXEfY5cC5OZITbcSeRo5qa7ZGhgNBfH6XYyh55Lo/b811LwU3N9w== + dependencies: + "@types/ember__object" "*" + +"@types/ember__debug@*": + version "4.0.8" + resolved "https://registry.yarnpkg.com/@types/ember__debug/-/ember__debug-4.0.8.tgz#cccc58e03da1b4b59f8f0c59352fc541b08c9b37" + integrity sha512-9wF7STmDHDsUxSjyCq2lpMq/03QOPkBQMGJnV8yOBnVZxB6f+FJH/kxaCprdMkUe7iwAPNEC2zrFFx1tzH75Kg== + dependencies: + "@types/ember__object" "*" + "@types/ember__owner" "*" + +"@types/ember__engine@*": + version "4.0.11" + resolved "https://registry.yarnpkg.com/@types/ember__engine/-/ember__engine-4.0.11.tgz#fbe357112e6a99ca8e1893fdef561b4b72527c52" + integrity sha512-ryR4Q1Xm3kQ3Ap58w10CxV3+vb3hs1cJqi7UZ5IlSdLRql7AbpS6hIjxSQ3EQ4zadeeJ6/D8JJcSwqR7eX3PFA== + dependencies: + "@types/ember__object" "*" + "@types/ember__owner" "*" + +"@types/ember__error@*": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/ember__error/-/ember__error-4.0.6.tgz#ff3b18fc8525c73f92828789bb4fed908e553df9" + integrity sha512-vYrLaGGjHkN14K89Vm8yqB2mkpJQefE5w7QJkkgYyV+smzns1vKlPbvuFevRtoeYNn4u4yY0JyF7HceNkm3H0Q== + +"@types/ember__object@*": + version "4.0.12" + resolved "https://registry.yarnpkg.com/@types/ember__object/-/ember__object-4.0.12.tgz#042f89e19e8af5fae3f144074adf04a69d19a53d" + integrity sha512-ZEpikPjZ02m1QCBiTPTayMJwVwF4UBlHlGDoScRB3IP/SUS1O5mmn1/CnSQDxzzF3ctfmhNuTZzVBBc1Y8OC1A== + dependencies: + "@types/ember" "*" + "@types/rsvp" "*" + +"@types/ember__owner@*": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@types/ember__owner/-/ember__owner-4.0.9.tgz#6abe1d529a9969a461692848dfac375d395f209e" + integrity sha512-iyBda4aUIjBmeiKTKmPow/EJO7xWn8m85CnQTOCqQzTWJyJpgfObbXSHahOHXOfMm279Oa5NlbmS/EontB+XiQ== + +"@types/ember__polyfills@*": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/ember__polyfills/-/ember__polyfills-4.0.6.tgz#b6dd993a89470caeacc38a58822572dd2450de79" + integrity sha512-hbds3Qv+oVm/QKIaY1E6atvrCoJTH/MPSl4swOhX6P0RiMB2fOfFCrFSD1mP1KrU1LqpHJ2Rzs7XLe53SWVzgw== + +"@types/ember__routing@*": + version "4.0.22" + resolved "https://registry.yarnpkg.com/@types/ember__routing/-/ember__routing-4.0.22.tgz#76417bf5cf2e8d07dee3eb48977f7c3ed7fe4055" + integrity sha512-qLk9Vd2GMxdlGmX9xbzg4Farths+AQGzYDH901Wo2Nsre+Cwv1Tk1rbCiay2V3ICYZYufytdWT6V++DISF3nvw== + dependencies: + "@types/ember" "*" + "@types/ember__controller" "*" + "@types/ember__object" "*" + "@types/ember__service" "*" + +"@types/ember__runloop@*": + version "4.0.10" + resolved "https://registry.yarnpkg.com/@types/ember__runloop/-/ember__runloop-4.0.10.tgz#7ab893f33128042b61c5712b12500f95d0bb4107" + integrity sha512-9MZfOJBXuUP7RqLjovmzy1yY2xKTxVpqHMapqy6QJ8mjAekRmq9IJ+ni2zJ5CWftyb3Lqu3Eks05CL7fnbhcJA== + dependencies: + "@types/ember" "*" + +"@types/ember__service@*": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@types/ember__service/-/ember__service-4.0.9.tgz#8b15a14843026854df73bb8c2d45c11551ea4dde" + integrity sha512-DrepocL/4hH5YxbDWbxEKMDcAchBPSGGa4g+LEINW1Po81RmSdKw5GZV4UO0mvRWgkdu3EbWUxbTzB4gmbDSeQ== + dependencies: + "@types/ember__object" "*" + +"@types/ember__string@*": + version "3.0.15" + resolved "https://registry.yarnpkg.com/@types/ember__string/-/ember__string-3.0.15.tgz#fe0e36a1efbbab42ee7185746de92b9f27af9507" + integrity sha512-SxoaweAJUJKSIt82clIwpi/Fm0IfeisozLnXthnBp/hE2JyVcnOb1wMIbw0CCfzercmyWG1njV45VBqy8SrLDQ== + +"@types/ember__template@*": + version "4.0.7" + resolved "https://registry.yarnpkg.com/@types/ember__template/-/ember__template-4.0.7.tgz#ed8cd6b5bf69954c6b8de27a17a41250338a4ba6" + integrity sha512-jv4hhG+8d1zdma+jhbCdJ3Ak7C22YNatGyWWvB3N9zbXq358AAPXaJoyNY8QTDbD/RIR9P6yoRk4u9vLbF6zfA== + +"@types/ember__test@*": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/ember__test/-/ember__test-4.0.6.tgz#eef96094851f09e81ba5e817b6e0640b1e231718" + integrity sha512-Nswm/epfTepXknT8scZvWyyop1aqJcZcyzY4THGHFcXvYQQfA9rgmgrx6vo9vCJmYHh3jm0TTAIAIfoCvGaX5g== + dependencies: + "@types/ember__application" "*" + +"@types/ember__utils@*": + version "4.0.7" + resolved "https://registry.yarnpkg.com/@types/ember__utils/-/ember__utils-4.0.7.tgz#4dae2b78ce5752e9062f41352f0328f1fd8b1a1d" + integrity sha512-qQPBeWRyIPigKnZ68POlkqI5e6XA78Q4G3xHo687wQTcEtfoL/iZyPC4hn70mdijcZq8Hjch2Y3E5yhsEMzK+g== + dependencies: + "@types/ember" "*" + "@types/eslint-scope@^3.7.3": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -2086,6 +2261,11 @@ "@types/glob" "*" "@types/node" "*" +"@types/rsvp@*": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@types/rsvp/-/rsvp-4.0.9.tgz#7d9d07c1a2fa82c808eca37757cc6a20272a4b66" + integrity sha512-F6vaN5mbxw2MBCu/AD9fSKwrhnto2pE77dyUsi415qz9IP9ni9ZOWXHxnXfsM4NW9UjW+it189jvvqnhv37Z7Q== + "@types/send@*": version "0.17.4" resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.4.tgz#6619cd24e7270793702e4e6a4b958a9010cfc57a" @@ -2113,6 +2293,87 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc" integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA== +"@typescript-eslint/eslint-plugin@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.0.tgz#b3563927341eca15124a18c6f94215f779f5c02a" + integrity sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "7.16.0" + "@typescript-eslint/type-utils" "7.16.0" + "@typescript-eslint/utils" "7.16.0" + "@typescript-eslint/visitor-keys" "7.16.0" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/parser@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.16.0.tgz#53fae8112f8c912024aea7b499cf7374487af6d8" + integrity sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw== + dependencies: + "@typescript-eslint/scope-manager" "7.16.0" + "@typescript-eslint/types" "7.16.0" + "@typescript-eslint/typescript-estree" "7.16.0" + "@typescript-eslint/visitor-keys" "7.16.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.16.0.tgz#eb0757af5720c9c53c8010d7a0355ae27e17b7e5" + integrity sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw== + dependencies: + "@typescript-eslint/types" "7.16.0" + "@typescript-eslint/visitor-keys" "7.16.0" + +"@typescript-eslint/type-utils@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.16.0.tgz#ec52b1932b8fb44a15a3e20208e0bd49d0b6bd00" + integrity sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg== + dependencies: + "@typescript-eslint/typescript-estree" "7.16.0" + "@typescript-eslint/utils" "7.16.0" + debug "^4.3.4" + ts-api-utils "^1.3.0" + +"@typescript-eslint/types@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.16.0.tgz#60a19d7e7a6b1caa2c06fac860829d162a036ed2" + integrity sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw== + +"@typescript-eslint/typescript-estree@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.0.tgz#98ac779d526fab2a781e5619c9250f3e33867c09" + integrity sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw== + dependencies: + "@typescript-eslint/types" "7.16.0" + "@typescript-eslint/visitor-keys" "7.16.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/utils@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.16.0.tgz#b38dc0ce1778e8182e227c98d91d3418449aa17f" + integrity sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "7.16.0" + "@typescript-eslint/types" "7.16.0" + "@typescript-eslint/typescript-estree" "7.16.0" + +"@typescript-eslint/visitor-keys@7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.0.tgz#a1d99fa7a3787962d6e0efd436575ef840e23b06" + integrity sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg== + dependencies: + "@typescript-eslint/types" "7.16.0" + eslint-visitor-keys "^3.4.3" + "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" @@ -6998,7 +7259,7 @@ ieee754@^1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: +ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== @@ -8644,7 +8905,7 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.0: +minimatch@^9.0.0, minimatch@^9.0.4: version "9.0.5" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== @@ -10479,7 +10740,7 @@ semver-diff@^4.0.0: dependencies: semver "^7.3.5" -semver@7.6.2, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4: +semver@7.6.2, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== @@ -11530,6 +11791,11 @@ trim-newlines@^4.0.2: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-4.1.1.tgz#28c88deb50ed10c7ba6dc2474421904a00139125" integrity sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ== +ts-api-utils@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== + tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -11636,6 +11902,11 @@ typescript-memoize@^1.0.0-alpha.3, typescript-memoize@^1.0.1: resolved "https://registry.yarnpkg.com/typescript-memoize/-/typescript-memoize-1.1.1.tgz#02737495d5df6ebf72c07ba0d002e8f4cf5ccfa0" integrity sha512-GQ90TcKpIH4XxYTI2F98yEQYZgjNMOGPpOgdjIBhaLaWji5HPWlRnZ4AeA1hfBxtY7bCGDJsqDDHk/KaHOl5bA== +typescript@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.3.tgz#e1b0a3c394190838a0b168e771b0ad56a0af0faa" + integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ== + uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" @@ -11904,6 +12175,41 @@ vary@^1, vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +vscode-jsonrpc@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz#cb9989c65e219e18533cc38e767611272d274c94" + integrity sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw== + +vscode-languageserver-protocol@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz#6d0d54da093f0c0ee3060b81612cce0f11060d57" + integrity sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA== + dependencies: + vscode-jsonrpc "8.1.0" + vscode-languageserver-types "3.17.3" + +vscode-languageserver-textdocument@^1.0.5: + version "1.0.11" + resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz#0822a000e7d4dc083312580d7575fe9e3ba2e2bf" + integrity sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA== + +vscode-languageserver-types@3.17.3: + version "3.17.3" + resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz#72d05e47b73be93acb84d6e311b5786390f13f64" + integrity sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA== + +vscode-languageserver@^8.0.1: + version "8.1.0" + resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz#5024253718915d84576ce6662dd46a791498d827" + integrity sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw== + dependencies: + vscode-languageserver-protocol "3.17.3" + +vscode-uri@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" + integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== + walk-sync@^0.2.5: version "0.2.7" resolved "https://registry.yarnpkg.com/walk-sync/-/walk-sync-0.2.7.tgz#b49be4ee6867657aeb736978b56a29d10fa39969" @@ -12244,7 +12550,7 @@ yargs@^16.0.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.1.0, yargs@^17.7.2: +yargs@^17.1.0, yargs@^17.5.1, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== From c793987dacfaf43c8ad3fa63daea6024ce67d7c7 Mon Sep 17 00:00:00 2001 From: Robbie Wagner Date: Mon, 15 Jul 2024 17:19:47 -0400 Subject: [PATCH 2/4] Make TS happy --- addon/components/high-charts.hbs | 10 ++--- addon/components/high-charts.ts | 71 +++++++++++++++++++++++++------- addon/utils/build-options.ts | 6 +-- addon/utils/chart-data.ts | 27 ++++++++---- addon/utils/option-loader.ts | 2 + 5 files changed, 83 insertions(+), 33 deletions(-) diff --git a/addon/components/high-charts.hbs b/addon/components/high-charts.hbs index da489465..30aff845 100644 --- a/addon/components/high-charts.hbs +++ b/addon/components/high-charts.hbs @@ -1,11 +1,7 @@ -
diff --git a/addon/components/high-charts.ts b/addon/components/high-charts.ts index 4e202ec5..d2e77e29 100644 --- a/addon/components/high-charts.ts +++ b/addon/components/high-charts.ts @@ -4,14 +4,16 @@ import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; import { getOwner } from '@ember/application'; +import type Owner from '@ember/owner'; import { scheduleOnce } from '@ember/runloop'; +import type { default as _Highcharts } from 'highcharts'; + import buildOptions from '../utils/build-options'; import { setDefaultHighChartOptions } from '../utils/option-loader'; import { getSeriesMap, getSeriesChanges } from '../utils/chart-data'; -import type Owner from '@ember/owner'; -let Highcharts; +let Highcharts: typeof _Highcharts; /* Map ember-highcharts modes to Highcharts methods * https://api.highcharts.com/class-reference/Highcharts.html @@ -26,9 +28,28 @@ const CHART_TYPES = { interface HighChartsSignature { Element: HTMLDivElement; Args: { - chartOptions?: Highcharts.Options; + /** + * The callback argument is optional and allows you to pass in a function that runs when the chart has finished loading + */ + callback?: Highcharts.ChartCallbackFunction; + /** + * The `content` argument matches up with the `series` option in the Highcharts/Highstock/Highmaps API. + * Use this option to set the series data for your chart. + */ + content?: Highcharts.Options['series']; + /** + * The `chartOptions` argument is a generic object for setting different options with Highcharts/Highstock/Highmaps. + * Use this option to set things like the chart title and axis settings. + */ + chartOptions: Highcharts.Options; + /** + * The mode argument is optional and it determines whether to use Highcharts, Highstock, or Highmaps. + */ mode?: 'Gantt' | 'Map' | 'StockChart'; - theme?: string; + /** + * The `theme` argument is optional and it allows you to pass in a Highcharts theme. + */ + theme?: Highcharts.Options; }; Blocks: { default: [chart: Highcharts.Chart | null]; @@ -74,11 +95,14 @@ export default class HighCharts extends Component { const element = this.el?.querySelector('.chart-container'); // for any mode that is falsy ('', undefined, false), set it to default 'chart' - const mode = CHART_TYPES[this.mode] ?? CHART_TYPES.undefined; + const mode = CHART_TYPES[`${this.mode}`] ?? CHART_TYPES.undefined; const completeChartOptions = [this.buildOptions, this.callback]; - - if (element) { - const chart = Highcharts[mode](element, ...completeChartOptions); + const highchartsModeFunction = Highcharts[mode as keyof object]; + if (element && typeof highchartsModeFunction === 'function') { + const chart = (highchartsModeFunction as Function)( + element, + ...completeChartOptions, + ); this.chart = chart; } } @@ -92,7 +116,14 @@ export default class HighCharts extends Component { } @action - onDidUpdate(elem, positionalArgs, { content, chartOptions, mode }) { + onDidUpdate( + _elem: unknown, + [content, chartOptions, mode]: [ + HighChartsSignature['Args']['content'], + HighChartsSignature['Args']['chartOptions'], + HighChartsSignature['Args']['mode'], + ], + ) { const { chart } = this; if (!content || !chart) { @@ -105,17 +136,21 @@ export default class HighCharts extends Component { const isStockChart = mode === 'StockChart'; // create maps to make series data easier to work with const contentSeriesMap = getSeriesMap(content); - const chartSeriesMap = getSeriesMap(chart.series); + const chartSeriesMap = getSeriesMap( + chart.series as unknown as Array<_Highcharts.SeriesOptionsType>, + ); // remove and update current series - const chartSeriesToRemove = []; + const chartSeriesToRemove: Array = []; chart.series.forEach((series) => { if (isStockChart && series.name.match(/^Navigator/)) { return; } - const contentSeries = contentSeriesMap[series.name]; + const contentSeries = contentSeriesMap[ + series.name + ] as unknown as _Highcharts.Series; if (!contentSeries) { return chartSeriesToRemove.push(series); @@ -125,7 +160,10 @@ export default class HighCharts extends Component { // call series.update() when other series attributes like pointStart have changed if (updatedKeys.length) { - series.update(contentSeries, false); + series.update( + contentSeries as unknown as _Highcharts.SeriesOptionsType, + false, + ); } else { series.setData(contentSeries.data, false); } @@ -136,14 +174,14 @@ export default class HighCharts extends Component { // add new series content.forEach((contentSeries) => { // eslint-disable-next-line no-prototype-builtins - if (!chartSeriesMap.hasOwnProperty(contentSeries.name)) { + if (!chartSeriesMap.hasOwnProperty(contentSeries.name as string)) { chart.addSeries(contentSeries, false); } }); // reset navigator data if (isStockChart && chart.xAxis.length) { - chart.xAxis[0].setExtremes(); + chart.xAxis[0]?.setExtremes(); } return chart.redraw(); @@ -155,6 +193,9 @@ export default class HighCharts extends Component { this.chart?.destroy(); } + /** + * Dynamically imports the necessary pieces from Highcharts, based on chart type and options. + */ async _importHighchartsDeps() { if (this.args.mode === 'Map') { Highcharts = await import('highcharts/highmaps'); diff --git a/addon/utils/build-options.ts b/addon/utils/build-options.ts index 71a99f17..fc9ce8a6 100644 --- a/addon/utils/build-options.ts +++ b/addon/utils/build-options.ts @@ -10,9 +10,9 @@ export const EMPTY_CHART_CONTENT = [ ] as const; export default function buildOptions( - theme: Highcharts.Options, - options = {}, - content?: Array, + theme: Highcharts.Options = {}, + options: Highcharts.Options = {}, + content?: Highcharts.Options['series'], ) { // if 'no-data-to-display' module has been imported, keep empty series // and leave it to highcharts to show no data label. diff --git a/addon/utils/chart-data.ts b/addon/utils/chart-data.ts index 19e0b046..c165677f 100644 --- a/addon/utils/chart-data.ts +++ b/addon/utils/chart-data.ts @@ -1,18 +1,29 @@ -export function getSeriesMap(seriesGroup) { - const seriesMap = seriesGroup.reduce((seriesMap, seriesItem) => { - seriesMap[seriesItem.name] = seriesItem; - return seriesMap; - }, {}); +import type Highcharts from 'highcharts'; + +export function getSeriesMap(seriesGroup: Array) { + const seriesMap = seriesGroup.reduce( + (seriesMap, seriesItem) => { + seriesMap[seriesItem.name as string] = seriesItem; + return seriesMap; + }, + {} as { [key: string]: Highcharts.SeriesOptionsType }, + ); return seriesMap; } -export function getSeriesChanges(contentSeries, series) { +export function getSeriesChanges( + contentSeries: Highcharts.Series, + series: Highcharts.Series, +) { const updatedKeys = Object.keys(contentSeries).filter((key) => { const isValidKey = key !== 'data' && key.charAt(0) !== '_'; const isValidType = - ['object', 'function'].indexOf(typeof contentSeries[key]) === -1; - const isTheSame = contentSeries[key] === series[key]; + ['object', 'function'].indexOf( + typeof contentSeries[key as keyof object], + ) === -1; + const isTheSame = + contentSeries[key as keyof object] === series[key as keyof object]; return isValidKey && isValidType && !isTheSame; }); diff --git a/addon/utils/option-loader.ts b/addon/utils/option-loader.ts index 009a2005..69ef44e3 100644 --- a/addon/utils/option-loader.ts +++ b/addon/utils/option-loader.ts @@ -1,4 +1,6 @@ +// @ts-nocheck import type Owner from '@ember/owner'; + import Highcharts from 'highcharts'; let localConfig = null; From e4f03f2a8ea6c1a1abd92c02e65ee70d74991330 Mon Sep 17 00:00:00 2001 From: Robbie Wagner Date: Mon, 15 Jul 2024 17:23:00 -0400 Subject: [PATCH 3/4] Fix errors --- tests/dummy/app/components/chart-scatter.js | 3 ++- tests/dummy/app/components/chart-waterfall.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/dummy/app/components/chart-scatter.js b/tests/dummy/app/components/chart-scatter.js index 408127a9..7749cd5f 100644 --- a/tests/dummy/app/components/chart-scatter.js +++ b/tests/dummy/app/components/chart-scatter.js @@ -1,6 +1,7 @@ -/* eslint-disable no-undef */ import Component from '@glimmer/component'; +import Highcharts from 'highcharts'; + const totalData = 100000; export default class Scatter extends Component { diff --git a/tests/dummy/app/components/chart-waterfall.js b/tests/dummy/app/components/chart-waterfall.js index 9c1f8980..3834d84f 100644 --- a/tests/dummy/app/components/chart-waterfall.js +++ b/tests/dummy/app/components/chart-waterfall.js @@ -1,6 +1,7 @@ -/* eslint-disable no-undef */ import Component from '@glimmer/component'; +import Highcharts from 'highcharts'; + export default class Waterfall extends Component { chartOptions = { chart: { From 7bb5db10769efce150c95fe66175b823c9163b05 Mon Sep 17 00:00:00 2001 From: Robbie Wagner Date: Mon, 15 Jul 2024 17:27:50 -0400 Subject: [PATCH 4/4] Update high-charts-test.js --- tests/integration/components/high-charts-test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/components/high-charts-test.js b/tests/integration/components/high-charts-test.js index 69e981fd..4e4b76e6 100644 --- a/tests/integration/components/high-charts-test.js +++ b/tests/integration/components/high-charts-test.js @@ -1,6 +1,6 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { render, settled } from '@ember/test-helpers'; +import { render, settled, waitFor } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import cloneDeep from 'lodash-es/cloneDeep'; @@ -119,6 +119,8 @@ module('Integration | Component | High Charts', function (hooks) { /> `); + await waitFor('.highcharts-navigator'); + assert .dom('.highcharts-navigator') .exists({ count: 1 }, '.highcharts-navigator class is present');