Skip to content

Commit ee13d28

Browse files
committed
Fixed build issues
1 parent a19001d commit ee13d28

15 files changed

Lines changed: 766 additions & 477 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
- name: Fetch latest tag
2121
id: get_tag
2222
run: |
23-
git fetch --tags
24-
LATEST_TAG=$(git tag -l "v*" --sort=-v:refname | head -n 1)
23+
LATEST_TAG=$(gh release view --json tagName --template '{{.tagName}}' || git tag -l "v*" --sort=-v:refname | head -n 1)
2524
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
2625
echo "Found tag: $LATEST_TAG"
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2728

2829
- name: Checkout latest release
2930
uses: actions/checkout@v4
@@ -43,6 +44,9 @@ jobs:
4344
- name: Install dependencies
4445
run: pnpm install --frozen-lockfile
4546

47+
- name: Link node_modules
48+
run: ln -s ${{ github.workspace }}/node_modules ${{ github.workspace }}/latest-release/node_modules
49+
4650
- name: Build packages
4751
run: pnpm run build
4852
env:

demo/scripts/fetchRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from "node:fs";
22
import { REPO } from "../src/config/deploy.config";
3-
import { name } from "../package.json";
3+
import { name } from "../package.json" with { type: "json" };
44
import { Logger } from "@prozilla-os/shared";
55

66
const API_URL = "https://api.github.com/";

demo/src/types/style.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import "react";
2+
3+
declare module "react" {
4+
interface CSSProperties {
5+
[key: `--${string}`]: string | number | undefined;
6+
}
7+
}

demo/tsconfig.build.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
2-
"extends": "./tsconfig.json",
3-
"compilerOptions": {
4-
"paths": {
5-
"prozilla-os": ["packages/prozilla-os/dist/main",],
6-
"@prozilla-os/*": ["packages/*/dist/main", "packages/apps/*/dist/main"],
7-
},
8-
},
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"paths": {
5+
"prozilla-os": ["packages/prozilla-os/dist/main.d.ts"],
6+
"@prozilla-os/core": ["packages/core/dist/main.d.ts"],
7+
"@prozilla-os/shared": ["packages/shared/dist/main.d.ts"],
8+
"@prozilla-os/skins": ["packages/skins/dist/main.d.ts"],
9+
"@prozilla-os/dev-tools": ["packages/dev-tools/dist/main.d.ts"],
10+
"@prozilla-os/*": ["packages/apps/*/dist/main.d.ts"]
11+
}
12+
}
913
}

demo/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"src",
1212
"vite.config.ts",
1313
"scripts",
14-
"../packages/core/src/**/*"
1514
],
16-
"exclude": ["**/node_modules/**/*"]
15+
"exclude": ["node_modules", "**/dist/**"]
1716
}

docs/scripts/typedoc.ts

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,20 @@ const SOURCE_BASE = RELEASE_PATH
3939
? resolve(RELEASE_PATH, "packages")
4040
: resolve(__dirname, PACKAGES_DIR);
4141

42+
const COMPILER_BASE = RELEASE_PATH ? resolve(RELEASE_PATH) : resolve(__dirname, "../../");
43+
4244
const COMPILER_PATHS: Record<string, string[]> = {
43-
"*": ["node_modules/*"],
45+
"*": [resolve(COMPILER_BASE, "node_modules/*").replaceAll("\\", "/")],
4446
};
4547

4648
PACKAGE_PATHS.forEach((path) => {
4749
const name = packagePathToName(path);
48-
COMPILER_PATHS[name] = [`packages/${path}`];
49-
COMPILER_PATHS[`${name}/*`] = [`packages/${path}/*`];
50+
// Point to the source files in the release directory
51+
const absolutePkgPath = resolve(SOURCE_BASE, path, "src/main.ts").replaceAll("\\", "/");
52+
COMPILER_PATHS[name] = [absolutePkgPath];
53+
COMPILER_PATHS[`${name}/*`] = [resolve(SOURCE_BASE, path, "src/*").replaceAll("\\", "/")];
5054
});
5155

52-
const WORKSPACE_ROOT = resolve(__dirname, "../../").replaceAll("\\", "/");
53-
5456
const logger = new Logger();
5557

5658
program.name("typedoc-helper")
@@ -104,25 +106,48 @@ program.command("run", { isDefault: true })
104106
async function generateDocs(path: string, dryRun: boolean) {
105107
const packageDir = resolve(SOURCE_BASE, path);
106108
const entryPoint = resolve(packageDir, "src/main.ts").replaceAll("\\", "/");
107-
108109
const tsConfig = resolve(SOURCE_BASE, path, "tsconfig.json");
109-
110110
const outDir = OUT_DIR + path;
111-
const navigationJson = `${outDir}/nav.json`;
111+
112+
const localNodeModules = resolve(packageDir, "node_modules").replaceAll("\\", "/");
113+
const rootNodeModules = resolve(SOURCE_BASE, "../node_modules").replaceAll("\\", "/");
112114

113115
const options: TypeDocOptions & PluginOptions & { path: string } = {
114116
...DEFAULT_OPTIONS,
115117
path,
116118
entryPoints: [entryPoint],
117119
tsconfig: tsConfig,
118120
out: outDir,
119-
navigationJson,
121+
navigationJson: `${outDir}/nav.json`,
120122
compilerOptions: {
121-
moduleResolution: "node",
122-
baseUrl: WORKSPACE_ROOT,
123+
target: "ESNext",
124+
jsx: "react-jsx",
125+
lib: ["ESNext", "DOM", "DOM.Iterable"],
126+
module: "ESNext",
127+
moduleResolution: "Bundler",
128+
129+
baseUrl: packageDir.replaceAll("\\", "/"),
123130
paths: COMPILER_PATHS,
131+
132+
typeRoots: [
133+
`${localNodeModules}/@types`,
134+
`${rootNodeModules}/@types`,
135+
localNodeModules,
136+
rootNodeModules,
137+
],
138+
139+
allowJs: true,
140+
esModuleInterop: true,
141+
forceConsistentCasingInFileNames: true,
142+
strict: true,
124143
skipLibCheck: true,
125-
jsx: "react-jsx",
144+
145+
preserveSymlinks: true,
146+
147+
rootDir: SOURCE_BASE.replaceAll("\\", "/"),
148+
composite: false,
149+
declaration: false,
150+
allowArbitraryExtensions: true,
126151
},
127152
};
128153

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"stylelint": "^16.26.1",
6969
"typescript": "^5.9.3",
7070
"typescript-eslint": "^8.54.0",
71-
"vite-node": "^2.1.9",
71+
"vite-node": "^6.0.0",
7272
"vite-plugin-checker": "^0.7.2"
7373
},
7474
"browserslist": {
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
{
22
"extends": "./tsconfig.json",
3-
"compilerOptions": {
4-
"paths": {
5-
"@prozilla-os/core": ["packages/core/dist/main"],
6-
"@prozilla-os/shared": ["packages/shared/dist/main"],
7-
"@prozilla-os/skins": ["packages/skins/dist/main"]
8-
}
9-
}
103
}

packages/apps/terminal/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"@prozilla-os/skins": ["./node_modules/@prozilla-os/skins/src/main"]
1414
}
1515
},
16-
"include": ["src", "vite.config.ts", "../../core/src/features/shell/_utils"],
17-
"exclude": ["node_modules"],
16+
"include": ["src", "vite.config.ts"],
17+
"exclude": ["node_modules"]
1818
}

packages/core/src/features/shell/executableResolver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export class ExecutableResolver {
3232
}
3333

3434
private static resolvePath(path: string, workingDirectory: VirtualFolder): ExecutableResolutionResult {
35-
console.log(workingDirectory.path, path);
3635
const target = workingDirectory.navigate(path);
3736
if (!target)
3837
return { executable: null, error: this.NOT_FOUND_ERROR };

0 commit comments

Comments
 (0)