-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smoke-tests for types, build, etc (#9633)
* Correctly configure package.json#exports for use with tsconfig.json#compilerOptions#types Fix: #9630 Fix: ember-cli/ember-cli#10611 Related: - ember-cli/ember-cli#10613 Unblocks: - ember-cli/ember-cli#10612 * Fix lints by removing eslint cache * Smoke Tests: dt-types pass * Smoke: native-types pass * ope * Revert changes to vite-basic-compat * lockfile * Revert npmrc * revert pnpm-lock * Smoke tests don't need their own lint config * Use correct script name * Remove added files to vite-basic-compat * Prettier * Revert misguided lint-induced changes
- Loading branch information
1 parent
1110717
commit 3a720ae
Showing
23 changed files
with
848 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
packages/ | ||
node_modules/ | ||
tmp/ | ||
dist/ | ||
pnpm-lock.yaml | ||
package-lock.json | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
These packages should not be added to the pnpm-workspace.yaml file. | ||
|
||
These are for smoke-tests and ensuring that ember-data/warp-drive's outputs work in real projects. | ||
|
||
## Running the Smoke Tests | ||
|
||
From the monorepo root: | ||
```bash | ||
bun ./tests/smoke-tests/run.ts dt-types pnpm | ||
# or | ||
bun ./tests/smoke-tests/run.ts native-types pnpm | ||
``` | ||
|
||
This will take a while to build everything. | ||
Once things are built, however, you may: | ||
```bash | ||
bun ./tests/smoke-tests/run.ts dt-types pnpm --reuse-tars | ||
bun ./tests/smoke-tests/run.ts native-types pnpm --reuse-tars | ||
``` | ||
|
||
Tars only need to be built once, and then they can be shared with all the smoke-tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
/** | ||
* These tests are more fro the out-of-monorepo tests, | ||
* as we'll sever the references links to the source of each of these packages | ||
* | ||
* Just need to make sure each module has types at publish. | ||
*/ | ||
import { expectTypeOf } from 'expect-type'; | ||
import StoreX from 'ember-data/store'; | ||
import DS from 'ember-data'; | ||
|
||
// @ts-expect-error this exists in the real package, but not DT Types | ||
import Adapter from '@ember-data/adapter/-private/build-url-mixin'; | ||
|
||
expectTypeOf<typeof StoreX>().not.toBeAny(); | ||
|
||
import Store from '@ember-data/store'; | ||
// @ts-expect-error this exists in the real package, but not DT Types | ||
import RequestManager from '@ember-data/request'; | ||
import { BuildURLMixin } from '@ember-data/adapter'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
import jsonapi from '@ember-data/json-api'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
import { adapterFor } from '@ember-data/legacy-compat'; | ||
import Model from '@ember-data/model'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
import { setBuildURLConfig } from '@ember-data/request-utils'; | ||
import Serializer from '@ember-data/serializer'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
import { createCache } from '@ember-data/tracking'; | ||
|
||
// Most of this is to assure thet above imports don't get optimized away | ||
expectTypeOf<typeof DS>().not.toBeAny(); | ||
expectTypeOf<typeof import('ember-data')>().not.toBeAny(); | ||
expectTypeOf<typeof Store>().not.toBeAny(); | ||
expectTypeOf<typeof Model>().not.toBeAny(); | ||
expectTypeOf<typeof Model>().toHaveProperty('reopen'); | ||
expectTypeOf<typeof Serializer>().not.toBeAny(); | ||
// @ts-expect-error no DT Types | ||
expectTypeOf<typeof RequestManager>().not.toBeAny(); | ||
expectTypeOf<typeof BuildURLMixin>().not.toBeAny(); | ||
// @ts-expect-error no DT Types | ||
expectTypeOf<typeof jsonapi>().not.toBeAny(); | ||
// @ts-expect-error no DT Types | ||
expectTypeOf<typeof createCache>().not.toBeAny(); | ||
// @ts-expect-error no DT Types | ||
expectTypeOf<typeof setBuildURLConfig>().not.toBeAny(); | ||
// @ts-expect-error no DT Types | ||
expectTypeOf<typeof adapterFor>().not.toBeAny(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{ | ||
"name": "@ember-data/smoke-tests-dt-types", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "Small description for vite-basic-compat goes here", | ||
"repository": "", | ||
"license": "MIT", | ||
"author": "", | ||
"directories": { | ||
"doc": "doc", | ||
"test": "tests" | ||
}, | ||
"scripts": { | ||
"test": "pnpm tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.5", | ||
"@babel/eslint-parser": "^7.25.9", | ||
"@babel/plugin-transform-runtime": "^7.25.9", | ||
"@babel/plugin-transform-typescript": "^7.25.9", | ||
"@babel/runtime": "^7.26.0", | ||
"ember-data": "file:./packages/ember-data.tgz", | ||
"@ember-data/adapter": "file:./packages/ember-data-adapter.tgz", | ||
"@ember-data/debug": "file:./packages/ember-data-debug.tgz", | ||
"@ember-data/graph": "file:./packages/ember-data-graph.tgz", | ||
"@ember-data/json-api": "file:./packages/ember-data-json-api.tgz", | ||
"@ember-data/legacy-compat": "file:./packages/ember-data-legacy-compat.tgz", | ||
"@ember-data/model": "file:./packages/ember-data-model.tgz", | ||
"@ember-data/request": "file:./packages/ember-data-request.tgz", | ||
"@ember-data/request-utils": "file:./packages/ember-data-request-utils.tgz", | ||
"@ember-data/rest": "file:./packages/ember-data-rest.tgz", | ||
"@ember-data/serializer": "file:./packages/ember-data-serializer.tgz", | ||
"@ember-data/store": "file:./packages/ember-data-store.tgz", | ||
"@ember-data/tracking": "file:./packages/ember-data-tracking.tgz", | ||
"@warp-drive/build-config": "file:./packages/warp-drive-build-config.tgz", | ||
"@warp-drive/core-types": "file:./packages/warp-drive-core-types.tgz", | ||
"@types/ember": "^4.0.8", | ||
"@types/ember-data": "^4.4.13", | ||
"@types/ember-data__adapter": "^4.0.4", | ||
"@types/ember-data__model": "^4.0.3", | ||
"@types/ember-data__serializer": "^4.0.4", | ||
"@types/ember-data__store": "^4.0.5", | ||
"@types/ember__application": "^4.0.9", | ||
"@types/ember__array": "^4.0.7", | ||
"@types/ember__component": "^4.0.19", | ||
"@types/ember__controller": "^4.0.9", | ||
"@types/ember__debug": "^4.0.6", | ||
"@types/ember__destroyable": "^4.0.3", | ||
"@types/ember__engine": "^4.0.8", | ||
"@types/ember__error": "^4.0.4", | ||
"@types/ember__helper": "^4.0.4", | ||
"@types/ember__modifier": "^4.0.7", | ||
"@types/ember__object": "^4.0.9", | ||
"@types/ember__owner": "^4.0.7", | ||
"@types/ember__polyfills": "^4.0.4", | ||
"@types/ember__routing": "^4.0.17", | ||
"@types/ember__runloop": "^4.0.7", | ||
"@types/ember__service": "^4.0.6", | ||
"@types/ember__string": "^3.16.3", | ||
"@types/ember__template": "^4.0.4", | ||
"@types/ember__test": "^4.0.4", | ||
"@types/ember__utils": "^4.0.5", | ||
"@ember/optional-features": "^2.1.0", | ||
"@ember/string": "^4.0.0", | ||
"@ember/test-helpers": "^4.0.4", | ||
"@ember/test-waiters": "^3.1.0", | ||
"@embroider/compat": "3.7.1-unstable.4070ba7", | ||
"@embroider/config-meta-loader": "0.0.1-unstable.4070ba7", | ||
"@embroider/core": "3.4.20-unstable.4070ba7", | ||
"@embroider/test-setup": "4.0.1-unstable.4070ba7", | ||
"@embroider/vite": "0.2.2-unstable.4070ba7", | ||
"@glimmer/component": "^1.1.2", | ||
"@glimmer/tracking": "^1.1.2", | ||
"@glint/core": "1.5.0", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@tsconfig/ember": "^3.0.8", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/qunit": "2.19.10", | ||
"@types/rsvp": "^4.0.9", | ||
"@typescript-eslint/eslint-plugin": "^8.14.0", | ||
"@typescript-eslint/parser": "^8.14.0", | ||
"babel-plugin-ember-template-compilation": "^2.3.0", | ||
"concurrently": "^9.1.0", | ||
"decorator-transforms": "^2.3.0", | ||
"ember-auto-import": "^2.8.1", | ||
"ember-cli": "~5.12.0", | ||
"ember-cli-babel": "^8.2.0", | ||
"ember-cli-htmlbars": "^6.3.0", | ||
"ember-load-initializers": "^3.0.1", | ||
"ember-modifier": "^4.2.0", | ||
"ember-page-title": "^8.2.3", | ||
"ember-qunit": "9.0.1", | ||
"ember-resolver": "^13.1.0", | ||
"ember-route-template": "^1.0.3", | ||
"ember-source": "~5.12.0", | ||
"ember-template-lint": "^6.0.0", | ||
"ember-welcome-page": "^7.0.2", | ||
"eslint": "^9.14.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-ember": "^12.3.1", | ||
"eslint-plugin-n": "^17.13.1", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"eslint-plugin-qunit": "^8.1.2", | ||
"expect-type": "^0.20.0", | ||
"globals": "^15.12.0", | ||
"loader.js": "^4.7.0", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-ember-template-tag": "^2.0.4", | ||
"qunit": "^2.22.0", | ||
"qunit-dom": "^3.3.0", | ||
"tracked-built-ins": "^3.3.0", | ||
"typescript": "^5.7.2", | ||
"typescript-eslint": "^8.13.0", | ||
"vite": "^5.4.11", | ||
"webpack": "^5.95.0" | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
}, | ||
"ember": { | ||
"edition": "octane" | ||
}, | ||
"ember-addon": { | ||
"type": "app", | ||
"version": 2 | ||
}, | ||
"exports": { | ||
"./tests/*": "./tests/*", | ||
"./*": "./app/*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"include": ["app/**/*", "config/**/*", "tests/**/*"], | ||
"glint": { "environment": [] }, | ||
"compilerOptions": { | ||
"lib": ["DOM", "ESNext"], | ||
"module": "esnext", | ||
"target": "esnext", | ||
"moduleResolution": "bundler", | ||
"moduleDetection": "force", | ||
"strict": true, | ||
"pretty": true, | ||
"exactOptionalPropertyTypes": false, | ||
"downlevelIteration": true, | ||
"skipLibCheck": true, | ||
"allowSyntheticDefaultImports": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"allowJs": true, | ||
"baseUrl": ".", | ||
"noImplicitOverride": false, | ||
"experimentalDecorators": true, | ||
"incremental": true, | ||
"noEmit": true, | ||
"declaration": false, | ||
"types": ["@embroider/core/virtual"], | ||
"paths": { | ||
"vite-basic-compat/*": ["./app/*"], | ||
"vite-basic-compat/tests/*": ["./tess/*"], | ||
"*": ["./types/*"] | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
tests/smoke-tests/dt-types/types/ember-data/types/registries/model.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Catch-all for ember-data. | ||
*/ | ||
export default interface ModelRegistry { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
[key: string]: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="@embroider/core/virtual" /> |
Oops, something went wrong.