@file-viewer/cli 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -107
- package/README.md +3 -107
- package/catalog/catalog.json +562 -121
- package/dist/carrier-command.js +0 -3
- package/dist/cli.js +0 -3
- package/dist/index.js +6 -19
- package/dist/project-adapters.js +0 -6
- package/dist/url-security.js +0 -1
- package/package.json +30 -19
package/dist/carrier-command.js
CHANGED
|
@@ -29,9 +29,6 @@ export function createFileViewerCarrierCommand(manager, packageSpec, passthrough
|
|
|
29
29
|
const generation = options.yarnGeneration ?? detectYarnGeneration(options.projectRoot);
|
|
30
30
|
if (generation === 'berry')
|
|
31
31
|
return { command: 'yarn', args: ['dlx', packageSpec, ...passthrough], compatibilityMode: 'native' };
|
|
32
|
-
// Yarn Classic has no `dlx`. npm exec is non-mutating and ships with the
|
|
33
|
-
// supported Node runtime, so it is safer than adding a temporary dependency
|
|
34
|
-
// to the user's project. Unknown Yarn versions take the same conservative path.
|
|
35
32
|
return {
|
|
36
33
|
command: 'npm',
|
|
37
34
|
args: ['exec', '--yes', '--package', packageSpec, '--', 'file-viewer-copy-assets', ...passthrough],
|
package/dist/cli.js
CHANGED
|
@@ -1735,9 +1735,6 @@ async function main() {
|
|
|
1735
1735
|
}, args.json);
|
|
1736
1736
|
}
|
|
1737
1737
|
catch (error) {
|
|
1738
|
-
// A brand-new target is wholly CLI-owned. Remove a failed scaffold so a
|
|
1739
|
-
// package-manager or asset error never leaves a misleading half-project.
|
|
1740
|
-
// Existing directories are never recursively removed.
|
|
1741
1738
|
if (!existing && !projectExistedBefore) {
|
|
1742
1739
|
await rm(args.projectRoot, { recursive: true, force: true });
|
|
1743
1740
|
}
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,6 @@ const normalizeInstallSource = (source) => {
|
|
|
70
70
|
throw new Error('Install concurrency must be an integer from 1 to 32.');
|
|
71
71
|
}
|
|
72
72
|
const cacheDir = source.cacheDir?.trim();
|
|
73
|
-
// eslint-disable-next-line no-control-regex -- reject controls before resolving a local path
|
|
74
73
|
if (cacheDir && /[\u0000-\u001f\u007f]/.test(cacheDir))
|
|
75
74
|
throw new Error('Invalid cache directory.');
|
|
76
75
|
if (source.kind === 'registry') {
|
|
@@ -82,7 +81,6 @@ const normalizeInstallSource = (source) => {
|
|
|
82
81
|
};
|
|
83
82
|
}
|
|
84
83
|
const directory = source.directory?.trim();
|
|
85
|
-
// eslint-disable-next-line no-control-regex -- reject controls before resolving a local path
|
|
86
84
|
if (!directory || /[\u0000-\u001f\u007f]/.test(directory))
|
|
87
85
|
throw new Error('Invalid offline directory.');
|
|
88
86
|
return {
|
|
@@ -244,7 +242,6 @@ export function detectPackageManager(projectRoot) {
|
|
|
244
242
|
return declared;
|
|
245
243
|
}
|
|
246
244
|
catch {
|
|
247
|
-
// Lockfile detection below remains the compatibility fallback.
|
|
248
245
|
}
|
|
249
246
|
const candidates = [
|
|
250
247
|
['pnpm-lock.yaml', 'pnpm'],
|
|
@@ -273,9 +270,6 @@ function installStep(manager, packages, cwd, source, packageManagerVersion) {
|
|
|
273
270
|
if (registry && manager !== 'yarn')
|
|
274
271
|
extra.push('--registry', registry);
|
|
275
272
|
if (registry && manager === 'yarn') {
|
|
276
|
-
// Berry only accepts registry configuration through its environment. Keep
|
|
277
|
-
// these values for both generations, then add Classic's explicit flag once
|
|
278
|
-
// the project generation is known below.
|
|
279
273
|
env.npm_config_registry = registry;
|
|
280
274
|
env.YARN_NPM_REGISTRY_SERVER = registry;
|
|
281
275
|
}
|
|
@@ -317,8 +311,6 @@ function installStep(manager, packages, cwd, source, packageManagerVersion) {
|
|
|
317
311
|
env.YARN_ENABLE_NETWORK = 'false';
|
|
318
312
|
}
|
|
319
313
|
else {
|
|
320
|
-
// Yarn Classic does not reliably honor the Berry environment setting and
|
|
321
|
-
// can otherwise fall back to a user's global registry or proxy.
|
|
322
314
|
if (registry) {
|
|
323
315
|
extra.push('--registry', registry);
|
|
324
316
|
const registryHost = new URL(registry).hostname;
|
|
@@ -326,9 +318,6 @@ function installStep(manager, packages, cwd, source, packageManagerVersion) {
|
|
|
326
318
|
registryHost === '[::1]' ||
|
|
327
319
|
/^127(?:\.\d{1,3}){3}$/.test(registryHost);
|
|
328
320
|
if (isLoopbackRegistry) {
|
|
329
|
-
// Yarn Classic treats npm_config_proxy as authoritative even when
|
|
330
|
-
// NO_PROXY contains the loopback host. A loopback registry must never
|
|
331
|
-
// leave the machine, so bypass inherited proxies for this child only.
|
|
332
321
|
for (const name of [
|
|
333
322
|
'npm_config_proxy',
|
|
334
323
|
'npm_config_https_proxy',
|
|
@@ -1187,14 +1176,12 @@ export async function scaffoldFileViewerQuickstart(projectRoot, input, options =
|
|
|
1187
1176
|
]
|
|
1188
1177
|
]
|
|
1189
1178
|
: []),
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
]
|
|
1197
|
-
: []),
|
|
1179
|
+
[
|
|
1180
|
+
'vite.config.mjs',
|
|
1181
|
+
config.framework === 'svelte'
|
|
1182
|
+
? `import { defineConfig } from 'vite';\nimport { svelte } from '@sveltejs/vite-plugin-svelte';\nexport default defineConfig({ plugins: [svelte()], worker: { format: 'es' } });\n`
|
|
1183
|
+
: `import { defineConfig } from 'vite';\nexport default defineConfig({ worker: { format: 'es' } });\n`
|
|
1184
|
+
],
|
|
1198
1185
|
...(config.packageManager === 'yarn' &&
|
|
1199
1186
|
Number(config.packageManagerVersion?.match(/^(\d+)/)?.[1] ?? 0) >= 2
|
|
1200
1187
|
? [['.yarnrc.yml', 'nodeLinker: node-modules\nenableGlobalCache: true\n']]
|
package/dist/project-adapters.js
CHANGED
|
@@ -36,11 +36,6 @@ const normalizeProjectPath = (projectRoot, value, label) => {
|
|
|
36
36
|
}
|
|
37
37
|
return projectRelative.split(sep).join('/');
|
|
38
38
|
};
|
|
39
|
-
/**
|
|
40
|
-
* Tokenizes only the shell syntax needed to inspect package scripts. It never
|
|
41
|
-
* executes or expands variables. Shell substitutions deliberately make the
|
|
42
|
-
* result unsafe so the adapter can fail closed.
|
|
43
|
-
*/
|
|
44
39
|
const tokenizePackageScript = (command) => {
|
|
45
40
|
const tokens = [];
|
|
46
41
|
let current = '';
|
|
@@ -405,7 +400,6 @@ export async function inspectFileViewerProjectAdapter(projectRoot) {
|
|
|
405
400
|
: conventionalFiles(root, conventionalWebpackConfigs);
|
|
406
401
|
}
|
|
407
402
|
catch {
|
|
408
|
-
// The manual step below deliberately handles unsafe/uncontained configs.
|
|
409
403
|
}
|
|
410
404
|
return adapterResult('webpack', {
|
|
411
405
|
selectedConfigPath: configPaths.length === 1 ? configPaths[0] : undefined,
|
package/dist/url-security.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@file-viewer/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Create or integrate a File Viewer project with framework detection, selectable formats, offline packages, and self-hosted assets.",
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/flyfish-dev/file-viewer.git"
|
|
26
|
-
"directory": "packages/tools/cli"
|
|
25
|
+
"url": "git+https://github.com/flyfish-dev/file-viewer.git"
|
|
27
26
|
},
|
|
28
27
|
"homepage": "https://file-viewer.app/en/cli/",
|
|
29
28
|
"bugs": {
|
|
@@ -51,28 +50,40 @@
|
|
|
51
50
|
"./package.json": "./package.json"
|
|
52
51
|
},
|
|
53
52
|
"files": [
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
53
|
+
"catalog/catalog.json",
|
|
54
|
+
"dist/carrier-command.d.ts",
|
|
55
|
+
"dist/carrier-command.js",
|
|
56
|
+
"dist/cli.d.ts",
|
|
57
|
+
"dist/cli.js",
|
|
58
|
+
"dist/copy-assets.d.ts",
|
|
59
|
+
"dist/copy-assets.js",
|
|
60
|
+
"dist/index.d.ts",
|
|
61
|
+
"dist/index.js",
|
|
62
|
+
"dist/interactive-selection.d.ts",
|
|
63
|
+
"dist/interactive-selection.js",
|
|
64
|
+
"dist/offline.d.ts",
|
|
65
|
+
"dist/offline.js",
|
|
66
|
+
"dist/project-adapters.d.ts",
|
|
67
|
+
"dist/project-adapters.js",
|
|
68
|
+
"dist/types.d.ts",
|
|
69
|
+
"dist/types.js",
|
|
70
|
+
"dist/url-security.d.ts",
|
|
71
|
+
"dist/url-security.js",
|
|
72
|
+
"LICENSE",
|
|
57
73
|
"README.en.md",
|
|
58
|
-
"
|
|
74
|
+
"README.md"
|
|
59
75
|
],
|
|
60
76
|
"dependencies": {
|
|
61
|
-
"@file-viewer/asset-installer": "3.
|
|
62
|
-
},
|
|
63
|
-
"devDependencies": {
|
|
64
|
-
"@file-viewer/assets-standard": "3.1.1",
|
|
65
|
-
"@types/node": "^26.5.1",
|
|
66
|
-
"typescript": "^6.0.3"
|
|
77
|
+
"@file-viewer/asset-installer": "3.2.0"
|
|
67
78
|
},
|
|
68
79
|
"engines": {
|
|
69
80
|
"node": ">=20"
|
|
70
81
|
},
|
|
71
82
|
"license": "Apache-2.0",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
"fileViewer": {
|
|
84
|
+
"distribution": {
|
|
85
|
+
"schemaVersion": 1,
|
|
86
|
+
"mode": "runtime-only"
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
|
-
}
|
|
89
|
+
}
|