Skip to content

Commit

Permalink
Add CI check for forbidden texts (#157)
Browse files Browse the repository at this point in the history
* Add CI check for forbidden texts

* wip

* Try this

* I think the custom externals stuff has a bug

* it worked?

* Update workspace/scripts/build-verify.js

Co-authored-by: Patrick Pircher <[email protected]>

* try this

* improve production build (#158)

* improve verify

* fix preact

* fix collections

* dont check debug & verify packages

* wip

* fix reactive

* fix lint

* improve build

* fix type & lint

* more lint fixes

* fix lint

* update @starbeam-dev/eslint-plugin

---------

Co-authored-by: Patrick Pircher <[email protected]>
  • Loading branch information
NullVoxPopuli and patricklx authored May 8, 2024
1 parent bca55c9 commit 3b6efdd
Show file tree
Hide file tree
Showing 109 changed files with 728 additions and 580 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm build
- name: "Ensure Certain dependencies don't end up in the production bundles"
run: node ./workspace/scripts/build-verify.js

test:
name: "Tests"
Expand Down
2 changes: 1 addition & 1 deletion @types/ansicolor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test:types": "tsc -b"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/node": "18.16.18"
}
}
4 changes: 2 additions & 2 deletions @types/fsify/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export interface Options {
*/
cwd?: string;
/**
* A persistent fsify tree remains on the file system after the process exits.
* Defaults to true.
* A persistent fsify tree remains on the file system after the process
* exits. Defaults to true.
*/
persistent?: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion @types/fsify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:types": "tsc -b"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/node": "18.16.1"
}
}
2 changes: 1 addition & 1 deletion @types/lines-and-columns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"test:types": "tsc -b"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/node": "18.16.1"
}
}
2 changes: 1 addition & 1 deletion @types/plugin-commonjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@rollup/plugin-commonjs": "25.0.5"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.3"
"@starbeam-dev/eslint-plugin": "^1.0.6"
}
}
2 changes: 1 addition & 1 deletion @types/plugin-node-resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@rollup/plugin-node-resolve": "^15.2.3"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.3"
"@starbeam-dev/eslint-plugin": "^1.0.6"
}
}
2 changes: 1 addition & 1 deletion @types/rollup-plugin-polyfill-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"rollup": "^4.0.2"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4"
"@starbeam-dev/eslint-plugin": "^1.0.6"
}
}
2 changes: 1 addition & 1 deletion @types/shell-escape-tag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"test:types": "tsc -b"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/node": "18.16.1"
}
}
2 changes: 1 addition & 1 deletion @types/shell-split/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:types": "tsc -b"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/node": "18.16.1"
}
}
2 changes: 1 addition & 1 deletion @types/vite-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"vitest": "^1.0.0-beta.2"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4"
"@starbeam-dev/eslint-plugin": "^1.0.6"
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@
"@nrr/pnpm-duplicate-cli": "^0.0.1",
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/core": "^1.0.2",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/eslint": "^8.56.0",
"@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@vitest/ui": "^1.1.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand Down Expand Up @@ -162,7 +162,8 @@
"preact": "10.17.1",
"typescript": "$typescript",
"vite": "$vite",
"vue": "3.3.4"
"vue": "3.3.4",
"terser": "^5.31.0"
},
"peerDependencyRules": {
"allowAny": [
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact-testing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"preact-render-to-string": "^6.2.1",
"rollup": "^4.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact-testing-utils/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"preact": "*"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"preact-render-to-string": "^6.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/preact/preact-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"rollup": "^4.0.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact-utils/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"preact": "*"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"preact-render-to-string": "^6.2.1"
}
}
2 changes: 1 addition & 1 deletion packages/preact/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"rollup": "^4.0.2"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/preact/preact/src/frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export class ComponentFrame {
): FinalizedFormula {
const frame = ComponentFrame.#frames.get(component);

verify(
verify?.(
frame,
isPresent,
expected.when("in Preact's _diff hook").as("a tracking frame"),
expected?.when("in Preact's _diff hook").as("a tracking frame"),
);

const end = frame.#end(subscription);
Expand Down Expand Up @@ -101,10 +101,10 @@ export class ComponentFrame {
}

#end(subscription: (() => void) | undefined) {
verify(
verify?.(
this.#active,
isPresent,
expected.when("in preact's _diff hook").as("an active tracking frame"),
expected?.when("in preact's _diff hook").as("an active tracking frame"),
);

const frame = (this.#frame = this.#active.done());
Expand Down
8 changes: 4 additions & 4 deletions packages/preact/preact/tests/create.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-return */
// @vitest-environment jsdom

import { install, setup } from "@starbeam/preact";
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"preact": "*"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"preact-render-to-string": "^6.2.1"
}
}
8 changes: 4 additions & 4 deletions packages/preact/preact/tests/reactive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-magic-numbers */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-return */
// @vitest-environment jsdom

import { install, setupReactive, useReactive } from "@starbeam/preact";
Expand Down
8 changes: 4 additions & 4 deletions packages/preact/preact/tests/resources.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */
// @vitest-environment jsdom

import { install, setupResource, useResource } from "@starbeam/preact";
Expand Down
8 changes: 4 additions & 4 deletions packages/preact/preact/tests/services.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-return */
// @vitest-environment jsdom

import { install, useService } from "@starbeam/preact";
Expand Down
8 changes: 4 additions & 4 deletions packages/preact/preact/tests/sync.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-return */
// @vitest-environment jsdom

import { install, setupSync } from "@starbeam/preact";
Expand Down
2 changes: 1 addition & 1 deletion packages/react/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/node": "18.16.1",
"@types/react": "^18.2.22",
"@types/scheduler": "^0.16.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/react/src/hooks/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ interface ScheduledHandler {
* Creates a {@linkcode ScheduledHandler} that will keep track of the
* synchronization functions to run.
*
* This function sets up a `useEffect` to run the handlers. This `useEffect` has
* a dependency on a `useState` that represents the set of handlers. The
* This function sets up a `useEffect` to run the handlers. This `useEffect`
* has a dependency on a `useState` that represents the set of handlers. The
* `useState` invalidates whenever a handler is added or whenever
* {@linkcode scheduleDep} is explicitly run.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/react/react/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"vitest": "^0.34.4"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4"
"@starbeam-dev/eslint-plugin": "^1.0.6"
}
}
8 changes: 4 additions & 4 deletions packages/react/react/tests/test-use.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ type DefineSetupReactiveComponent = (
) => Promise<void>;

/**
* Sets up a test suite for a reactive component using `setupReactive` to create
* subscribe to a reactive value.
* Sets up a test suite for a reactive component using `setupReactive` to
* create subscribe to a reactive value.
*
* Each test case has three variations, representing the three overloads of
* `IntoReactiveBlueprint`.
Expand Down Expand Up @@ -105,8 +105,8 @@ export function testSetupReactive(
}

/**
* Sets up a test suite for a reactive component using `setupReactive` to create
* subscribe to a reactive value.
* Sets up a test suite for a reactive component using `setupReactive` to
* create subscribe to a reactive value.
*
* Each test case has three variations, representing the three overloads of
* `IntoReactiveBlueprint`.
Expand Down
2 changes: 1 addition & 1 deletion packages/react/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.22",
"@types/scheduler": "^0.16.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/use-strict-lifecycle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/react": "^18.2.22",
"@types/scheduler": "^0.16.3",
"rollup": "^4.0.2"
Expand Down
8 changes: 4 additions & 4 deletions packages/react/use-strict-lifecycle/src/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
*
* ## The Solution
*
* The `useLifecycle` hook gives you a way to create a new instance of something
* when the component is first instantiated, clean it up when the component is
* unmounted, and create a brand **new** instance when the component is
* reactivated.
* The `useLifecycle` hook gives you a way to create a new instance of
* something when the component is first instantiated, clean it up when the
* component is unmounted, and create a brand **new** instance when the
* component is reactivated.
*
* TL;DR It works almost the same way that per-component state in React works,
* but gives you a fresh copy whenever React re-attaches the component.
Expand Down
2 changes: 1 addition & 1 deletion packages/react/use-strict-lifecycle/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react": "18.2.0"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"@types/react": "^18.2.22",
"jsdom": "^22.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/collections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"rollup": "^4.0.2"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/universal/collections/src/decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export const cached = <T>(
): void => {
const get = descriptor.get;

verify(
verify?.(
get,
isPresent,
expected(`the target of @cached`)
expected?.(`the target of @cached`)
.toBe(`a getter`)
.butGot(() =>
typeof descriptor.value === "function" ? `a method` : `a field`,
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/collections/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"@starbeam-workspace/test-utils": "workspace:^"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.4"
"@starbeam-dev/eslint-plugin": "^1.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/universal/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {},
"devDependencies": {
"@starbeam-dev/compile": "workspace:*",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@starbeam-dev/eslint-plugin": "^1.0.6",
"rollup": "^4.0.2"
}
}
Loading

0 comments on commit 3b6efdd

Please sign in to comment.