Skip to content

Commit

Permalink
Sync with addon blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeAstapov committed Nov 15, 2024
1 parent 8311af1 commit ec5c015
Show file tree
Hide file tree
Showing 23 changed files with 2,072 additions and 391 deletions.
24 changes: 0 additions & 24 deletions .eslintignore

This file was deleted.

44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

14 changes: 1 addition & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/
/declarations/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
6 changes: 6 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
};
2 changes: 1 addition & 1 deletion .prettierrc.js → .template-lintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
extends: 'recommended',
};
6 changes: 0 additions & 6 deletions .template-lintrc.js

This file was deleted.

File renamed without changes.
11 changes: 11 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": [
["@babel/plugin-transform-typescript", { "allExtensions": true, "onlyRemoveTypeImports": true, "allowDeclareFields": true }],
"@embroider/addon-dev/template-colocation-plugin",
["babel-plugin-ember-template-compilation", {
"targetFormat": "hbs",
"transforms": []
}],
["module:decorator-transforms", { "runtime": { "import": "decorator-transforms/runtime" } }]
]
}
142 changes: 142 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/**
* Debugging:
* https://eslint.org/docs/latest/use/configure/debug
* ----------------------------------------------------
*
* Print a file's calculated configuration
*
* npx eslint --print-config path/to/file.js
*
* Inspecting the config
*
* npx eslint --inspect-config
*
*/
import globals from 'globals';
import js from '@eslint/js';

import ts from 'typescript-eslint';

import ember from 'eslint-plugin-ember/recommended';

import prettier from 'eslint-plugin-prettier/recommended';
import qunit from 'eslint-plugin-qunit';
import n from 'eslint-plugin-n';

import babelParser from '@babel/eslint-parser';

const parserOptions = {
esm: {
js: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
root: import.meta.dirname,
},
},
ts: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
};

export default ts.config(
js.configs.recommended,
ember.configs.base,
ember.configs.gjs,
ember.configs.gts,
prettier,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: [
'dist/',
'node_modules/',
'coverage/',
'!**/.*',
'vendor/pikaday.js',
],
},
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
*/
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
{
files: ['**/*.js'],
languageOptions: {
parser: babelParser,
},
},
{
files: ['**/*.{js,gjs}'],
languageOptions: {
parserOptions: parserOptions.esm.js,
globals: {
...globals.browser,
},
},
},
{
files: ['**/*.{ts,gts}'],
languageOptions: {
parser: ember.parser,
parserOptions: parserOptions.esm.ts,
},
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
},
{
files: ['test-app/tests/**/*-test.{js,gjs,ts,gts}'],
plugins: {
qunit,
},
},
/**
* CJS node files
*/
{
files: [
'**/*.cjs',
'test-app/config/**/*.js',
'test-app/ember-cli-build.js',
'test-app/scenarios.js',
'test-app/testem.js',
],
plugins: {
n,
},

languageOptions: {
sourceType: 'script',
ecmaVersion: 'latest',
globals: {
...globals.node,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
plugins: {
n,
},

languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: parserOptions.esm.js,
globals: {
...globals.node,
},
},
},
);
55 changes: 33 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,47 @@
],
"scripts": {
"clean": "rm -rf dist node_modules test-app/node_modules",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"prepare": "npm-run-all prepublishOnly",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"prepare": "rollup --config",
"prepublishOnly": "rollup --config",
"scenario:list": "scenario-tester list --files test-app/scenarios.js",
"scenario:output": "scenario-tester output --files test-app/scenarios.js --outdir scenario --scenario ",
"scenario:run": "cd test-app && qunit scenarios.js --filter ",
"start": "npm-run-all --parallel start:*",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:build": "rollup --config --watch",
"start:test-app": "cd test-app && ember serve",
"test": "npm-run-all lint:* test:*",
"test": "concurrently 'pnpm:lint:*(!fix)' 'pnpm:test:*'",
"test:ember": "cd test-app && ember test",
"test:ember-compatibility": "cd test-app && pnpm qunit scenarios.js"
},
"dependencies": {
"@embroider/addon-shim": "^1.8.7",
"@embroider/addon-shim": "^1.9.0",
"decorator-transforms": "^2.3.0",
"ember-modifier": "^3.2.7 || ^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-typescript": "^7.25.9",
"@babel/eslint-parser": "^7.25.9",
"@babel/plugin-proposal-decorators": "^7.25.9",
"@babel/runtime": "^7.26.0",
"@ember/test-helpers": "^2.9.4",
"@embroider/addon-dev": "^7.0.0",
"@embroider/compat": "npm:@embroider/compat@latest",
"@embroider/core": "npm:@embroider/core@latest",
"@embroider/test-setup": "npm:@embroider/test-setup@latest",
"@embroider/webpack": "npm:@embroider/webpack@latest",
"@eslint/js": "^9.14.0",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"@rollup/plugin-babel": "^5.3.0",
"babel-eslint": "^10.1.0",
"@rollup/plugin-babel": "^6.0.4",
"babel-plugin-ember-template-compilation": "^2.3.0",
"concurrently": "^9.1.0",
"ember-cli": "~3.28.6",
"ember-cli-beta": "npm:ember-cli@beta",
"ember-cli-latest": "npm:ember-cli@latest",
Expand All @@ -71,25 +79,28 @@
"ember-source-beta": "npm:ember-source@beta",
"ember-source-canary": "npm:ember-source@alpha",
"ember-source-latest": "npm:ember-source@latest",
"ember-source-lts-4.12": "npm:ember-source@~4.12",
"ember-source-lts-4.4": "npm:ember-source@~4.4",
"ember-source-lts-4.8": "npm:ember-source@~4.8",
"ember-source-lts-4.12": "npm:ember-source@~4.12",
"ember-source-lts-5.12": "npm:ember-source@~5.12",
"ember-source-lts-5.4": "npm:ember-source@~5.4",
"ember-source-lts-5.8": "npm:ember-source@~5.8",
"ember-source-lts-5.12": "npm:ember-source@~5.12",
"ember-template-lint": "^3.15.0",
"ember-template-lint": "^6.0.0",
"ember-test-helpers-4": "npm:@ember/test-helpers@^4.0.4",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-qunit": "^6.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.3.1",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-n": "^17.13.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-qunit": "^8.1.2",
"globals": "^15.12.0",
"prettier": "^3.3.3",
"prettier-plugin-ember-template-tag": "^2.0.4",
"release-plan": "^0.10.0",
"rollup": "^4.22.4",
"scenario-tester": "^3.1.0"
"scenario-tester": "^3.1.0",
"typescript-eslint": "^8.14.0"
},
"peerDependencies": {
"@ember/test-helpers": ">=2.0.0",
Expand All @@ -115,7 +126,7 @@
"ember-addon": {
"version": 2,
"type": "addon",
"main": "addon-main.js",
"main": "addon-main.cjs",
"app-js": {
"./components/pikaday-input.js": "./dist/_app_/components/pikaday-input.js",
"./components/pikaday-inputless.js": "./dist/_app_/components/pikaday-inputless.js",
Expand Down
Loading

0 comments on commit ec5c015

Please sign in to comment.