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

Some long-needed renaming and consolidation #86

Closed
wants to merge 16 commits into from
Closed
5 changes: 2 additions & 3 deletions .config/tsconfig/tsconfig.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",

"declaration": true,
"declarationMap": true,
Expand All @@ -17,15 +17,14 @@
"noImplicitOverride": true,

"isolatedModules": true,
"preserveValueImports": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,

"esModuleInterop": true,
"allowSyntheticDefaultImports": true,

"useDefineForClassFields": true,
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,

"resolveJsonModule": true,

Expand Down
12 changes: 8 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"html"
],

"explorer.excludeGitIgnore": false,
"explorer.excludeGitIgnore": true,
"explorer.fileNesting.patterns": {
"*.cjs": "${capture}.cjs.map, ${capture}.min.cjs, ${capture}.d.cts, ${capture}.d.cts.map",
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts, ${capture}.d.ts.map",
Expand Down Expand Up @@ -68,18 +68,22 @@
"url": "https://json.schemastore.org/chrome-manifest"
}
],
"npm-scripts.showStartNotification": false,
"rewrap.autoWrap.enabled": true,
"rewrap.reformat": true,
"rewrap.wrappingColumn": 80,

"search.exclude": {
"**/CHANGELOG.md": true,
"pnpm-lock.yaml": true
},

"testing.automaticallyOpenPeekView": "never",
"typescript.experimental.tsserver.web.enableProjectWideIntellisense": true,

"typescript.preferences.importModuleSpecifier": "project-relative",
"typescript.preferences.importModuleSpecifierEnding": "js",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.tsserver.experimental.enableProjectDiagnostics": true,

"vitest.enable": true
"vitest.enable": true,
"testing.automaticallyOpenPeekView": "never"
}
12 changes: 12 additions & 0 deletions @types/ansicolor/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": false,
"overrides": [
{
"extends": ["plugin:@starbeam/commonjs"],
"files": ["index.d.ts", "src/**/*.d.ts"],
"parserOptions": {
"project": "@types/ansicolor/tsconfig.json"
}
}
]
}
File renamed without changes.
44 changes: 44 additions & 0 deletions @types/ansicolor/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;

type Colors =
| "Black"
| "Red"
| "Green"
| "Yellow"
| "Blue"
| "Magenta"
| "Cyan"
| "White"
| "Default";

type Styles = "bright" | "dim" | "italic" | "underline" | "inverse";

type Bg = `bg${"Bright" | ""}${Colors}`;

type BgColor = Expand<{
[key in Colors]: Color;
}>;

type FgColor = Expand<{
bright: Color;
dim: Color;
italic: Color;
underline: Color;
inverse: Color;
dim: Color;
magenta: Color;
black: Color;
red: Color;
green: Color;
yellow: Color;
blue: Color;
magenta: Color;
cyan: Color;
white: Color;
default: Color;
}>;

export type Color = BgColor & FgColor & ((text: string) => string);

const DEFAULT: Color;
export default DEFAULT;
30 changes: 30 additions & 0 deletions @types/ansicolor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"private": true,
"name": "@types/ansicolor",
"version": "1.0.0",
"types": "index.d.ts",
"exports": {
".": {
"types": "./index.d.ts"
}
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts"
}
},
"types": "dist/index.d.ts"
},
"starbeam": {
"source": "d.ts",
"type": "library:upstream-types"
},
"scripts": {
"test:lint": "eslint",
"test:types": "tsc -b"
},
"devDependencies": {
"@types/node": "*"
}
}
12 changes: 12 additions & 0 deletions @types/ansicolor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../.config/tsconfig/tsconfig.shared.json",
"compilerOptions": {
"declarationMap": true,
"declarationDir": "../../dist/types",
"declaration": true,
"outDir": "../../dist/packages",
"composite": true,
"types": ["../../packages/env", "node"]
},
"exclude": ["dist/**/*"]
}
4 changes: 2 additions & 2 deletions @types/rollup-plugin-polyfill-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"extends": "../../.config/tsconfig/tsconfig.shared.json",
"compilerOptions": {
"declarationMap": true,
"declarationDir": "../../../dist/types",
"declarationDir": "../../dist/types",
"declaration": true,
"outDir": "../../../dist/packages",
"outDir": "../../dist/packages",
"composite": true,
"types": ["../../packages/env"]
},
Expand Down
2 changes: 1 addition & 1 deletion demos/preact-hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@starbeam/js": "workspace:^",
"@starbeam/preact": "workspace:^",
"@starbeam/timeline": "workspace:^",
"@starbeam/runtime": "workspace:^",
"@starbeam/universal": "workspace:^",
"preact": "^10.11.3",
"purecss": "3.0.0"
Expand Down
1 change: 1 addition & 0 deletions demos/react-jsnation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"devDependencies": {
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@vitest/ui": "*",
"vite": "*",
"vite-plugin-fonts": "^0.6.0"
}
Expand Down
2 changes: 1 addition & 1 deletion demos/react-stock-ticker/src/components/StockDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { use, useReactive } from "@starbeam/react";
import { type ResourceBlueprint, Cell, Resource } from "@starbeam/universal";
import { Cell, Resource, type ResourceBlueprint } from "@starbeam/universal";
import { Portal } from "react-portal";

import { getDailyValues, getTickerDetails } from "../lib/api/api.js";
Expand Down
69 changes: 33 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,44 +105,42 @@
"@starbeam/core-utils": "workspace:^0.8.9"
},
"devDependencies": {
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-decorators": "^7.20.7",
"@babel/eslint-parser": "^7.21.3",
"@babel/plugin-proposal-decorators": "^7.21.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.20.7",
"@babel/preset-typescript": "^7.21.0",
"@babel/runtime": "^7.21.0",
"@changesets/changelog-git": "^0.1.14",
"@changesets/cli": "^2.26.0",
"@changesets/cli": "^2.26.1",
"@changesets/config": "^2.3.0",
"@starbeam/eslint-plugin": "workspace:^1.0.0",
"@starbeam-dev/build-support": "workspace:1.0.0",
"@types/eslint": "^8.4.10",
"@types/node": "18.11.18",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@vitest/ui": "^0.26.3",
"eslint": "^8.31.0",
"@types/eslint": "^8.21.3",
"@types/node": "18.15.5",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"@vitest/ui": "^0.29.8",
"eslint": "^8.36.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.6.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsonc": "^2.5.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsonc": "^2.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"esno": "^0.16.3",
"fast-glob": "^3.2.12",
"happy-dom": "^8.1.1",
"jsdom": "^20.0.3",
"lint-to-the-future": "^1.3.1",
"lint-to-the-future-eslint": "^1.0.1",
"prettier": "^2.8.1",
"tslib": "^2.4.1",
"typescript": "^4.9.4",
"vite": "4.0.4",
"vitest": "0.26.3"
"happy-dom": "^8.9.0",
"jsdom": "^21.1.1",
"prettier": "^2.8.6",
"tslib": "^2.5.0",
"typescript": "^5.0.2",
"vite": "4.2.1",
"vitest": "0.29.8"
},
"license": "MIT",
"nodemonConfig": {
Expand All @@ -156,18 +154,16 @@
"overrides": {
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/eslint": "^8.4.10",
"@types/node": "18.11.18",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@vitest/ui": "^0.26.3",
"eslint": "^8.31.0",
"@types/eslint": "$@types/eslint",
"@types/node": "$@types/node",
"@typescript-eslint/eslint-plugin": "$@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser": "$@typescript-eslint/parser",
"eslint": "$eslint",
"preact": "^10.11.3",
"rollup": "^3.9.1",
"typescript": "^4.9.4",
"vite": "4.0.4",
"typescript": "$typescript",
"vite": "$vite",
"vite-plugin-fonts": "0.7.0",
"vitest": "0.26.3",
"vue": "^3.2.39"
},
"peerDependencyRules": {
Expand All @@ -181,6 +177,7 @@
}
},
"volta": {
"node": "19.0.1"
"node": "19.8.1",
"pnpm": "8.1.0"
}
}
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 @@ -11,7 +11,7 @@
"dependencies": {
"@starbeam/debug": "workspace:^",
"@starbeam/preact": "workspace:^",
"@starbeam/timeline": "workspace:^",
"@starbeam/runtime": "workspace:^",
"@starbeam/universal": "workspace:^",
"@starbeam-workspace/preact-testing-utils": "workspace:^",
"@starbeam-workspace/test-utils": "workspace:^",
Expand Down
2 changes: 2 additions & 0 deletions packages/preact/preact-utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export { implementInspect } from "./src/debug.js";
export type { RawPreactOptions } from "./src/interfaces.js";
export { InternalComponent } from "./src/internals/component.js";
export { InternalElement } from "./src/internals/elements.js";
export { InternalVNode } from "./src/internals/vnode.js";
export { AugmentPreact, Plugin } from "./src/plugin.js";
2 changes: 1 addition & 1 deletion packages/preact/preact-utils/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { Options } from "preact";

import type { AnyFn, RawPreactOptions } from "./interfaces.js";
import {
isProbablyVNode,
type MangledPreactOptionName,
type PreactHook,
type PreactOptionName,
isProbablyVNode,
} from "./internals.js";
import { InternalComponent } from "./internals/component.js";
import { InternalElement } from "./internals/elements.js";
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 @@ -11,7 +11,7 @@
"dependencies": {
"@starbeam/debug": "workspace:^",
"@starbeam/preact": "workspace:^",
"@starbeam/timeline": "workspace:^",
"@starbeam/runtime": "workspace:^",
"@starbeam/universal": "workspace:^",
"@starbeam-workspace/test-utils": "workspace:^",
"@testing-library/dom": "^8.19.1",
Expand Down
13 changes: 5 additions & 8 deletions packages/preact/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@
"main": "index.ts",
"types": "index.ts",
"exports": {
".": "./index.ts",
"./setup": "./src/setup.ts"
"default": "./index.ts"
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.cjs"
},
"./setup": {
"types": "./dist/setup.d.ts",
"import": "./dist/setup.js",
"default": "./dist/setup.cjs"
}
},
"main": "dist/index.cjs",
Expand All @@ -39,8 +33,11 @@
"dependencies": {
"@starbeam/core-utils": "workspace:^",
"@starbeam/debug": "workspace:^",
"@starbeam/interfaces": "workspace:^",
"@starbeam/preact-utils": "workspace:^",
"@starbeam/timeline": "workspace:^",
"@starbeam/reactive": "workspace:^",
"@starbeam/runtime": "workspace:^",
"@starbeam/tags": "workspace:^",
"@starbeam/universal": "workspace:^",
"@starbeam/verify": "workspace:^"
},
Expand Down
Loading