Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add back toc names for inspector #241

Merged
merged 12 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
'tests/dummy/config/**/*.js',
'lib/**/*.js',
'src/**/*.js',
'tests-babel/**/*.js',
],
excludedFiles: [
'addon/**',
Expand All @@ -56,6 +57,12 @@ module.exports = {
plugins: ['n'],
extends: ['plugin:n/recommended'],
},
{
files: ['tests-babel/**/*.js'],
parserOptions: {
sourceType: 'module',
},
},
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
Expand Down
19 changes: 19 additions & 0 deletions ember-addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ let VersionChecker = require('ember-cli-version-checker');
module.exports = {
name: require('./package').name,

_getBabelOptions() {
const parentOptions = this.parent && this.parent.options;
const appOptions = this.app && this.app.options;
const addonOptions = parentOptions || appOptions || {};

addonOptions.babel = addonOptions.babel || {};
addonOptions.babel.plugins = addonOptions.babel.plugins || [];
return addonOptions.babel;
},

addBabelPlugin() {
this._getBabelOptions().plugins.push([
require.resolve('./src/babel-plugin.js'),
{ v: 1, root: this.project.root },
]);
},

included() {
this._super.included.apply(this, arguments);

Expand Down Expand Up @@ -33,6 +50,8 @@ module.exports = {
'ember-template-imports requires' + '\n\t' + errors.join('\n\t'),
);
}

this.addBabelPlugin();
},

setupPreprocessorRegistry(type, registry) {
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"start": "ember serve",
"test": "npm-run-all lint test:*",
"test:ember": "ember test",
"test:babel": "vitest --run",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
Expand All @@ -33,6 +34,7 @@
"devDependencies": {
"@babel/core": "^7.22.20",
"@babel/eslint-parser": "^7.22.15",
"@babel/plugin-proposal-decorators": "^7.24.7",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "^3.2.0",
Expand All @@ -43,6 +45,7 @@
"@release-it-plugins/lerna-changelog": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"babel-plugin-ember-template-compilation": "^2.2.5",
"ember-auto-import": "^2.6.3",
"ember-cli": "~4.12.2",
"ember-cli-babel": "^8.2.0",
Expand All @@ -68,6 +71,7 @@
"qunit-dom": "^3.0.0",
"release-it": "^16.2.1",
"typescript": "^4.9.5",
"vitest": "^2.0.2",
"webpack": "^5.64.4"
},
"engines": {
Expand Down
Loading
Loading