diff --git a/.ember-cli b/.ember-cli index 8c1812cff..c53e7f496 100644 --- a/.ember-cli +++ b/.ember-cli @@ -1,15 +1,19 @@ { /** - Ember CLI sends analytics information by default. The data is completely - anonymous, but there are times when you might want to disable this behavior. + Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript + rather than JavaScript by default, when a TypeScript version of a given blueprint is available. + */ + "isTypeScriptProject": false, - Setting `disableAnalytics` to true will prevent any data from being sent. + /** + Setting `componentAuthoringFormat` to "strict" will force the blueprint generators to generate GJS + or GTS files for the component and the component rendering test. "loose" is the default. */ - "disableAnalytics": false, + "componentAuthoringFormat": "loose", /** - Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript - rather than JavaScript by default, when a TypeScript version of a given blueprint is available. + Setting `routeAuthoringFormat` to "strict" will force the blueprint generators to generate GJS + or GTS templates for routes. "loose" is the default */ - "isTypeScriptProject": false + "routeAuthoringFormat": "loose" } diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 94705f3a9..000000000 --- a/.eslintignore +++ /dev/null @@ -1,28 +0,0 @@ -# unconventional js -/blueprints/*/files/ -/vendor/ - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/coverage/ -!.* -.*/ -.eslintcache - -# data git checkout -/ember-api-docs-data/ - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 27ff30d97..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -module.exports = { - root: true, - parser: '@babel/eslint-parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - requireConfigFile: false, - babelOptions: { - plugins: [ - ['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }], - ], - }, - }, - extends: ['eslint:recommended'], - env: { - browser: true, - }, - rules: { - 'no-console': 'off', - }, - overrides: [ - // node files - { - files: [ - './.eslintrc.js', - './.prettierrc.js', - './.stylelintrc.js', - './.template-lintrc.js', - './ember-cli-build.js', - './testem.js', - './blueprints/*/index.js', - './config/**/*.js', - './lib/*/index.js', - './server/**/*.js', - './bin/*', - './prember-urls.js', - ], - excludedFiles: ['config/deprecation-workflow.js'], - parserOptions: { - sourceType: 'script', - ecmaVersion: 2017, - }, - env: { - browser: false, - node: true, - }, - extends: ['plugin:n/recommended'], - }, - { - files: ['**/*.{js,ts}'], - plugins: ['ember'], - parser: '@typescript-eslint/parser', - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', // or other configuration - ], - rules: { - 'ember/no-new-mixins': 'off', - 'ember/no-mixins': 'off', - 'ember/require-tagless-components': 'off', - 'ember/no-classic-classes': 'off', - 'ember/no-get': 'off', - 'ember/no-classic-components': 'off', - 'ember/no-private-routing-service': 'off', - }, - }, - { - files: ['**/*.gjs'], - parser: 'ember-eslint-parser', - plugins: ['ember'], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended', - 'plugin:ember/recommended-gjs', - ], - }, - { - files: ['tests/**/*.{js,ts,gjs,gts}'], - extends: ['plugin:qunit/recommended'], - }, - ], -}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d3940eb2..ac0751254 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,9 @@ jobs: cache: pnpm node-version: ${{ env.NODE_VERSION }} - name: Install Dependencies - run: pnpm install + run: pnpm install --frozen-lockfile - name: Lint - run: pnpm run lint + run: pnpm lint test: name: "Test" @@ -46,7 +46,7 @@ jobs: with: cache: pnpm node-version: ${{ env.NODE_VERSION }} - - run: pnpm install + - run: pnpm install --frozen-lockfile - run: pnpm run clone - name: Run Tests env: diff --git a/.gitignore b/.gitignore index 662ce3157..9160f5a27 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,22 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -/concat-stats-for - -# Terraform -terraform.tfstate -terraform.tfstate.backup -.env -.envrc - # compiled output /dist/ -/tmp/ +/declarations/ # dependencies -/bower_components/ /node_modules/ # misc -/.projectile /.env* /.pnp* -/.sass-cache /.eslintcache -/connect.lock /coverage/ -/libpeerconnection.log /npm-debug.log* /testem.log +/yarn-error.log + +# broccoli-debug +/DEBUG/ + public/json-docs/ public/rev-index/ @@ -39,14 +29,3 @@ local.log # ember-api-docs-data checkout /ember-api-docs-data/ /ember-api-docs-data - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/.prettierignore b/.prettierignore index 1492509de..2771f4b45 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,29 +1,21 @@ # unconventional js /blueprints/*/files/ -/vendor/ # compiled output /dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ # misc /coverage/ !.* +.*/ +/pnpm-lock.yaml +ember-cli-update.json +*.html + + .eslintcache .lint-todo/ -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - # Misc files *.md pnpm-lock.yaml diff --git a/.prettierrc.js b/.prettierrc.js index c7dd12b35..8e62a451a 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -4,9 +4,10 @@ module.exports = { plugins: ['prettier-plugin-ember-template-tag'], overrides: [ { - files: '*.{js,ts,gjs,gts}', + files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}', options: { singleQuote: true, + templateSingleQuote: false, }, }, ], diff --git a/.stylelintignore b/.stylelintignore index a0cf71cbd..fc178a0b9 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -3,6 +3,3 @@ # compiled output /dist/ - -# addons -/.node_modules.ember-try/ diff --git a/.watchmanconfig b/.watchmanconfig index e7834e3e4..f9c3d8f84 100644 --- a/.watchmanconfig +++ b/.watchmanconfig @@ -1,3 +1,3 @@ { - "ignore_dirs": ["tmp", "dist"] + "ignore_dirs": ["dist"] } diff --git a/app/adapters/application.js b/app/adapters/application.js index 988abe296..0a56c4475 100644 --- a/app/adapters/application.js +++ b/app/adapters/application.js @@ -1,4 +1,4 @@ -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import JSONAPIAdapter from '@ember-data/adapter/json-api'; import { pluralize } from 'ember-inflector'; import { isBlank } from '@ember/utils'; @@ -80,9 +80,7 @@ export default class Application extends JSONAPIAdapter { throw new Error('Unexpected model lookup'); } - const base = this.fastboot.isFastBoot - ? config.APP.domain - : window.location.origin; + const base = window.location.origin; url = `${base}/${url}.json`; try { diff --git a/app/app.js b/app/app.js index 6b73c5d72..a8b016111 100644 --- a/app/app.js +++ b/app/app.js @@ -4,6 +4,8 @@ import loadInitializers from 'ember-load-initializers'; import config from 'ember-api-docs/config/environment'; import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros'; import { setConfig } from 'ember-basic-dropdown/config'; +import setupInspector from '@embroider/legacy-inspector-support/ember-source-4.12'; + import 'ember-power-select/styles'; import './assets/styles.css'; @@ -19,6 +21,7 @@ export default class App extends Application { modulePrefix = config.modulePrefix; podModulePrefix = config.podModulePrefix; Resolver = Resolver; + inspector = setupInspector(this); } loadInitializers(App, config.modulePrefix); diff --git a/app/components/api-index-filter.hbs b/app/components/api-index-filter.hbs index 5293704e2..b3b6fbc47 100644 --- a/app/components/api-index-filter.hbs +++ b/app/components/api-index-filter.hbs @@ -1 +1,3 @@ -{{yield this.filteredData}} +
+ {{yield this.filteredData}} +
diff --git a/app/components/api-index-filter.js b/app/components/api-index-filter.js index 0519cef32..25a125079 100644 --- a/app/components/api-index-filter.js +++ b/app/components/api-index-filter.js @@ -1,12 +1,6 @@ -/* eslint-disable ember/no-computed-properties-in-native-classes */ -import { classNames } from '@ember-decorators/component'; -import { computed } from '@ember/object'; -import Component from '@ember/component'; +import Component from '@glimmer/component'; import sortBy from 'lodash.sortby'; -const filterDataComputedParams = - 'filterData.{showInherited,showProtected,showPrivate,showDeprecated}'; - /** * @typedef Args * @property {object} model @@ -21,36 +15,34 @@ const filterDataComputedParams = /** * @extends Component<{ Args: Args, Blocks: Blocks }> */ -@classNames('api-index-filter') export default class ApiIndexFilter extends Component { - @computed('model.methods.[]', filterDataComputedParams) get filteredMethods() { return this.filterItems('methods'); } - @computed('model.events.[]', filterDataComputedParams) get filteredEvents() { return this.filterItems('events'); } - @computed('model.properties.[]', filterDataComputedParams) get filteredProperties() { return this.filterItems('properties'); } filterItems(itemType) { let items = - this.model[itemType] === undefined ? [] : this.model[`${itemType}`]; - if (!this.filterData.showInherited) { + this.args.model[itemType] === undefined + ? [] + : this.args.model[`${itemType}`]; + if (!this.args.filterData.showInherited) { items = items.filter((item) => item.inherited !== true); } - if (!this.filterData.showProtected) { + if (!this.args.filterData.showProtected) { items = items.filter((item) => item.access !== 'protected'); } - if (!this.filterData.showPrivate) { + if (!this.args.filterData.showPrivate) { items = items.filter((item) => item.access !== 'private'); } - if (!this.filterData.showDeprecated) { + if (!this.args.filterData.showDeprecated) { items = items.filter((item) => item.deprecated !== true); } @@ -58,7 +50,6 @@ export default class ApiIndexFilter extends Component { return this.filterMultipleInheritance(sortedItems); } - @computed('filteredMethods', 'filteredProperties', 'filteredEvents') get filteredData() { return { methods: this.filteredMethods, @@ -103,8 +94,8 @@ export default class ApiIndexFilter extends Component { * @method findMostLocal */ findMostLocal(currentItem, nextItem) { - let currentScope = this.model.file; - let parentClassScope = this.model.get('parentClass').get('file'); + let currentScope = this.args.model.file; + let parentClassScope = this.args.model.parentClass.get('file'); if (currentScope === currentItem.file) { // if the item belongs to the class, keep it return currentItem; diff --git a/app/components/api-search.gjs b/app/components/api-search.gjs index 63e591c6d..651018d9d 100644 --- a/app/components/api-search.gjs +++ b/app/components/api-search.gjs @@ -8,21 +8,21 @@ import { on } from '@ember/modifier'; import Search from './search'; const SearchResultGroupHeader = ; const SearchResultLinkContents = ; @@ -54,23 +54,23 @@ const SearchResult = class SearchResult extends Component { };