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

Use built in types from ember-source instead of the types-packages #118

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
17 changes: 0 additions & 17 deletions .github/actions/pnpm/action.yml

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
name: Lint JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: wyvox/action@v1
- name: ESLint
run: pnpm lint

Expand All @@ -27,8 +26,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: wyvox/action@v1
- run: pnpm tsc --noEmit
working-directory: tests

Expand Down Expand Up @@ -62,8 +60,7 @@ jobs:
- monorepo with yarn
- monorepo with pnpm
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: pnpm add --global ember-cli yarn
- uses: wyvox/action@v1
- run: pnpm add --global ember-cli@beta yarn
- run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"
working-directory: tests
8 changes: 8 additions & 0 deletions files/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Docs: https://pnpm.io/npmrc
# https://github.com/emberjs/rfcs/pull/907

# we don't want addons to be bad citizens of the ecosystem
auto-install-peers=false

# we want true isolation, if a dependency is not declared, we want an error
resolve-peers-from-workspace-root=false
23 changes: 6 additions & 17 deletions files/__addonLocation__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"prepack": "rollup --config"
},
"peerDependencies": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

highly likely a v2 addon will want a peer on ember-source

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, especially since the v1 blueprint also has this, but I remember this comment by @ef4 🤔

the main reason people are forced to add it is if they want to say dependencySatisfies('ember-source', ...).

but this is the case quite often, often implicitly by others doing this, e.g. see ember-polyfills/ember-cached-decorator-polyfill#212

So I'm 👍, but just wanted to make sure...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm that's a good point. I'll hopefully remember to bring this up in tomorrows meeting.

"ember-source": "^3.28.0 || ^4.0.0 || >= 5.0.0"
},
"dependencies": {
"@embroider/addon-shim": "^1.0.0"
},
Expand All @@ -33,33 +36,19 @@
<% if (typescript) { %>"@babel/preset-typescript": "^7.18.6"<% } else { %>"@babel/eslint-parser": "^7.19.1"<% } %>,
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.20.13",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will go away with this PR: #136

"@babel/runtime": "^7.17.0",
"@embroider/addon-dev": "^3.0.0",<% if (typescript) { %>
"@glimmer/component": "^1.1.2",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required by glint

"@glint/core": "^1.0.2",
"@glint/environment-ember-loose": "^1.0.2",
"@glint/template": "^1.0.2",
"@tsconfig/ember": "^2.0.0",
"@types/ember": "^4.0.0",
"@types/ember__object": "^4.0.0",
"@types/ember__service": "^4.0.0",
"@types/ember__controller": "^4.0.0",
"@types/ember__string": "^3.16.0",
"@types/ember__template": "^4.0.0",
"@types/ember__polyfills": "^4.0.0",
"@types/ember__utils": "^4.0.0",
"@types/ember__runloop": "^4.0.0",
"@types/ember__debug": "^4.0.0",
"@types/ember__engine": "^4.0.0",
"@types/ember__application": "^4.0.0",
"@types/ember__test": "^4.0.0",
"@types/ember__array": "^4.0.0",
"@types/ember__error": "^4.0.0",
"@types/ember__component": "^4.0.0",
"@types/ember__routing": "^4.0.0",
NullVoxPopuli marked this conversation as resolved.
Show resolved Hide resolved
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",<% } else { %>
"@rollup/plugin-babel": "^6.0.3",<% } %>
"concurrently": "^8.0.1",
"ember-source": "^5.1.2",
"ember-template-lint": "^5.7.3",
"eslint": "^8.33.0",
"eslint-config-prettier": "^8.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Add any types here that you need for local development only.
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!

import 'ember-source/types';

import '@glint/environment-ember-loose';

declare module '@glint/environment-ember-loose/registry' {
Expand Down
11 changes: 7 additions & 4 deletions files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
"concurrently": "^7.2.1",
"prettier": "^2.5.1"
},
"workspaces": [
"<%= addonInfo.location %>",
"<%= testAppInfo.location %>"
]
"workspaces": {
"nohoist": ["**/ember-source", "ember-source", "@types/*", "**/@types/*"],
"packages": [
"<%= addonInfo.location %>",
"<%= testAppInfo.location %>"
]
}
}
4 changes: 2 additions & 2 deletions files/test-app-overrides/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ module.exports = async function () {
},
},
{
name: 'ember-lts-4.4',
name: 'ember-lts-4.12',
npm: {
devDependencies: {
'ember-source': '~4.4.0',
'ember-source': '~4.12.0',
},
},
},
Expand Down
Loading
Loading