@backstage/cli-common 0.1.7 → 0.1.8
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +47 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that takes a set of path fragments and resolves them into a
|
|
3
|
+
* single complete path, relative to some root.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
declare type ResolveFunc = (...paths: string[]) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Common paths and resolve functions used by the cli.
|
|
10
|
+
* Currently assumes it is being executed within a monorepo.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
declare type Paths = {
|
|
15
|
+
ownDir: string;
|
|
16
|
+
ownRoot: string;
|
|
17
|
+
targetDir: string;
|
|
18
|
+
targetRoot: string;
|
|
19
|
+
resolveOwn: ResolveFunc;
|
|
20
|
+
resolveOwnRoot: ResolveFunc;
|
|
21
|
+
resolveTarget: ResolveFunc;
|
|
22
|
+
resolveTargetRoot: ResolveFunc;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Find paths related to a package and its execution context.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @example
|
|
29
|
+
*
|
|
30
|
+
* const paths = findPaths(__dirname)
|
|
31
|
+
*/
|
|
32
|
+
declare function findPaths(searchDir: string): Paths;
|
|
33
|
+
/**
|
|
34
|
+
* The name of the backstage's config file
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
declare const BACKSTAGE_JSON = "backstage.json";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Checks if path is the same as or a child path of base.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
declare function isChildPath(base: string, path: string): boolean;
|
|
46
|
+
|
|
47
|
+
export { BACKSTAGE_JSON, Paths, ResolveFunc, findPaths, isChildPath };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-common",
|
|
3
3
|
"description": "Common functionality used by cli, backend, and create-app",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.8",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"files": [
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e244b348c473700e7d5e5fbcef38bd9f9fd1d0ba"
|
|
43
43
|
}
|