Skip to content

Commit

Permalink
Use built in types from ember-source instead of the types-packages
Browse files Browse the repository at this point in the history
In order to have effective use of the built in types, ember-source needs to be around 4.12, however, that's *just for development*, and actual runtime usage can be much wider

Add npmrc per pnpm RFC updates
  • Loading branch information
NullVoxPopuli committed Jul 3, 2023
1 parent 3c7d677 commit 7a86220
Show file tree
Hide file tree
Showing 10 changed files with 1,939 additions and 1,801 deletions.
17 changes: 0 additions & 17 deletions .github/actions/pnpm/action.yml

This file was deleted.

9 changes: 3 additions & 6 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
- uses: wyvox/action@v1
- run: pnpm add --global ember-cli 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
22 changes: 5 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": {
"ember-source": "^3.28.0 || ^4.0.0 || ^5.0.0"
},
"dependencies": {
"@embroider/addon-shim": "^1.0.0"
},
Expand All @@ -35,31 +38,16 @@
"@babel/plugin-proposal-decorators": "^7.20.13",
"@babel/runtime": "^7.17.0",
"@embroider/addon-dev": "^3.0.0",<% if (typescript) { %>
"@glimmer/component": "^1.1.2",
"@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",
"@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.0.0",
"ember-template-lint": "^5.7.3",
"eslint": "^8.33.0",
"eslint-config-prettier": "^8.3.0",
Expand Down
3 changes: 3 additions & 0 deletions files/__addonLocation__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"src/**/*",
"unpublished-development-types/**/*"
],
"compilerOptions": {
"skipLibCheck": true
},
"glint": {
"environment": "ember-loose"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// 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 "ember-source/types/preview";

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

0 comments on commit 7a86220

Please sign in to comment.