mirror of
https://github.com/tiennm99/blog.git
synced 2026-10-13 02:14:29 +00:00
refactor(scripts): unify module extensions on .js
The root package.json already declares "type": "module", so a .js file here is
ESM and the .mjs suffix only restates what the manifest states. Renames the three
GitHub Actions scripts and follows every reference, including the six JSDoc
import("...") type annotations that would otherwise degrade to any without
throwing.
This commit is contained in:
1 parent
d41176f149
commit
fdbbc5ba42
5 files changed
+10
-10
No files matched your search
File renamed without changes.
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Public URL of a repo: its declared homepage, else its GitHub Pages URL when
|
||||
* Pages is enabled. Returns an empty string when the repo has neither.
|
||||
* @param {import("./github-api.mjs").Repo} repo
|
||||
* @param {import("./github-api.js").Repo} repo
|
||||
* @returns {string}
|
||||
*/
|
||||
export function resolveUrl(repo) {
|
||||
@@ -48,7 +48,7 @@ function table(headers, rows) {
|
||||
|
||||
/**
|
||||
* Repos with at least one star, most-starred first.
|
||||
* @param {import("./github-api.mjs").Repo[]} repos
|
||||
* @param {import("./github-api.js").Repo[]} repos
|
||||
* @returns {string[]}
|
||||
*/
|
||||
export function renderStarred(repos) {
|
||||
@@ -63,7 +63,7 @@ export function renderStarred(repos) {
|
||||
|
||||
/**
|
||||
* Repos with a live demo URL.
|
||||
* @param {import("./github-api.mjs").Repo[]} repos
|
||||
* @param {import("./github-api.js").Repo[]} repos
|
||||
* @returns {string[]}
|
||||
*/
|
||||
export function renderDemo(repos) {
|
||||
@@ -77,7 +77,7 @@ export function renderDemo(repos) {
|
||||
|
||||
/**
|
||||
* Repos owned by others, by merged pull request count.
|
||||
* @param {import("./github-api.mjs").Contribution[]} contributions
|
||||
* @param {import("./github-api.js").Contribution[]} contributions
|
||||
* @returns {string[]}
|
||||
*/
|
||||
export function renderContributed(contributions) {
|
||||
@@ -15,14 +15,14 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
import { GitHubProjects } from "./lib/github-api.mjs";
|
||||
import { GitHubProjects } from "./lib/github-api.js";
|
||||
import {
|
||||
injectBlock,
|
||||
renderContributed,
|
||||
renderDemo,
|
||||
renderStarred,
|
||||
resolveUrl,
|
||||
} from "./lib/render-projects.mjs";
|
||||
} from "./lib/render-projects.js";
|
||||
|
||||
const PAGE = "content/page/projects/index.md";
|
||||
|
||||
@@ -33,8 +33,8 @@ const UNSTABLE_OWNERS = new Set(["tiennm99dev"]);
|
||||
|
||||
/**
|
||||
* Most recently pushed first; a repo with no timestamp sorts last.
|
||||
* @param {import("./lib/github-api.mjs").Repo} a
|
||||
* @param {import("./lib/github-api.mjs").Repo} b
|
||||
* @param {import("./lib/github-api.js").Repo} a
|
||||
* @param {import("./lib/github-api.js").Repo} b
|
||||
* @returns {number}
|
||||
*/
|
||||
const byRecentPush = (a, b) => (b.pushedAt || "").localeCompare(a.pushedAt || "");
|
||||
Reference in new issue
Block a user