Skip to content

Create separate jekyll ts#11

Merged
akumm2k merged 1 commit into
mainfrom
fix-js-404
Dec 14, 2025
Merged

Create separate jekyll ts#11
akumm2k merged 1 commit into
mainfrom
fix-js-404

Conversation

@akumm2k
Copy link
Copy Markdown
Owner

@akumm2k akumm2k commented Dec 14, 2025

No description provided.

@akumm2k akumm2k marked this pull request as ready for review December 14, 2025 22:56
Copilot AI review requested due to automatic review settings December 14, 2025 22:56
@akumm2k akumm2k merged commit 55a3fad into main Dec 14, 2025
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR creates a separate TypeScript setup specifically for Jekyll-related code, moving article-related TypeScript functionality from a previous location to a new assets/ts/ directory structure. The change introduces new build configuration, reorganizes file paths, and adds code formatting standards via Prettier.

Key changes:

  • New TypeScript project setup in assets/ts/ with its own tsconfig.json and package.json
  • Migration of article.ts source code and compiled outputs to the new structure
  • Updated path references in HTML layout to point to the reorganized assets
  • Addition of Prettier configuration for code formatting consistency

Reviewed changes

Copilot reviewed 4 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
assets/ts/tsconfig.json New TypeScript compiler configuration for the Jekyll-specific TS project
assets/ts/package.json New package configuration with TypeScript and ts-node dependencies
assets/ts/package-lock.json Lock file for the new TypeScript project dependencies
assets/ts/article.ts Migrated TypeScript source for article page functionality (syntax highlighting, reading time, scroll progress)
assets/js/article.js Compiled JavaScript output with added comments and source map reference
assets/js/article.js.map Source map for debugging TypeScript in browser
assets/js/article.d.ts TypeScript declaration file generated from compilation
assets/js/article.d.ts.map Declaration source map
assets/css/article.css New CSS file for article styling (130 lines of comprehensive styles)
_layouts/article.html Updated paths from /css/jekyll/article.css and /ts/dist/jekyll/article.js to new asset locations
.prettierrc New Prettier configuration with 72-char line width and consistent formatting rules
.prettierignore Ignore patterns for Prettier (node_modules, dist, build)
Files not reviewed (1)
  • assets/ts/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread assets/ts/package.json
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package.json is missing a build script to compile TypeScript to JavaScript. Add a "build" script like "tsc" or "tsc --watch" to the scripts section so developers know how to compile the TypeScript code.

Suggested change
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"

Copilot uses AI. Check for mistakes.
Comment on lines +198 to +204
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript is marked as "peer": true in package-lock.json (line 204), which means it's only a peer dependency. However, it should be a direct devDependency as specified in package.json. This may indicate an issue with how npm install was run. Try removing package-lock.json and node_modules, then running npm install again to fix the dependency tree.

Copilot uses AI. Check for mistakes.
"integrity": "sha512-gWEkeiyYE4vqjON/+Obqcoeffmk0NF15WSBwSs7zwVA2bAbTaE0SJ7P0WNGoJn8uE7fiaV5a7dKYIJriEqOrmA==",
"dev": true,
"license": "MIT",
"peer": true,
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@types/node is marked as "peer": true in package-lock.json (line 92), which means it's only a peer dependency. However, it should be a direct devDependency as specified in package.json. This may indicate an issue with how npm install was run. Try removing package-lock.json and node_modules, then running npm install again to fix the dependency tree.

Suggested change
"peer": true,

Copilot uses AI. Check for mistakes.
Comment thread assets/ts/tsconfig.json
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing comma after the last property in compilerOptions will cause a JSON parsing error. Remove the comma after "skipLibCheck": true.

Suggested change
"skipLibCheck": true,
"skipLibCheck": true

Copilot uses AI. Check for mistakes.
Comment thread assets/ts/tsconfig.json

// Recommended Options
"strict": true,
"jsx": "react-jsx",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsx compiler option is set to "react-jsx", but there are no React dependencies in package.json and the code doesn't use JSX. This option should be removed unless React is intended to be added.

Suggested change
"jsx": "react-jsx",

Copilot uses AI. Check for mistakes.
Comment thread assets/ts/tsconfig.json
"target": "esnext",
"types": [],
// For nodejs:
// "lib": ["esnext"],
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types array is set to empty ([]), but the code uses DOM APIs like document and window. Without specifying DOM types, TypeScript should throw errors unless lib includes DOM types. Consider adding "lib": ["ESNext", "DOM"] to ensure proper type checking for browser APIs.

Suggested change
// "lib": ["esnext"],
"lib": ["ESNext", "DOM"],

Copilot uses AI. Check for mistakes.
Comment thread assets/ts/tsconfig.json
// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "esnext",
"target": "esnext",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using "target": "esnext" is not recommended for production code as it's a moving target that changes with each TypeScript version. Consider using a specific version like "ES2022" (as used in the main ts/tsconfig.json) for consistency and predictability.

Suggested change
"target": "esnext",
"target": "ES2022",

Copilot uses AI. Check for mistakes.
Comment thread assets/ts/tsconfig.json

// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "esnext",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using "module": "esnext" is not recommended for production code as it's a moving target. Consider using a specific module format like "ES2022" or "ESNext" spelled consistently. The main ts/tsconfig.json uses "ESNext" (capital N).

Suggested change
"module": "esnext",
"module": "ESNext",

Copilot uses AI. Check for mistakes.
Comment thread assets/ts/package.json
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tsconfig.json uses "module": "esnext" and "target": "esnext", but package.json specifies "type": "commonjs". This creates a mismatch where TypeScript will emit ES modules but Node.js will expect CommonJS. Either change the package.json type to "module" or adjust the TypeScript module setting to align with CommonJS.

Suggested change
"type": "commonjs",
"type": "module",

Copilot uses AI. Check for mistakes.
@akumm2k akumm2k deleted the fix-js-404 branch December 14, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants