feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,55 @@
|
||||
import { dirname, relative } from 'path';
|
||||
import * as yargs from 'yargs';
|
||||
const { wrapCallSite } = require('source-map-support');
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const resolveLine = (lineNumber: number, columnNumber: number, filePath: string) => {
|
||||
// Note: This is an undocumented function provided by source-map-support. It
|
||||
// may change in the future:
|
||||
const frame = wrapCallSite({
|
||||
getFileName: () => filePath,
|
||||
isEval: ()=>false,
|
||||
isNative: ()=>false,
|
||||
getLineNumber: ()=>lineNumber,
|
||||
getColumnNumber: ()=>columnNumber,
|
||||
});
|
||||
|
||||
const baseDir = dirname(dirname(dirname(__dirname)));
|
||||
const relativeFilePath = relative(baseDir, frame.getFileName());
|
||||
return `${relativeFilePath}:${frame.getLineNumber()}`;
|
||||
};
|
||||
|
||||
const resolvePosition = (position: string, sourceMap: string) => {
|
||||
const match = /^(\d{1,10}):(\d{1,10})$/.exec(position.trim());
|
||||
if (!match) {
|
||||
throw new Error('Invalid format. Expected line:col');
|
||||
}
|
||||
|
||||
const lineNumber = Number(match[1]);
|
||||
const columnNumber = Number(match[2]);
|
||||
return resolveLine(lineNumber, columnNumber, sourceMap);
|
||||
};
|
||||
|
||||
void yargs
|
||||
.usage('$0 [args]')
|
||||
.command(
|
||||
'$0 <position>',
|
||||
'Resolves a position based on a source map. If resolving a position in a specific error message, be sure to use the source map generated by "yarn bundle" from that specific commit.',
|
||||
(yargs) => {
|
||||
return yargs.options({
|
||||
'position': { type: 'string', help: 'A line:col position (e.g. 123:4567)' },
|
||||
'sourcemap': {
|
||||
type: 'string',
|
||||
default: './main-html.bundle.js',
|
||||
help: 'The path to the source map. This source map should be a source map compiled from the commit/release that created the error.',
|
||||
},
|
||||
});
|
||||
},
|
||||
async (args) => {
|
||||
console.log(await resolvePosition(args.position, args.sourcemap));
|
||||
process.exit(0);
|
||||
},
|
||||
)
|
||||
.help()
|
||||
.argv;
|
||||
在新工单中引用
屏蔽一个用户