Skip to content

Commit

Permalink
Merge pull request #1471 from emberjs/the-v2-addon-conversion
Browse files Browse the repository at this point in the history
V2 Addon Conversion
  • Loading branch information
NullVoxPopuli authored Aug 20, 2024
2 parents 152f254 + c25dacf commit 381c22c
Show file tree
Hide file tree
Showing 85 changed files with 3,425 additions and 8,224 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ jobs:
- name: Build addon
working-directory: addon
run: pnpm build
- run: pnpm i -f # sync injected dependencies
- run: pnpm test
working-directory: test-app
- name: own types
working-directory: addon
run: pnpm tsc --noEmit

docs-gen:
timeout-minutes: 5
Expand Down Expand Up @@ -83,13 +79,9 @@ jobs:
- name: Build addon
working-directory: addon
run: pnpm build
- run: pnpm i -f # sync injected dependencies
- name: Run Tests
working-directory: test-app
run: pnpm test
- name: own types
working-directory: addon
run: pnpm tsc --noEmit

try-scenarios:
timeout-minutes: 10
Expand Down Expand Up @@ -126,13 +118,9 @@ jobs:
- name: Build addon
working-directory: addon
run: pnpm build
- run: pnpm i -f # sync injected dependencies
- name: test
working-directory: test-app
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
- name: types compatibility
working-directory: addon
run: pnpm lint:ts

types:
runs-on: ubuntu-latest
Expand Down
15 changes: 0 additions & 15 deletions addon/.ember-cli

This file was deleted.

22 changes: 1 addition & 21 deletions addon/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,29 +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
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

addon-test-support/**/*.js
addon-test-support/**/*.d.ts
public-types
117 changes: 117 additions & 0 deletions addon/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
'use strict';

module.exports = {
root: true,
// Only use overrides
// https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs
overrides: [
{
files: ['**/*.js', '**/*.ts'],
env: { browser: true },
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
},
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// ts files
{
files: ['**/*.ts'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// We break a lot of rules with types
// (public types do not always exist for the things we need to import)
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
// We access the _routerMicrolib
// and router:main
'ember/no-private-routing-service': 'off',
// This library must violate this rule so that consumers
// can have some additional protections for working _with_ this rule.
'ember/no-ember-testing-in-module-scope': 'off',
// Used in `setupRenderingContext` to hook in to "appendTo"
// on the -top-level-view:main
'ember/no-runloop': 'off',
// For accessing container_proxy and registry_proxy
'ember/no-mixins': 'off',
// We violate this for making the owner in build-registry.
'ember/no-classic-classes': 'off',
},
},
{
files: ['**/*.gts'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gts',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
{
files: ['**/*.gjs'],
parser: 'ember-eslint-parser',
plugins: ['ember', 'import'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gjs',
'plugin:prettier/recommended',
],
rules: {
// require relative imports use full extensions
'import/extensions': ['error', 'always', { ignorePackages: true }],
// Add any custom rules here
},
},
// node files
{
files: [
'./.eslintrc.cjs',
'./.prettierrc.cjs',
'./.template-lintrc.cjs',
'./addon-main.cjs',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['n'],
extends: [
'eslint:recommended',
'plugin:n/recommended',
'plugin:prettier/recommended',
],
},
],
};
88 changes: 0 additions & 88 deletions addon/.eslintrc.js

This file was deleted.

22 changes: 16 additions & 6 deletions addon/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# tyescript related output files
addon-test-support/**/*.js
addon-test-support/**/*.d.ts
dist-types
# The authoritative copies of these live in the monorepo root (because they're
# more useful on github that way), but the build copies them into here so they
# will also appear in published NPM packages.
/README.md
/LICENSE.md

# Other build artifacts
README.md
# compiled output
dist/
declarations/

# npm/pnpm/yarn pack output
*.tgz

# deps & caches
node_modules/
.eslintcache
.prettiercache
51 changes: 0 additions & 51 deletions addon/.npmignore

This file was deleted.

20 changes: 1 addition & 19 deletions addon/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,27 +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
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

addon-test-support/**/*.js
addon-test-support/**/*.d.ts
File renamed without changes.
Loading

0 comments on commit 381c22c

Please sign in to comment.