Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Miscellaneous Cleanup #192

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ devtools/common/node_modules
devtools/flipper/node_modules
devtools/ui/node_modules
common/static-xlrs/node_modules
common/test-utils/node_modules
cli/node_modules

# Devtools plugins test environment
Expand Down
20 changes: 20 additions & 0 deletions common/test-utils/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("//helpers:defs.bzl", "tsup_config", "vitest_config")

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")

vitest_config(name = "vitest_config")

js_pipeline(
private = True,
package_name = "@player-tools/test-utils",
peer_deps = [
"//:node_modules/typescript",
],
deps = [
"//:node_modules/@typescript/vfs",
],
)
7 changes: 7 additions & 0 deletions common/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@player-tools/test-utils",
"version": "0.0.0-PLACEHOLDER",
"sideEffects": false,
"main": "src/index.ts"
}

1 change: 1 addition & 0 deletions common/test-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./test-helpers";
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export interface SetupReturnType {
/**
* Setups a virtual TS environment for tests
*/
export function setupTestEnv(sourceCode: string, mockFileName = "filename.ts") {
export function setupTestEnv(
sourceCode: string,
mockFileName = "filename.ts"
): SetupReturnType {
const fsMap = tsvfs.createDefaultMapFromNodeModules({}, ts);
fsMap.set(mockFileName, sourceCode);

Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ packages:
- "devtools/messenger"
- "devtools/client"
- "common/static-xlrs"
- "common/test-utils"
- "cli"
29 changes: 0 additions & 29 deletions xlr/asset-docgen-webpack-plugin/BUILD

This file was deleted.

3 changes: 0 additions & 3 deletions xlr/asset-docgen-webpack-plugin/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions xlr/asset-docgen-webpack-plugin/package.json

This file was deleted.

102 changes: 0 additions & 102 deletions xlr/asset-docgen-webpack-plugin/src/converter.ts

This file was deleted.

84 changes: 0 additions & 84 deletions xlr/asset-docgen-webpack-plugin/src/index.ts

This file was deleted.

2 changes: 2 additions & 0 deletions xlr/converters/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ js_pipeline(
test_deps = [
"//:node_modules",
"//:vitest_config",
"//:node_modules/@typescript/vfs",
":node_modules/@player-tools/test-utils",
],
deps = [
":node_modules/@player-tools/xlr",
Expand Down
3 changes: 2 additions & 1 deletion xlr/converters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"main": "src/index.ts",
"dependencies": {
"@player-tools/xlr": "workspace:*",
"@player-tools/xlr-utils": "workspace:*"
"@player-tools/xlr-utils": "workspace:*",
"@player-tools/test-utils": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion xlr/converters/src/__tests__/player.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "vitest";
import { setupTestEnv } from "@player-tools/xlr-utils";
import { setupTestEnv } from "@player-tools/test-utils";
import { TsConverter } from "..";

test("Player Types Export", () => {
Expand Down
2 changes: 1 addition & 1 deletion xlr/converters/src/__tests__/ts-to-common.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, describe, vi } from "vitest";
import { setupTestEnv } from "@player-tools/xlr-utils";
import { setupTestEnv } from "@player-tools/test-utils";
import { TsConverter } from "..";

describe("Type Exports", () => {
Expand Down
2 changes: 1 addition & 1 deletion xlr/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ js_pipeline(
test_deps = [
"//:node_modules",
"//:vitest_config",
":node_modules/@player-tools/test-utils",
],
deps = [
":node_modules/@player-tools/xlr",
"//:node_modules/@typescript/vfs",
],
)
3 changes: 2 additions & 1 deletion xlr/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0-PLACEHOLDER",
"main": "src/index.ts",
"dependencies": {
"@player-tools/xlr": "workspace:*"
"@player-tools/xlr": "workspace:*",
"@player-tools/test-utils": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion xlr/utils/src/__tests__/annotations.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect, describe } from "vitest";
import { setupTestEnv } from "../test-helpers";
import { setupTestEnv } from "@player-tools/test-utils";
import { decorateNode } from "../annotations";

describe("Annotations", () => {
Expand Down
1 change: 0 additions & 1 deletion xlr/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ export * from "./annotations";
export * from "./ts-helpers";
export * from "./type-checks";
export * from "./validation-helpers";
export * from "./test-helpers";
export * from "./documentation";