@microtronics/studio-cli 1.1.0-alpha.1 → 1.1.0-alpha.3
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.md +21 -0
- package/dist/main.js +53 -49
- package/dist/studio-cli.d.ts +59 -2
- package/out/api.js +38 -34
- package/out/studio-cli.d.ts +59 -2
- package/package.json +1 -1
package/dist/studio-cli.d.ts
CHANGED
|
@@ -1945,9 +1945,51 @@ export declare namespace Dependencies {
|
|
|
1945
1945
|
* @param libraryName
|
|
1946
1946
|
*/
|
|
1947
1947
|
export function uninstallDependency(cwd: URI, fs: LocalFS, logger: Log.Logger, publisherId: string, libraryName: string): Promise<void>;
|
|
1948
|
+
/**
|
|
1949
|
+
* Read the npm workspace patterns declared in the root package.json, if any.
|
|
1950
|
+
* Supports both the array form (`workspaces: [...]`) and the object form (`workspaces: { packages: [...] }`).
|
|
1951
|
+
* Never throws - returns null if the file is missing, invalid JSON, or has no usable workspaces field.
|
|
1952
|
+
* @param cwd
|
|
1953
|
+
* @param fs
|
|
1954
|
+
*/
|
|
1955
|
+
export function readNpmWorkspacePatterns(cwd: URI, fs: LocalFS): Promise<string[] | null>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Check if the given working path is covered by any of the given npm workspace patterns.
|
|
1958
|
+
* @param workingPath
|
|
1959
|
+
* @param patterns
|
|
1960
|
+
*/
|
|
1961
|
+
export function isPathInWorkspaces(workingPath: string, patterns: string[]): boolean;
|
|
1962
|
+
/**
|
|
1963
|
+
* Plan which parts need a dedicated `npm install`/`npm ci` and whether a single install at the project root
|
|
1964
|
+
* covers the rest via npm workspaces.
|
|
1965
|
+
* @param parts
|
|
1966
|
+
* @param patterns - npm workspace patterns from the root package.json, or null if not a workspace root
|
|
1967
|
+
*/
|
|
1968
|
+
export function planNpmInstalls(parts: {
|
|
1969
|
+
name: string;
|
|
1970
|
+
workingPath: string;
|
|
1971
|
+
}[], patterns: string[] | null): {
|
|
1972
|
+
rootInstall: boolean;
|
|
1973
|
+
partInstalls: string[];
|
|
1974
|
+
};
|
|
1975
|
+
/**
|
|
1976
|
+
* Normalize the `dist/blo` and `dist/pov/details` `package.json` files of every already-installed library
|
|
1977
|
+
* reachable from the consumer's `libraryDependencies`/`libraryDevDependencies` (version stamping and
|
|
1978
|
+
* stripping of npm-invalid Studio-library dependency entries), walking each library's own
|
|
1979
|
+
* `libraryDependencies`/`libraryDevDependencies` transitively.
|
|
1980
|
+
* This fixes already-published libraries whose dist part files were never touched by a build with this fix.
|
|
1981
|
+
* A library not yet installed under `.studio/libdeps` is skipped silently. Errors normalizing an individual
|
|
1982
|
+
* library are logged and skipped - this must never break an install.
|
|
1983
|
+
* @param cwd
|
|
1984
|
+
* @param fs
|
|
1985
|
+
* @param logger
|
|
1986
|
+
*/
|
|
1987
|
+
export function normalizeInstalledLibraryParts(cwd: URI, fs: LocalFS, logger: Log.Logger): Promise<void>;
|
|
1948
1988
|
/**
|
|
1949
1989
|
* Install npm dependencies in pov and blo working paths if they exist and contain a package.json.
|
|
1950
1990
|
* This ensures that a single `studio install` command sets up the entire project.
|
|
1991
|
+
* If the root package.json declares npm workspaces that cover a part, the install is done once at the
|
|
1992
|
+
* project root instead of separately for each covered part.
|
|
1951
1993
|
* @param cwd
|
|
1952
1994
|
* @param fs
|
|
1953
1995
|
* @param logger
|
|
@@ -2441,8 +2483,14 @@ export declare enum HttpMethod {
|
|
|
2441
2483
|
|
|
2442
2484
|
/**
|
|
2443
2485
|
* Installs the specified dependencies or all dependencies if none are provided.
|
|
2444
|
-
* Additionally runs
|
|
2445
|
-
* ensuring a single install command sets up the entire project.
|
|
2486
|
+
* Additionally runs npm install in pov and blo working paths if they exist and contain a package.json,
|
|
2487
|
+
* ensuring a single install command sets up the entire project. When the root package.json declares npm
|
|
2488
|
+
* workspaces that cover a part, the npm dependencies are installed once at the project root instead of
|
|
2489
|
+
* separately for each covered part; parts not covered by any workspace pattern are still installed
|
|
2490
|
+
* individually. `npm install` is used instead of `npm ci` when no package-lock.json exists, or as a
|
|
2491
|
+
* fallback when the lockfile is out of sync with package.json. Before that, every already-installed library's
|
|
2492
|
+
* `dist/blo`/`dist/pov/details` `package.json` is normalized to the library's `studio.json` version and stripped
|
|
2493
|
+
* of any npm dependency entries that reference other Studio libraries.
|
|
2446
2494
|
*
|
|
2447
2495
|
* @param {URI} cwd - The current working directory where the installation process takes place.
|
|
2448
2496
|
* @param {LocalFS} fs - The file system interface used for managing files during the installation process.
|
|
@@ -2664,6 +2712,15 @@ export declare namespace Manifest {
|
|
|
2664
2712
|
* @param fs
|
|
2665
2713
|
*/
|
|
2666
2714
|
export function readAsBlob(cwd: URI, fs: LocalFS): Promise<Uint8Array>;
|
|
2715
|
+
/**
|
|
2716
|
+
* Read the studio.json manifest of an installed library, uncached and without the CLI's global `overwrites`
|
|
2717
|
+
* applied. Use this (instead of `read`) for reading manifests of installed libraries under `.studio/libdeps/`:
|
|
2718
|
+
* `read` returns a manifest deep-merged with CLI-flag overwrites (e.g. `--version`) meant for the current
|
|
2719
|
+
* project, which must never leak onto a library's own manifest.
|
|
2720
|
+
* @param cwd
|
|
2721
|
+
* @param fs
|
|
2722
|
+
*/
|
|
2723
|
+
export function readRaw(cwd: URI, fs: LocalFS): Promise<Manifest>;
|
|
2667
2724
|
/**
|
|
2668
2725
|
* Write the manifest to the workspace
|
|
2669
2726
|
* @param cwd
|