Skip to content

Commit

Permalink
Updated project dependencies (#214)
Browse files Browse the repository at this point in the history
* chore: Updated dependencies

* chore: Added lockfile

* refactor: Created shared configurations

* chore: Fixed linting errors

* chore: Standardized scripts

---------

Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
  • Loading branch information
ijlee2 and ijlee2 authored Nov 7, 2023
1 parent 0eee35b commit 1f1556b
Show file tree
Hide file tree
Showing 63 changed files with 2,004 additions and 1,605 deletions.
17 changes: 12 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ Here are some guidelines to help you and everyone else.
## Local development

<details>

<summary>Install dependencies</summary>

1. Fork and clone this repo.

```sh
git clone git@github.com:<your GitHub handle>/ember-container-query.git
git clone git@github.com:<your-github-handle>/ember-container-query.git
```

1. Change directory.
Expand Down Expand Up @@ -47,6 +48,7 @@ Here are some guidelines to help you and everyone else.


<details>

<summary>Lint files</summary>

1. When you write code, please check that it meets the linting rules.
Expand All @@ -67,6 +69,7 @@ Here are some guidelines to help you and everyone else.


<details>

<summary>Run tests</summary>

1. When you write code, please check that all tests continue to pass.
Expand All @@ -85,20 +88,20 @@ Here are some guidelines to help you and everyone else.

1. Generate a [personal access token](https://github.com/settings/tokens/) in GitHub, with default values for scopes (none selected).

1. Create a pull request, in which you update the package version and `CHANGELOG`.
1. Run the `release:changelog` script. This generates a text that you can add to `CHANGELOG.md`.

```sh
# From the workspace root
GITHUB_AUTH=<YOUR_PERSONAL_ACCESS_TOKEN> pnpm changelog
GITHUB_AUTH=<YOUR_PERSONAL_ACCESS_TOKEN> pnpm release:changelog
```

1. [Create a tag](https://github.com/ijlee2/ember-container-query/releases/new) such as `1.0.0` (the name satisfies the regular expression `^\d+\.\d+\.\d+`).
1. [Create a tag](https://github.com/ijlee2/ember-container-query/releases/new) and provide release notes. The tag name should match the package version.

1. Publish the package.

```sh
# From the workspace root
pnpm publish -r
pnpm release:publish
```

</details>
Expand All @@ -112,6 +115,7 @@ Here are some suggestions to help you start:


<details>

<summary>Give feedback 💞</summary>

1. An open source project's value comes from people using the code and extending it to make greater things. Let me know how you use container queries in your Ember app or addon!
Expand All @@ -125,6 +129,7 @@ Here are some suggestions to help you start:


<details>

<summary>Help with marketing 📢</summary>

1. Platforms include:
Expand All @@ -139,6 +144,7 @@ Here are some suggestions to help you start:


<details>

<summary>Join this project 👩‍💻👨‍💻</summary>

1. Help me maintain the project! I have limited time and there is much that I don't know.
Expand All @@ -152,6 +158,7 @@ Here are some suggestions to help you start:
<details>
<summary>Make issues 📝</summary>
1. In addition to sharing feedback (described in `Give feedback`), you can create an issue to:
Expand Down
3 changes: 3 additions & 0 deletions configs/ember-template-lint/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('@shared-configs/prettier');
20 changes: 20 additions & 0 deletions configs/ember-template-lint/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

module.exports = {
plugins: ['ember-template-lint-plugin-prettier'],
extends: ['recommended', 'ember-template-lint-plugin-prettier:recommended'],
overrides: [
{
files: ['**/*.{gjs,gts}'],
rules: {
'no-implicit-this': 'off',
},
},
{
files: ['tests/**/*-test.{js,ts}'],
rules: {
prettier: 'off',
},
},
],
};
37 changes: 37 additions & 0 deletions configs/ember-template-lint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@shared-configs/ember-template-lint",
"version": "0.0.0",
"private": true,
"description": "Configuration for ember-template-lint",
"repository": {
"type": "git",
"url": "https://github.com/ijlee2/ember-container-query.git"
},
"author": "Isaac J. Lee",
"main": ".template-lintrc.js",
"scripts": {
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:js": "prettier --check \"**/*.js\"",
"lint:js:fix": "prettier --write \"**/*.js\""
},
"dependencies": {
"ember-template-lint-plugin-prettier": "^5.0.0"
},
"devDependencies": {
"@shared-configs/prettier": "workspace:*",
"concurrently": "^8.2.2",
"prettier": "^3.0.3"
},
"peerDependencies": {
"ember-template-lint": "^5.12.0"
},
"peerDependenciesMeta": {
"ember-template-lint": {
"optional": false
}
},
"engines": {
"node": "18.* || >= 20"
}
}
7 changes: 7 additions & 0 deletions configs/eslint/ember/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

require('@shared-configs/eslint-config-node/patch');

module.exports = {
extends: ['@shared-configs/eslint-config-node/javascript'],
};
3 changes: 3 additions & 0 deletions configs/eslint/ember/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('@shared-configs/prettier');
108 changes: 108 additions & 0 deletions configs/eslint/ember/addon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
'use strict';

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'ember',
'@typescript-eslint',
'simple-import-sort',
'typescript-sort-keys',
],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
'plugin:typescript-sort-keys/recommended',
],
env: {
browser: true,
},
rules: {
curly: 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
settings: {
'import/resolver': {
node: {
extensions: ['.gjs', '.gts', '.js', '.ts'],
},
typescript: true,
},
},
overrides: [
// TypeScript files
{
files: ['**/*.{gts,ts}'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
// TypeScript and JavaScript files
{
files: ['**/*.{gjs,gts,js,ts}'],
rules: {
'import/no-duplicates': 'error',
'import/no-unresolved': 'off',
},
},
// Node files (v1 addon)
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
// Node files (v2 addon)
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./addon-main.cjs',
'./blueprints/*/index.js',
'./rollup.config.mjs',
],
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
// Test files
{
files: ['tests/**/*-test.{gjs,gts,js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
92 changes: 92 additions & 0 deletions configs/eslint/ember/app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
'use strict';

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'ember',
'@typescript-eslint',
'simple-import-sort',
'typescript-sort-keys',
],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
'plugin:typescript-sort-keys/recommended',
],
env: {
browser: true,
},
rules: {
curly: 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
settings: {
'import/resolver': {
node: {
extensions: ['.gjs', '.gts', '.js', '.ts'],
},
typescript: true,
},
},
overrides: [
// TypeScript files
{
files: ['**/*.{gts,ts}'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
// TypeScript and JavaScript files
{
files: ['**/*.{gjs,gts,js,ts}'],
rules: {
'import/no-duplicates': 'error',
'import/no-unresolved': 'off',
},
},
// Node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./postcss.config.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
// Test files
{
files: ['tests/**/*-test.{gjs,gts,js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
Loading

0 comments on commit 1f1556b

Please sign in to comment.