@servicenow/sdk-build-core 4.4.0 → 4.4.1
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/dist/plugins/file.d.ts +1 -0
- package/dist/plugins/usage.d.ts +5 -5
- package/dist/plugins/usage.js +12 -12
- package/dist/plugins/usage.js.map +1 -1
- package/package.json +2 -2
- package/src/plugins/file.ts +1 -0
- package/src/plugins/usage.ts +12 -12
package/dist/plugins/file.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Record } from './shape';
|
|
|
2
2
|
export type File = {
|
|
3
3
|
path: string;
|
|
4
4
|
content: string;
|
|
5
|
+
originalPath?: string;
|
|
5
6
|
};
|
|
6
7
|
export type InstallCategory = 'dictionary' | 'unload' | 'unload.demo' | 'update' | 'apply_once' | 'scope' | 'author_elective_update' | '';
|
|
7
8
|
export type OutputFile = {
|
package/dist/plugins/usage.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Plugin, Shape, File, ts } from '..';
|
|
2
2
|
export declare class PluginUsageTracker {
|
|
3
|
-
private readonly
|
|
4
|
-
private readonly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
private readonly trackedSources;
|
|
4
|
+
private readonly shapeCountPerPlugin;
|
|
5
|
+
clearPluginShapeUsage(): void;
|
|
6
|
+
addPluginShapeUsage(plugin: Plugin, source: ts.Node | Shape | File): void;
|
|
7
|
+
getShapeCountPerPlugin(): {
|
|
8
8
|
plugin: string;
|
|
9
9
|
count: number;
|
|
10
10
|
}[];
|
package/dist/plugins/usage.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PluginUsageTracker = void 0;
|
|
4
4
|
class PluginUsageTracker {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
5
|
+
trackedSources = new Set();
|
|
6
|
+
shapeCountPerPlugin = new Map();
|
|
7
|
+
clearPluginShapeUsage() {
|
|
8
|
+
this.trackedSources.clear();
|
|
9
|
+
this.shapeCountPerPlugin.clear();
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
if (!this.
|
|
13
|
-
this.
|
|
14
|
-
const existingCount = this.
|
|
15
|
-
this.
|
|
11
|
+
addPluginShapeUsage(plugin, source) {
|
|
12
|
+
if (!this.trackedSources.has(source)) {
|
|
13
|
+
this.trackedSources.add(source);
|
|
14
|
+
const existingCount = this.shapeCountPerPlugin.get(plugin) ?? 0;
|
|
15
|
+
this.shapeCountPerPlugin.set(plugin, existingCount + 1);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
return [...this.
|
|
18
|
+
getShapeCountPerPlugin() {
|
|
19
|
+
return [...this.shapeCountPerPlugin.entries()].map(([plugin, count]) => ({
|
|
20
20
|
plugin: plugin.getName().replace(/Plugin$/, ''), //Report just the names 'ACL', 'Record', etc for existing metrics compatibility
|
|
21
21
|
count,
|
|
22
22
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/plugins/usage.ts"],"names":[],"mappings":";;;AAEA,MAAa,kBAAkB;IACV,
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/plugins/usage.ts"],"names":[],"mappings":";;;AAEA,MAAa,kBAAkB;IACV,cAAc,GAAgC,IAAI,GAAG,EAAE,CAAA;IACvD,mBAAmB,GAAwB,IAAI,GAAG,EAAE,CAAA;IAErE,qBAAqB;QACjB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAA;QAC3B,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAA;IACpC,CAAC;IAED,mBAAmB,CAAC,MAAc,EAAE,MAA8B;QAC9D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAC/D,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,CAAC,CAAA;QAC3D,CAAC;IACL,CAAC;IAED,sBAAsB;QAClB,OAAO,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YACrE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,+EAA+E;YAChI,KAAK;SACR,CAAC,CAAC,CAAA;IACP,CAAC;CACJ;AAvBD,gDAuBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicenow/sdk-build-core",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "ServiceNow SDK Build System Core Libraries",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"xml-js": "1.6.11",
|
|
28
28
|
"xmlbuilder2": "3.1.1",
|
|
29
29
|
"zod": "3.22.4",
|
|
30
|
-
"@servicenow/sdk-core": "4.4.
|
|
30
|
+
"@servicenow/sdk-core": "4.4.1"
|
|
31
31
|
},
|
|
32
32
|
"overrides": {
|
|
33
33
|
"micromatch": "4.0.7"
|
package/src/plugins/file.ts
CHANGED
package/src/plugins/usage.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { Plugin, Shape, File, ts } from '..'
|
|
2
2
|
|
|
3
3
|
export class PluginUsageTracker {
|
|
4
|
-
private readonly
|
|
5
|
-
private readonly
|
|
4
|
+
private readonly trackedSources: Set<ts.Node | Shape | File> = new Set()
|
|
5
|
+
private readonly shapeCountPerPlugin: Map<Plugin, number> = new Map()
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
7
|
+
clearPluginShapeUsage() {
|
|
8
|
+
this.trackedSources.clear()
|
|
9
|
+
this.shapeCountPerPlugin.clear()
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
if (!this.
|
|
14
|
-
this.
|
|
15
|
-
const existingCount = this.
|
|
16
|
-
this.
|
|
12
|
+
addPluginShapeUsage(plugin: Plugin, source: ts.Node | Shape | File) {
|
|
13
|
+
if (!this.trackedSources.has(source)) {
|
|
14
|
+
this.trackedSources.add(source)
|
|
15
|
+
const existingCount = this.shapeCountPerPlugin.get(plugin) ?? 0
|
|
16
|
+
this.shapeCountPerPlugin.set(plugin, existingCount + 1)
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
return [...this.
|
|
20
|
+
getShapeCountPerPlugin() {
|
|
21
|
+
return [...this.shapeCountPerPlugin.entries()].map(([plugin, count]) => ({
|
|
22
22
|
plugin: plugin.getName().replace(/Plugin$/, ''), //Report just the names 'ACL', 'Record', etc for existing metrics compatibility
|
|
23
23
|
count,
|
|
24
24
|
}))
|