diff --git a/.gitignore b/.gitignore index 10121313..663a2663 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist/ build/ out/ coverage/ +*.tsbuildinfo diff --git a/apex-log-parser/tsconfig.json b/apex-log-parser/tsconfig.json index 9994a257..dc29f3ca 100644 --- a/apex-log-parser/tsconfig.json +++ b/apex-log-parser/tsconfig.json @@ -19,7 +19,8 @@ "moduleResolution": "Bundler", "module": "ESNext", - "noEmit": true, + "composite": true, + "emitDeclarationOnly": true, "declaration": true, "declarationMap": true, diff --git a/lana/package.json b/lana/package.json index a307e513..b79ec02e 100644 --- a/lana/package.json +++ b/lana/package.json @@ -311,7 +311,7 @@ } }, "scripts": { - "vscode:prepublish": "rm -rf out && pnpm -w run build" + "vscode:prepublish": "pnpm -w run build && pnpm -w run copy:package-docs" }, "dependencies": { "@apexdevtools/apex-ls": "^6.0.2", diff --git a/lana/tsconfig.json b/lana/tsconfig.json index b374b046..11b78c72 100644 --- a/lana/tsconfig.json +++ b/lana/tsconfig.json @@ -39,6 +39,7 @@ "removeComments": true, "sourceMap": false }, - "include": ["./src/**/*.ts", "../apex-log-parser/src/**/*.ts"], - "exclude": ["**/node_modules", "**/.*/"] + "include": ["./src/**/*.ts"], + "exclude": ["**/node_modules", "**/.*/"], + "references": [{ "path": "../apex-log-parser" }] } diff --git a/log-viewer/tsconfig.json b/log-viewer/tsconfig.json index 37df9a9d..59193d5e 100644 --- a/log-viewer/tsconfig.json +++ b/log-viewer/tsconfig.json @@ -40,6 +40,7 @@ "removeComments": true, "sourceMap": false }, - "include": ["./src/**/*.ts", "declarations.d.ts", "../apex-log-parser/src/**/*.ts"], - "exclude": ["**/node_modules", "**/.*/"] + "include": ["./src/**/*.ts", "declarations.d.ts"], + "exclude": ["**/node_modules", "**/.*/"], + "references": [{ "path": "../apex-log-parser" }] } diff --git a/package.json b/package.json index e4fdf190..8b2696f1 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@swc/jest": "^0.2.39", "@types/jest": "^30.0.0", "@typescript-eslint/parser": "^8.60.0", + "@typescript/native-preview": "7.0.0-dev.20260527.2", "concurrently": "^9.2.1", "eslint": "^10.4.1", "eslint-config-prettier": "^10.1.8", @@ -36,13 +37,16 @@ "preinstall": "npx only-allow pnpm", "prepare": "husky", "bump-prerelease": "node ./scripts/pre-release.js", - "build": "NODE_ENV=production pnpm run build:dev", - "build:fast": "NODE_ENV=production pnpm run build:dev:fast", - "build:dev": "rm -rf lana/out && concurrently -r -g 'rollup -c rollup.config.mjs' 'tsc --noemit --skipLibCheck -p apex-log-parser/tsconfig.json' 'tsc --noemit --skipLibCheck -p log-viewer/tsconfig.json' 'tsc --noemit --skipLibCheck -p lana/tsconfig.json'", - "build:dev:fast": "rm -rf lana/out && concurrently -r -g 'rolldown -c rolldown.config.ts' 'tsc --noemit --skipLibCheck -p apex-log-parser/tsconfig.json' 'tsc --noemit --skipLibCheck -p log-viewer/tsconfig.json' 'tsc --noemit --skipLibCheck -p lana/tsconfig.json'", + "build": "pnpm run typecheck && NODE_ENV=production pnpm run build:dev", + "build:fast": "pnpm run typecheck && NODE_ENV=production pnpm run build:dev:fast", + "build:dev": "rm -rf lana/out && rollup -c rollup.config.mjs", + "build:dev:fast": "rolldown -c rolldown.config.ts", "watch": "rm -rf lana/out && rollup -w -c rollup.config.mjs", - "watch:fast": "rm -rf lana/out && rolldown -w -c rolldown.config.ts", - "lint": "concurrently -r -g 'eslint **/*.ts' 'prettier --cache **/*.{ts,css,md,scss} --check --experimental-cli' 'tsc --noemit --skipLibCheck -p apex-log-parser/tsconfig.json' 'tsc --noemit --skipLibCheck -p log-viewer/tsconfig.json' 'tsc --noemit --skipLibCheck -p lana/tsconfig.json'", + "watch:fast": "rolldown -w -c rolldown.config.ts", + "copy:package-docs": "node ./scripts/copy-package-docs.mjs", + "typecheck": "tsgo -b", + "typecheck:tsc": "tsc -b", + "lint": "concurrently -r -g 'eslint **/*.ts' 'prettier --cache **/*.{ts,css,md,scss} --check --experimental-cli' 'pnpm run typecheck'", "test": "jest", "test:ci": "jest --runInBand", "prettier-format": "prettier '**/*.ts' --cache --write --experimental-cli" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 545172d2..9c0a73c2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,6 +61,9 @@ importers: '@typescript-eslint/parser': specifier: ^8.60.0 version: 8.60.0(eslint@10.4.1(jiti@1.21.7))(typescript@6.0.3) + '@typescript/native-preview': + specifier: 7.0.0-dev.20260527.2 + version: 7.0.0-dev.20260527.2 concurrently: specifier: ^9.2.1 version: 9.2.1 @@ -3338,6 +3341,53 @@ packages: resolution: {integrity: sha512-9WI52t8ZGLVGrPMBet25yAftqY/n95+zmoUUtJBBQTKDSKUu7OsPTroT2op7U9JatkoRccL0YkWDNMFfC4Sjxg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-3LqSu4DlxkEfeC/Z/29QMCJn5jjkDtXI7LYuxfmjdmAatS6umDKqm8J17fnP/7fyrZUMBTIYRwSDpChGV3G1ew==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-H4+sxE9qaBbLF83wMdWE0FsgfK0Pom+/O+/oxqyGzhVkDJlNt3vfpgQZMit48/Gm44AacGfBggJ9Dhbi3aeSFw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-BGUDMjC2Z3TTdZRkGGwhBLelkP5UYgO2rbep8aF4dS3fu7T5lFPPrnfS6EgqJgie+cF5Fsev7xEq8wWyBDM+lg==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/native-preview-linux-arm@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-6I9Cv9ozwfS9zB9vRQDPIYseLX3artEO9jl3yVgLj4ishwlSF4cWAbIsjl5IztPaEgHv8coej/6tX1D0uaBzXg==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/native-preview-linux-x64@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-vpazOu+ozlxBo8U57YJMzsOPuxAV8H7fu36KJ8ea8At/D8pdGmOAy5TuB+9OBQV9JDe0OXJMy2kmbhOpmkTAmA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-DBFnFE3V6AITkPO1K1VxXf3yEZKjU2FwtXlNwRqhzDu0rrL2SsJHOSrBDX+OacTxQFzZMxFcpiuhV8jHZALPEg==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/native-preview-win32-x64@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-1tBlErMvQgcMqqYwsx4tytupcjCJcOUXD3vBn1Wb/kAvus1FzWQAFE0fcKBvLfcqLQfTiiEwKKEtbLjGmakqqg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + + '@typescript/native-preview@7.0.0-dev.20260527.2': + resolution: {integrity: sha512-piqkDwikVeizCFqA1lcwI5F4wOAtBdxuliWe77ApBNRyBPPvfCJB+u/HYi9/8t5nd0sWvFs6/qt/AzJ1CCoykQ==} + engines: {node: '>=16.20.0'} + hasBin: true + '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} @@ -13563,6 +13613,37 @@ snapshots: '@typescript-eslint/types': 8.60.0 eslint-visitor-keys: 5.0.1 + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview-linux-arm@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview-linux-x64@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview-win32-x64@7.0.0-dev.20260527.2': + optional: true + + '@typescript/native-preview@7.0.0-dev.20260527.2': + optionalDependencies: + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260527.2 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260527.2 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20260527.2 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260527.2 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20260527.2 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260527.2 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20260527.2 + '@ungap/structured-clone@1.3.0': {} '@ungap/structured-clone@1.3.1': {} @@ -15655,7 +15736,7 @@ snapshots: history@4.10.1: dependencies: - '@babel/runtime': 7.29.2 + '@babel/runtime': 7.29.7 loose-envify: 1.4.0 resolve-pathname: 3.0.0 tiny-invariant: 1.3.3 diff --git a/rolldown.config.ts b/rolldown.config.ts index 9f0e3856..9990aa63 100644 --- a/rolldown.config.ts +++ b/rolldown.config.ts @@ -7,7 +7,6 @@ import { defineConfig } from 'rolldown'; import nodePolyfills from '@rolldown/plugin-node-polyfills'; // rollup plugins -// @ts-expect-error - no type declarations import postcssUrl from 'postcss-url'; import copy from 'rollup-plugin-copy'; import postcss from 'rollup-plugin-postcss'; @@ -105,7 +104,6 @@ export default defineConfig([ src: ['log-viewer/out/*', 'log-viewer/index.html', 'lana/certinia-icon-color.png'], dest: 'lana/out', }, - { src: ['CHANGELOG.md', 'LICENSE.txt', 'README.md'], dest: 'lana' }, ], }), ], diff --git a/rollup.config.mjs b/rollup.config.mjs index 948e72d0..50f7c5b8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -144,14 +144,9 @@ export default [ hook: 'closeBundle', targets: [ { - src: [ - 'log-viewer/out/*', - 'log-viewer/index.html', - 'lana/certinia-icon-color.png', - ], + src: ['log-viewer/out/*', 'log-viewer/index.html', 'lana/certinia-icon-color.png'], dest: 'lana/out', }, - { src: ['CHANGELOG.md', 'LICENSE.txt', 'README.md'], dest: 'lana' }, ], }), ], diff --git a/scripts/copy-package-docs.mjs b/scripts/copy-package-docs.mjs new file mode 100644 index 00000000..bc58520c --- /dev/null +++ b/scripts/copy-package-docs.mjs @@ -0,0 +1,13 @@ +import { copyFile } from 'node:fs/promises'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +// Copy the package docs into lana/ for vsce packaging only. +// The root files are the sources of truth; the lana/ copies are gitignored +// build artifacts consumed by `vsce package` (see lana/.vscodeignore). +const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const docs = ['CHANGELOG.md', 'LICENSE.txt', 'README.md']; + +await Promise.all( + docs.map((file) => copyFile(path.join(repoRoot, file), path.join(repoRoot, 'lana', file))), +); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..32be5fba --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,4 @@ +{ + "files": [], + "references": [{ "path": "./apex-log-parser" }, { "path": "./log-viewer" }, { "path": "./lana" }] +}