@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.
@@ -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 = {
@@ -1,10 +1,10 @@
1
1
  import type { Plugin, Shape, File, ts } from '..';
2
2
  export declare class PluginUsageTracker {
3
- private readonly sourcesConvertedToRecords;
4
- private readonly recordCountPerPlugin;
5
- clearPluginToRecordUsage(): void;
6
- addPluginToRecordUsage(plugin: Plugin, source: ts.Node | Shape | File, count: number): void;
7
- getRecordCountPerPlugin(): {
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
  }[];
@@ -2,21 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PluginUsageTracker = void 0;
4
4
  class PluginUsageTracker {
5
- sourcesConvertedToRecords = new Set();
6
- recordCountPerPlugin = new Map();
7
- clearPluginToRecordUsage() {
8
- this.sourcesConvertedToRecords.clear();
9
- this.recordCountPerPlugin.clear();
5
+ trackedSources = new Set();
6
+ shapeCountPerPlugin = new Map();
7
+ clearPluginShapeUsage() {
8
+ this.trackedSources.clear();
9
+ this.shapeCountPerPlugin.clear();
10
10
  }
11
- addPluginToRecordUsage(plugin, source, count) {
12
- if (!this.sourcesConvertedToRecords.has(source)) {
13
- this.sourcesConvertedToRecords.add(source);
14
- const existingCount = this.recordCountPerPlugin.get(plugin) ?? 0;
15
- this.recordCountPerPlugin.set(plugin, existingCount + count);
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
- getRecordCountPerPlugin() {
19
- return [...this.recordCountPerPlugin.entries()].map(([plugin, count]) => ({
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,yBAAyB,GAAgC,IAAI,GAAG,EAAE,CAAA;IAClE,oBAAoB,GAAwB,IAAI,GAAG,EAAE,CAAA;IAEtE,wBAAwB;QACpB,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAA;QACtC,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAA;IACrC,CAAC;IAED,sBAAsB,CAAC,MAAc,EAAE,MAA8B,EAAE,KAAa;QAChF,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAC1C,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAChE,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,GAAG,KAAK,CAAC,CAAA;QAChE,CAAC;IACL,CAAC;IAED,uBAAuB;QACnB,OAAO,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC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C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicenow/sdk-build-core",
3
- "version": "4.4.0",
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.0"
30
+ "@servicenow/sdk-core": "4.4.1"
31
31
  },
32
32
  "overrides": {
33
33
  "micromatch": "4.0.7"
@@ -3,6 +3,7 @@ import type { Record } from './shape'
3
3
  export type File = {
4
4
  path: string
5
5
  content: string
6
+ originalPath?: string
6
7
  }
7
8
 
8
9
  export type InstallCategory =
@@ -1,24 +1,24 @@
1
1
  import type { Plugin, Shape, File, ts } from '..'
2
2
 
3
3
  export class PluginUsageTracker {
4
- private readonly sourcesConvertedToRecords: Set<ts.Node | Shape | File> = new Set()
5
- private readonly recordCountPerPlugin: Map<Plugin, number> = new Map()
4
+ private readonly trackedSources: Set<ts.Node | Shape | File> = new Set()
5
+ private readonly shapeCountPerPlugin: Map<Plugin, number> = new Map()
6
6
 
7
- clearPluginToRecordUsage() {
8
- this.sourcesConvertedToRecords.clear()
9
- this.recordCountPerPlugin.clear()
7
+ clearPluginShapeUsage() {
8
+ this.trackedSources.clear()
9
+ this.shapeCountPerPlugin.clear()
10
10
  }
11
11
 
12
- addPluginToRecordUsage(plugin: Plugin, source: ts.Node | Shape | File, count: number) {
13
- if (!this.sourcesConvertedToRecords.has(source)) {
14
- this.sourcesConvertedToRecords.add(source)
15
- const existingCount = this.recordCountPerPlugin.get(plugin) ?? 0
16
- this.recordCountPerPlugin.set(plugin, existingCount + count)
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
- getRecordCountPerPlugin() {
21
- return [...this.recordCountPerPlugin.entries()].map(([plugin, count]) => ({
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
  }))