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

Add smoke-tests for types, build, etc #9633

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4774547
Initial attempt at testing an app outside of the monorepo to ensure
NullVoxPopuli Jan 8, 2025
1d9bf03
Don't remove remove the types entries when generating tarballs, they …
NullVoxPopuli Jan 9, 2025
005b68f
Actually test the types of all the packages
NullVoxPopuli Jan 9, 2025
de3aaf3
"publish: stash of uncommitted changes by release script"
NullVoxPopuli Jan 9, 2025
8ecc34e
Integrate with publish infra, to test what actually goes out to npm
NullVoxPopuli Jan 9, 2025
769eae3
Fix
NullVoxPopuli Jan 9, 2025
e49a8b0
don't test beta and stable, as we're not ready for those
NullVoxPopuli Jan 9, 2025
82ad185
Revert changes to generate-tarballs, as we want folks to menually imp…
NullVoxPopuli Jan 9, 2025
94db5c4
Cleanup unused packages
NullVoxPopuli Jan 9, 2025
5baf62d
silly fake ci 'booleans'
NullVoxPopuli Jan 10, 2025
10c241b
A runtime test failed, that's unexpected
NullVoxPopuli Jan 10, 2025
9fd55c8
Reproduction success for: https://github.com/ember-cli/ember-cli/issu…
NullVoxPopuli Jan 10, 2025
560f7db
Proper repro, with the types missing now
NullVoxPopuli Jan 10, 2025
a95541f
Update types
NullVoxPopuli Jan 10, 2025
cb82b58
looks like the type declarations are always wrong?
NullVoxPopuli Jan 10, 2025
f4eb974
Lockfile
NullVoxPopuli Jan 14, 2025
78c6cf5
Fix
NullVoxPopuli Jan 14, 2025
951c4d7
Lol
NullVoxPopuli Jan 14, 2025
56f674b
preferLocal
NullVoxPopuli Jan 14, 2025
bc9a36d
Revert this, probably
NullVoxPopuli Jan 14, 2025
bf40323
Types now pass
NullVoxPopuli Jan 14, 2025
d8f94d8
yay it works
NullVoxPopuli Jan 14, 2025
0fb02f9
Show logs during prepare
NullVoxPopuli Jan 14, 2025
c0d5f55
Prettier
NullVoxPopuli Jan 14, 2025
77d5549
Need to run both glint and glint --build
NullVoxPopuli Jan 14, 2025
993c29c
Update for npm, remove yarn
NullVoxPopuli Jan 14, 2025
d74f76c
Update ci
NullVoxPopuli Jan 14, 2025
e134254
No way
NullVoxPopuli Jan 15, 2025
7567f43
Remove force
NullVoxPopuli Jan 15, 2025
27208ad
Restore .npmrc settings that didn't need to change
NullVoxPopuli Jan 15, 2025
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
30 changes: 30 additions & 0 deletions .github/workflows/compat-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,33 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Basic Tests
run: pnpm test

packageManagers:
name: Smoke test w/ ${{ matrix.packageManager }} & ${{ matrix.kind }}
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
packageManager:
- npm
# - yarn # yarn@1 has not been reliable, if yarn@4 were easy to setup, we could test against that
- pnpm
kind:
- alpha # requires unstable-preview-types folder for each package
# These aren't ready yet, they require additional folders
# - beta # requires preview-types folder for each package
# - stable # requires types folder for each package

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: ./.github/actions/setup
with:
restore-broccoli-cache: true
install: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Run a basic smoke test with ${{ matrix.packageManager }} and ${{ matrix.kind }} tagging"
run: |
bun ./scripts/test-package-manager.mjs \
"${{ matrix.packageManager }}" "${{ matrix.kind}}"


2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# because we have a hoist-pattern. This basically just lets us
# use the very narrowly scoped hoist-pattern.
hoist=true

# Fastboot Doesnt respect node_modules resolution for whitelisted deps
# https://github.com/ember-fastboot/ember-cli-fastboot/issues/901
hoist-pattern[]=*node-fetch*
Expand All @@ -17,7 +18,6 @@ dedupe-peer-dependents=true # this currently introduces more bugs than it fixes
resolve-peers-from-workspace-root=false # if its not declared we don't want it resolved: ensure tests are truly isolated
save-workspace-protocol=rolling
resolution-mode=highest
dedupe-direct-deps=true
child-concurrency=10
ignore-dep-scripts=true
dedupe-injected-deps=false
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"takeoff": "FORCE_COLOR=2 pnpm install --prefer-offline --reporter=append-only",
"prepare": "turbo run build:infra; pnpm --filter './packages/*' run --parallel --if-present sync-hardlinks; turbo run build:pkg; pnpm run prepare:types; pnpm run _task:sync-hardlinks;",
"prepare:types": "tsc --build --force; turbo run build:glint;",
"prepare:types": "tsc --build --force; turbo run build:glint",
"release": "./release/index.ts",
"build": "turbo _build --log-order=stream --filter=./packages/* --concurrency=10;",
"_task:sync-hardlinks": "pnpm run -r --parallel --if-present sync-hardlinks;",
Expand Down
2 changes: 1 addition & 1 deletion packages/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"scripts": {
"_lint": "eslint . --quiet --cache --cache-strategy=content",
"build:glint": "glint --build",
"build:glint": "glint && glint --build",
"build:pkg": "vite build;",
"prepack": "bun run build:pkg",
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
Expand Down
4 changes: 2 additions & 2 deletions packages/request/src/-private/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export class Context {
#owner: ContextOwner;
declare request: ImmutableRequestInfo;
declare id: number;
private declare _isCacheHandler: boolean;
private declare _finalized: boolean;
declare private _isCacheHandler: boolean;
declare private _finalized: boolean;

constructor(owner: ContextOwner, isCacheHandler: boolean) {
this.id = owner.requestId;
Expand Down
6,235 changes: 3,238 additions & 2,997 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions release/core/publish/steps/generate-tarballs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,34 @@ async function convertTypesToModules(pkg: Package, subdir: 'unstable-preview-typ
}
}

function exposeTypes(pkg: Package, subdir: 'unstable-preview-types' | 'preview-types' | 'types') {
if (pkg.pkgData.exports) {
/**
* Allows tsconfig.json#compilerOptions#types to use import paths,
* rather than file paths (there are no file path guarantees for any given package manager)
*/
pkg.pkgData.exports[`./${subdir}`] = {
/**
* No default, import, or require here, because there are no actual modules to import.
*/
types: `./${subdir}/index.d.ts`,
};

/**
* For older tsconfig.json settings
*/
pkg.pkgData.typesVersions = {
// very loose TS version
'*': {
[subdir]: [`./${subdir}`],
},
};
}
}

async function makeTypesAlpha(pkg: Package) {
scrubTypesFromExports(pkg);
exposeTypes(pkg, 'unstable-preview-types');

// enforce that the correct types directory is present
const present = new Set(pkg.pkgData.files);
Expand All @@ -335,6 +361,7 @@ async function makeTypesAlpha(pkg: Package) {

async function makeTypesBeta(pkg: Package) {
scrubTypesFromExports(pkg);
exposeTypes(pkg, 'preview-types');

// enforce that the correct types directory is present
const present = new Set(pkg.pkgData.files);
Expand Down
1 change: 1 addition & 0 deletions release/utils/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type PACKAGEJSON = {
scripts?: Record<string, string>;
files?: string[];
exports?: ExportConfig;
typesVersions?: { [tsVersion: string]: { [relativeImportPath: string]: string[] } };
'ember-addon'?: {
main?: 'addon-main.js';
type?: 'addon';
Expand Down
Loading
Loading