Update package configuration to not use type module

This commit is contained in:
Jesse Hines 2025-03-29 11:08:27 -04:00
parent c189cde8a0
commit dc61389de9
No known key found for this signature in database
4 changed files with 11 additions and 11 deletions

View file

@ -31,7 +31,7 @@ jobs:
- name: Release
run: |
tag="${GITHUB_REF#refs/tags/}"
if [ -e styles.css ]; then
FILES="main.js manifest.json styles.css"
else

View file

@ -33,14 +33,14 @@ jobs:
run: npm run test:unit
# Get key to use for the .obsidian-cache GitHub cache.
# Run the wdio.conf.ts file directly, which logs the Obsidian versions to test, and use that
# output as the cache key.
# Run wdio.conf.mts directly, which will logs the Obsidian versions to test (see the
# `if (process.env.CI)` bit in wdio.conf.mts). We'll use that output as the cache key.
- id: get-cache-key
name: "Get Obsidian cache key"
shell: bash
run: |
npx tsx wdio.conf.ts > obsidian-versions-lock.txt
# Delete the cache created by wdio.conf.ts so it doesn't conflict with restore
npx tsx wdio.conf.mts > obsidian-versions-lock.txt
# Delete the cache created by wdio.conf.mts so it doesn't conflict with restore
rm -rf .obsidian-cache
env:
# Beta versions require authentication to download, so if you want to test beta versions,

View file

@ -3,7 +3,6 @@
"version": "1.0.4",
"description": "Add settings to open in new tab by default and prevent duplicate tabs.",
"main": "main.js",
"type": "module",
"scripts": {
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
@ -11,7 +10,7 @@
"version": "node version-bump.mjs && git add manifest.json versions.json",
"test": "run-s test:*",
"test:unit": "tsc --noEmit && mocha",
"test:e2e": "npm run build && npx wdio run ./wdio.conf.ts"
"test:e2e": "npm run build && npx wdio run ./wdio.conf.mts"
},
"keywords": [],
"author": "",

View file

@ -11,20 +11,21 @@ if (process.env.OBSIDIAN_VERSIONS) {
return [app, installer];
})
} else if (process.env.CI) {
// Running in GitHub workflow.
// You can use RUNNER_OS to select different versions on different platforms in the workflow matrix if you want
// Running in GitHub CI. You can use RUNNER_OS to select different versions on different
// platforms in the workflow matrix if you want
versions = [["earliest", "earliest"], ["latest", "latest"]];
if (await obsidianBetaAvailable(cacheDir)) {
versions.push(["latest-beta", "latest"]);
}
// Print the resolved Obsidian versions for use as the workflow cache key (see test_e2e.yaml)
// Print the resolved Obsidian versions to use as the workflow cache key
// (see .github/workflows/test.yaml)
for (let [app, installer] of versions) {
[app, installer] = await resolveObsidianVersions(app, installer, cacheDir);
console.log(`${app}/${installer}`);
}
} else {
versions = [["latest", "latest"], ["earliest", "earliest"]];
versions = [["earliest", "earliest"], ["latest", "latest"]];
}
export const config: WebdriverIO.Config = {