Skip to content

Commit 14c7b0f

Browse files
Merge pull request #843 from typed-ember/nvp/more-core-tests-to-own-package
Move core tests out of core package due to tests depending on packages that depend on core
2 parents 040c338 + 21c57b0 commit 14c7b0f

27 files changed

+150
-47
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dist/
1919
!/packages/environment*/-private/intrinsics/**/*.d.ts
2020

2121
packages/core/__tests__/support/character-position-viewer.html
22+
test-packages/*/__tests__/support/*.html
2223

2324
/packages/vscode/src/generated-meta.ts
2425

packages/core/__tests__/tsconfig.json

-8
This file was deleted.

packages/core/package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"license": "MIT",
77
"author": "Dan Freeman (https://github.com/dfreeman)",
88
"type": "module",
9-
"main": "lib/index.js",
109
"exports": {
1110
".": {
1211
"types": "./lib/index.d.ts",
@@ -16,7 +15,11 @@
1615
"types": "./lib/config/types.d.cts",
1716
"default": "./lib/config/types.cjs"
1817
},
19-
"./bin/*": "./bin/*.js"
18+
"./bin/*": "./bin/*.js",
19+
"./*": {
20+
"types": "./lib/*.d.ts",
21+
"default": "./lib/*.js"
22+
}
2023
},
2124
"files": [
2225
"README.md",
@@ -29,10 +32,6 @@
2932
"glint-language-server": "bin/glint-language-server.js"
3033
},
3134
"scripts": {
32-
"test": "vitest run",
33-
"test:typecheck": "echo 'no standalone typecheck within this project'",
34-
"test:tsc": "echo 'no standalone typecheck within this project'",
35-
"test:watch": "vitest watch",
3635
"build": "tsc --build",
3736
"dev": "tsc --watch",
3837
"prepack": "pnpm build"
@@ -73,7 +72,6 @@
7372
"execa": "^4.0.1",
7473
"glint-monorepo-test-utils": "workspace:*",
7574
"strip-ansi": "^6.0.0",
76-
"vitest": "~3.0.9",
7775
"typescript": ">=5.6.0"
7876
},
7977
"publishConfig": {

pnpm-lock.yaml

+86-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/__tests__/config/environment.test.ts renamed to test-packages/package-test-core/__tests__/config/environment.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'node:fs';
22
import * as os from 'node:os';
33
import { describe, beforeEach, afterEach, test, expect } from 'vitest';
44
import { GlintExtensionPreprocess, GlintExtensionTransform } from '@glint/core/config-types';
5-
import { GlintEnvironment } from '../../src/config/environment.js';
5+
import { GlintEnvironment } from '@glint/core/config/index';
66

77
describe('Config: Environments', () => {
88
describe('template tags config', () => {

packages/core/__tests__/config/load-config.test.ts renamed to test-packages/package-test-core/__tests__/config/load-config.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as fs from 'node:fs';
22
import * as os from 'node:os';
33
import { describe, beforeEach, afterEach, test, expect, vi } from 'vitest';
4-
import { loadConfig } from '../../src/config/index.js';
5-
import { normalizePath } from '../../src/config/config.js';
6-
import { findTypeScript, loadConfigInput, require } from '../../src/config/loader.js';
4+
import { loadConfig } from '@glint/core/config/index';
5+
import { normalizePath } from '@glint/core/config/config';
6+
import { findTypeScript, loadConfigInput, require } from '@glint/core/config/loader';
77

88
describe('Config: loadConfig', () => {
99
const testDir = `${os.tmpdir()}/glint-config-test-load-config-${process.pid}`;

packages/core/__tests__/config/loader.test.ts renamed to test-packages/package-test-core/__tests__/config/loader.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as fs from 'node:fs';
22
import * as os from 'node:os';
33
import { describe, beforeEach, afterEach, test, expect } from 'vitest';
4-
import { ConfigLoader } from '../../src/config/index.js';
5-
import { normalizePath } from '../../src/config/config.js';
4+
import { ConfigLoader } from '@glint/core/config/index';
5+
import { normalizePath } from '@glint/core/config/config';
66

77
describe('Config: loadConfig', () => {
88
const testDir = `${os.tmpdir()}/glint-config-test-loader-${process.pid}`;

packages/core/__tests__/transform/offset-mapping.test.ts renamed to test-packages/package-test-core/__tests__/transform/offset-mapping.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { rewriteModule, TransformedModule } from '../../src/transform/index.js';
1+
import { rewriteModule, TransformedModule } from '@glint/core/transform/index';
22
import { stripIndent } from 'common-tags';
33
import { describe, test, expect } from 'vitest';
4-
import { Range, SourceFile } from '../../src/transform/template/transformed-module.js';
4+
import { Range, SourceFile } from '@glint/core/transform/template/transformed-module';
55
import * as ts from 'typescript';
6-
import { assert } from '../../src/transform/util.js';
7-
import { GlintEnvironment } from '../../src/config/index.js';
6+
import { assert } from '@glint/core/transform/util';
7+
import { GlintEnvironment } from '@glint/core/config/index';
88

99
const emberLooseEnvironment = GlintEnvironment.load('ember-loose');
1010
const emberTemplateImportsEnvironment = GlintEnvironment.load('ember-template-imports');

packages/core/__tests__/transform/rewrite.test.ts renamed to test-packages/package-test-core/__tests__/transform/rewrite.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import ts from 'typescript';
22
import { describe, test, expect } from 'vitest';
3-
import { rewriteModule } from '../../src/transform/index.js';
3+
import { rewriteModule } from '@glint/core/transform/index';
44
import { stripIndent } from 'common-tags';
5-
import { GlintEnvironment } from '../../src/config/index.js';
5+
import { GlintEnvironment } from '@glint/core/config/index';
66

77
describe('Transform: rewriteModule', () => {
88
describe('inline tagged template', () => {

packages/core/__tests__/transform/template-to-typescript.test.ts renamed to test-packages/package-test-core/__tests__/transform/template-to-typescript.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, test, expect } from 'vitest';
33
import {
44
templateToTypescript,
55
TemplateToTypescriptOptions,
6-
} from '../../src/transform/template/template-to-typescript.js';
6+
} from '@glint/core/transform/template/template-to-typescript';
77

88
describe('Transform: rewriteTemplate', () => {
99
// Slices out the template boilerplate to return only the code representing
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "package-test-core",
3+
"version": "0.0.0",
4+
"private": true,
5+
"license": "MIT",
6+
"type": "module",
7+
"scripts": {
8+
"test": "vitest run",
9+
"test:typecheck": "echo 'no standalone typecheck within this project'",
10+
"test:tsc": "echo 'no standalone typecheck within this project'",
11+
"test:watch": "vitest watch"
12+
},
13+
"devDependencies": {
14+
"@glimmer/component": "^2.0.0",
15+
"@glint/core": "workspace:*",
16+
"@glint/environment-ember-template-imports": "workspace:*",
17+
"@glint/environment-ember-loose": "workspace:*",
18+
"@volar/language-server": "2.4.12",
19+
"@types/common-tags": "^1.8.0",
20+
"@types/node": "^18.11.5",
21+
"@types/semver": "^7.3.13",
22+
"@types/uuid": "^8.3.4",
23+
"@types/yargs": "^17.0.10",
24+
"@typescript/server-harness": "latest",
25+
"@vitest/ui": "~1.0.0",
26+
"common-tags": "^1.8.0",
27+
"execa": "^4.0.1",
28+
"glint-monorepo-test-utils": "workspace:*",
29+
"strip-ansi": "^6.0.0",
30+
"typescript": ">=5.6.0",
31+
"vitest": "~3.0.9",
32+
"vscode-uri": "^3.0.8"
33+
},
34+
"publishConfig": {
35+
"access": "public"
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.compileroptions.json",
3+
"include": ["../src", "**/*.ts"],
4+
"compilerOptions": {
5+
"types": ["@types/node"]
6+
},
7+
"references": [{ "path": "../test-utils" }]
8+
}

0 commit comments

Comments
 (0)