@servicenow/sdk-build-core 3.0.3 → 4.0.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/dist/app.d.ts +25 -0
- package/dist/app.js +8 -0
- package/dist/app.js.map +1 -0
- package/dist/compiler.d.ts +60 -0
- package/dist/compiler.js +320 -0
- package/dist/compiler.js.map +1 -0
- package/dist/compression.d.ts +7 -0
- package/dist/compression.js +79 -0
- package/dist/compression.js.map +1 -0
- package/dist/crypto.d.ts +1 -0
- package/dist/crypto.js +9 -0
- package/dist/crypto.js.map +1 -0
- package/dist/diagnostic.d.ts +41 -0
- package/dist/diagnostic.js +130 -0
- package/dist/diagnostic.js.map +1 -0
- package/dist/{plugins/Diagnostic.d.ts → fluent-diagnostic.d.ts} +3 -2
- package/dist/fluent-diagnostic.js +23 -0
- package/dist/fluent-diagnostic.js.map +1 -0
- package/dist/fluent-directive.d.ts +8 -0
- package/dist/fluent-directive.js +54 -0
- package/dist/fluent-directive.js.map +1 -0
- package/dist/fluent-file.d.ts +5 -0
- package/dist/fluent-file.js +15 -0
- package/dist/fluent-file.js.map +1 -0
- package/dist/formatter.d.ts +11 -0
- package/dist/formatter.js +77 -0
- package/dist/formatter.js.map +1 -0
- package/dist/fs.d.ts +174 -0
- package/dist/fs.js +313 -0
- package/dist/fs.js.map +1 -0
- package/dist/guid.d.ts +2 -0
- package/dist/{GUID.js → guid.js} +3 -6
- package/dist/guid.js.map +1 -0
- package/dist/index.d.ts +19 -5
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +5 -0
- package/dist/json.js +43 -0
- package/dist/json.js.map +1 -0
- package/dist/keys-registry.d.ts +64 -0
- package/dist/keys-registry.js +339 -0
- package/dist/keys-registry.js.map +1 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.js +17 -0
- package/dist/logger.js.map +1 -0
- package/dist/now-config.d.ts +348 -0
- package/dist/now-config.js +283 -0
- package/dist/now-config.js.map +1 -0
- package/dist/path.d.ts +3 -0
- package/dist/path.js +12 -0
- package/dist/path.js.map +1 -0
- package/dist/plugins/cache.d.ts +20 -0
- package/dist/plugins/cache.js +46 -0
- package/dist/plugins/cache.js.map +1 -0
- package/dist/plugins/context.d.ts +85 -0
- package/dist/plugins/{Context.js → context.js} +1 -1
- package/dist/plugins/context.js.map +1 -0
- package/dist/plugins/database.d.ts +27 -0
- package/dist/plugins/database.js +102 -0
- package/dist/plugins/database.js.map +1 -0
- package/dist/plugins/file.d.ts +10 -0
- package/dist/plugins/{behaviors/Arranger.js → file.js} +1 -1
- package/dist/plugins/file.js.map +1 -0
- package/dist/plugins/index.d.ts +9 -5
- package/dist/plugins/index.js +9 -6
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/plugin.d.ts +478 -0
- package/dist/plugins/plugin.js +533 -0
- package/dist/plugins/plugin.js.map +1 -0
- package/dist/plugins/product.d.ts +15 -0
- package/dist/plugins/product.js +38 -0
- package/dist/plugins/product.js.map +1 -0
- package/dist/plugins/project.d.ts +25 -0
- package/dist/plugins/{behaviors/Generator.js → project.js} +1 -1
- package/dist/plugins/project.js.map +1 -0
- package/dist/plugins/shape.d.ts +424 -0
- package/dist/plugins/shape.js +1181 -0
- package/dist/plugins/shape.js.map +1 -0
- package/dist/plugins/time.d.ts +12 -0
- package/dist/plugins/time.js +84 -0
- package/dist/plugins/time.js.map +1 -0
- package/dist/plugins/usage.d.ts +11 -0
- package/dist/plugins/usage.js +26 -0
- package/dist/plugins/usage.js.map +1 -0
- package/dist/prettier/config-loader.d.ts +13 -0
- package/dist/prettier/config-loader.js +105 -0
- package/dist/prettier/config-loader.js.map +1 -0
- package/dist/telemetry/index.d.ts +25 -0
- package/dist/telemetry/index.js +18 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/typescript.d.ts +293 -0
- package/dist/typescript.js +454 -0
- package/dist/typescript.js.map +1 -0
- package/dist/util/get-file-type.d.ts +2 -0
- package/dist/util/get-file-type.js +13 -0
- package/dist/util/get-file-type.js.map +1 -0
- package/dist/util/index.d.ts +2 -6
- package/dist/util/index.js +2 -6
- package/dist/util/index.js.map +1 -1
- package/dist/util/{Scope.js → is-sn-scope.js} +1 -1
- package/dist/util/is-sn-scope.js.map +1 -0
- package/dist/xml.d.ts +24 -0
- package/dist/xml.js +71 -0
- package/dist/xml.js.map +1 -0
- package/now.config.schema.json +336 -0
- package/package.json +22 -12
- package/src/app.ts +33 -0
- package/src/compiler.ts +384 -0
- package/src/compression.ts +93 -0
- package/src/crypto.ts +5 -0
- package/src/diagnostic.ts +108 -0
- package/src/{plugins/Diagnostic.ts → fluent-diagnostic.ts} +3 -10
- package/src/fluent-directive.ts +63 -0
- package/src/fluent-file.ts +13 -0
- package/src/formatter.ts +58 -0
- package/src/fs.ts +438 -0
- package/src/{GUID.ts → guid.ts} +2 -6
- package/src/index.ts +19 -5
- package/src/json.ts +20 -0
- package/src/keys-registry.ts +384 -0
- package/src/logger.ts +20 -0
- package/src/now-config.ts +337 -0
- package/src/path.ts +9 -0
- package/src/plugins/cache.ts +45 -0
- package/src/plugins/context.ts +93 -0
- package/src/plugins/database.ts +121 -0
- package/src/plugins/file.ts +19 -0
- package/src/plugins/index.ts +9 -5
- package/src/plugins/plugin.ts +995 -0
- package/src/plugins/product.ts +44 -0
- package/src/plugins/project.ts +39 -0
- package/src/plugins/shape.ts +1532 -0
- package/src/plugins/time.ts +108 -0
- package/src/plugins/usage.ts +26 -0
- package/src/prettier/config-loader.ts +130 -0
- package/src/telemetry/index.ts +27 -0
- package/src/typescript.ts +502 -0
- package/src/util/get-file-type.ts +11 -0
- package/src/util/index.ts +2 -6
- package/src/xml.ts +86 -0
- package/dist/GUID.d.ts +0 -2
- package/dist/GUID.js.map +0 -1
- package/dist/IncludePaths.d.ts +0 -25
- package/dist/IncludePaths.js +0 -97
- package/dist/IncludePaths.js.map +0 -1
- package/dist/Keys.d.ts +0 -32
- package/dist/Keys.js +0 -245
- package/dist/Keys.js.map +0 -1
- package/dist/TypeScript.d.ts +0 -5
- package/dist/TypeScript.js +0 -58
- package/dist/TypeScript.js.map +0 -1
- package/dist/XML.d.ts +0 -32
- package/dist/XML.js +0 -83
- package/dist/XML.js.map +0 -1
- package/dist/plugins/Context.d.ts +0 -190
- package/dist/plugins/Context.js.map +0 -1
- package/dist/plugins/Diagnostic.js +0 -28
- package/dist/plugins/Diagnostic.js.map +0 -1
- package/dist/plugins/Plugin.d.ts +0 -175
- package/dist/plugins/Plugin.js +0 -15
- package/dist/plugins/Plugin.js.map +0 -1
- package/dist/plugins/behaviors/Arranger.d.ts +0 -26
- package/dist/plugins/behaviors/Arranger.js.map +0 -1
- package/dist/plugins/behaviors/Composer.d.ts +0 -102
- package/dist/plugins/behaviors/Composer.js +0 -15
- package/dist/plugins/behaviors/Composer.js.map +0 -1
- package/dist/plugins/behaviors/Diagnostics.d.ts +0 -7
- package/dist/plugins/behaviors/Diagnostics.js +0 -3
- package/dist/plugins/behaviors/Diagnostics.js.map +0 -1
- package/dist/plugins/behaviors/Generator.d.ts +0 -21
- package/dist/plugins/behaviors/Generator.js.map +0 -1
- package/dist/plugins/behaviors/OwnedTables.d.ts +0 -6
- package/dist/plugins/behaviors/OwnedTables.js +0 -3
- package/dist/plugins/behaviors/OwnedTables.js.map +0 -1
- package/dist/plugins/behaviors/PostProcessor.d.ts +0 -5
- package/dist/plugins/behaviors/PostProcessor.js +0 -3
- package/dist/plugins/behaviors/PostProcessor.js.map +0 -1
- package/dist/plugins/behaviors/Serializer.d.ts +0 -30
- package/dist/plugins/behaviors/Serializer.js +0 -3
- package/dist/plugins/behaviors/Serializer.js.map +0 -1
- package/dist/plugins/behaviors/Transformer.d.ts +0 -23
- package/dist/plugins/behaviors/Transformer.js +0 -3
- package/dist/plugins/behaviors/Transformer.js.map +0 -1
- package/dist/plugins/behaviors/extractors/Data.d.ts +0 -119
- package/dist/plugins/behaviors/extractors/Data.js +0 -244
- package/dist/plugins/behaviors/extractors/Data.js.map +0 -1
- package/dist/plugins/behaviors/extractors/Extractors.d.ts +0 -63
- package/dist/plugins/behaviors/extractors/Extractors.js +0 -3
- package/dist/plugins/behaviors/extractors/Extractors.js.map +0 -1
- package/dist/plugins/behaviors/extractors/index.d.ts +0 -2
- package/dist/plugins/behaviors/extractors/index.js +0 -19
- package/dist/plugins/behaviors/extractors/index.js.map +0 -1
- package/dist/plugins/behaviors/index.d.ts +0 -9
- package/dist/plugins/behaviors/index.js +0 -26
- package/dist/plugins/behaviors/index.js.map +0 -1
- package/dist/plugins/util/CallExpression.d.ts +0 -5
- package/dist/plugins/util/CallExpression.js +0 -88
- package/dist/plugins/util/CallExpression.js.map +0 -1
- package/dist/plugins/util/CodeTransformation.d.ts +0 -95
- package/dist/plugins/util/CodeTransformation.js +0 -624
- package/dist/plugins/util/CodeTransformation.js.map +0 -1
- package/dist/plugins/util/ObjectLiteral.d.ts +0 -9
- package/dist/plugins/util/ObjectLiteral.js +0 -37
- package/dist/plugins/util/ObjectLiteral.js.map +0 -1
- package/dist/plugins/util/index.d.ts +0 -3
- package/dist/plugins/util/index.js +0 -20
- package/dist/plugins/util/index.js.map +0 -1
- package/dist/util/Debug.d.ts +0 -4
- package/dist/util/Debug.js +0 -20
- package/dist/util/Debug.js.map +0 -1
- package/dist/util/Directive.d.ts +0 -16
- package/dist/util/Directive.js +0 -107
- package/dist/util/Directive.js.map +0 -1
- package/dist/util/RuntimeTableSchema.d.ts +0 -5
- package/dist/util/RuntimeTableSchema.js +0 -58
- package/dist/util/RuntimeTableSchema.js.map +0 -1
- package/dist/util/Scope.js.map +0 -1
- package/dist/util/Util.d.ts +0 -1
- package/dist/util/Util.js +0 -12
- package/dist/util/Util.js.map +0 -1
- package/dist/util/XMLUploadParser.d.ts +0 -22
- package/dist/util/XMLUploadParser.js +0 -67
- package/dist/util/XMLUploadParser.js.map +0 -1
- package/src/IncludePaths.ts +0 -122
- package/src/Keys.ts +0 -274
- package/src/TypeScript.ts +0 -65
- package/src/XML.ts +0 -98
- package/src/plugins/Context.ts +0 -239
- package/src/plugins/Plugin.ts +0 -278
- package/src/plugins/behaviors/Arranger.ts +0 -42
- package/src/plugins/behaviors/Composer.ts +0 -125
- package/src/plugins/behaviors/Diagnostics.ts +0 -12
- package/src/plugins/behaviors/Generator.ts +0 -31
- package/src/plugins/behaviors/OwnedTables.ts +0 -5
- package/src/plugins/behaviors/PostProcessor.ts +0 -6
- package/src/plugins/behaviors/Serializer.ts +0 -40
- package/src/plugins/behaviors/Transformer.ts +0 -32
- package/src/plugins/behaviors/extractors/Data.ts +0 -332
- package/src/plugins/behaviors/extractors/Extractors.ts +0 -73
- package/src/plugins/behaviors/extractors/index.ts +0 -2
- package/src/plugins/behaviors/index.ts +0 -9
- package/src/plugins/util/CallExpression.ts +0 -110
- package/src/plugins/util/CodeTransformation.ts +0 -731
- package/src/plugins/util/ObjectLiteral.ts +0 -37
- package/src/plugins/util/index.ts +0 -3
- package/src/util/Debug.ts +0 -24
- package/src/util/Directive.ts +0 -123
- package/src/util/RuntimeTableSchema.ts +0 -44
- package/src/util/Util.ts +0 -7
- package/src/util/XMLUploadParser.ts +0 -90
- /package/dist/util/{Scope.d.ts → is-sn-scope.d.ts} +0 -0
- /package/src/util/{Scope.ts → is-sn-scope.ts} +0 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"description": "ServiceNow SDK configuration schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Schema file to validate this configuration file"
|
|
10
|
+
},
|
|
11
|
+
"scope": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 4,
|
|
14
|
+
"maxLength": 18,
|
|
15
|
+
"pattern": "^((x|sn)_[a-z0-9_]+|global)$",
|
|
16
|
+
"description": "Scope of the application (example: 'x_myapp' or 'sn_myapp')"
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 4,
|
|
21
|
+
"maxLength": 100,
|
|
22
|
+
"description": "Name of the application (example: 'MyApp')"
|
|
23
|
+
},
|
|
24
|
+
"scopeId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 32,
|
|
27
|
+
"maxLength": 32,
|
|
28
|
+
"pattern": "^[0-9a-f]{32}$",
|
|
29
|
+
"description": "Scope ID of the application (example: 'fc1b5713c3db3110d6489a038a40dd85')"
|
|
30
|
+
},
|
|
31
|
+
"entitiesDir": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1,
|
|
34
|
+
"deprecated": true,
|
|
35
|
+
"description": "DEPRECATED: Use 'fluentDir' instead"
|
|
36
|
+
},
|
|
37
|
+
"fluentDir": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"minLength": 1,
|
|
40
|
+
"description": "Directory containing .now.ts fluent files of the application",
|
|
41
|
+
"default": "src/fluent"
|
|
42
|
+
},
|
|
43
|
+
"clientDir": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Directory containing client files of the application, such as HTML and TypeScript files. Set to empty to disable the client build.",
|
|
46
|
+
"default": "src/client"
|
|
47
|
+
},
|
|
48
|
+
"generatedDir": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"minLength": 1,
|
|
51
|
+
"description": "Directory relative to 'fluentDir' where Fluent will generate files, such as keys.ts",
|
|
52
|
+
"default": "generated"
|
|
53
|
+
},
|
|
54
|
+
"staticContentDir": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 1,
|
|
57
|
+
"description": "Directory containing static asset files of the application",
|
|
58
|
+
"default": "dist/static"
|
|
59
|
+
},
|
|
60
|
+
"staticContentPaths": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"description": "Mapping of source files to static output paths.",
|
|
63
|
+
"patternProperties": {
|
|
64
|
+
".*": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"minLength": 1
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"npmUpdateCheck": {
|
|
71
|
+
"type": [
|
|
72
|
+
"number",
|
|
73
|
+
"boolean"
|
|
74
|
+
],
|
|
75
|
+
"default": 10
|
|
76
|
+
},
|
|
77
|
+
"serverModulesDir": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"description": "Directory containing modular files to be built into sys_modules",
|
|
80
|
+
"default": "src/server"
|
|
81
|
+
},
|
|
82
|
+
"modulePaths": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "Mapping between file glob patterns to resolve imported file paths to valid runtime paths. This is needed if your Fluent files are importing modules from a different location than the runtime modules. For example, if you have a custom TypeScript setup that transpiles modules from a 'src' directory to a 'dist' directory, you would need to specify that mapping here.",
|
|
85
|
+
"patternProperties": {
|
|
86
|
+
".*": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"tsconfigPath": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Path to tsconfig file to be used for transpilation of server module typescript. ServiceNow SDK will emit build errors following the referenced tsconfig. (example: './src/server/tsconfig.json')"
|
|
94
|
+
},
|
|
95
|
+
"transpiledSourceDir": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"deprecated": true,
|
|
98
|
+
"description": "DEPRECATED: Use 'modulePaths' instead"
|
|
99
|
+
},
|
|
100
|
+
"metadataDir": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Directory containing metadata xml for the app",
|
|
103
|
+
"default": "metadata"
|
|
104
|
+
},
|
|
105
|
+
"appOutputDir": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "Location to output built application for packaging during fluent build command",
|
|
108
|
+
"default": "dist/app"
|
|
109
|
+
},
|
|
110
|
+
"packOutputDir": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "Location to output the zip file during build process, to be later installed on the instance during install command",
|
|
113
|
+
"default": "target"
|
|
114
|
+
},
|
|
115
|
+
"sourceDir": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"deprecated": true,
|
|
118
|
+
"description": "DEPRECATED: This is no longer needed"
|
|
119
|
+
},
|
|
120
|
+
"ignoreTransformTableList": {
|
|
121
|
+
"type": "array",
|
|
122
|
+
"description": "List of tables to ignore when transforming entities to ServiceNow tables",
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"minLength": 1,
|
|
126
|
+
"pattern": "^[a-z_\\d]+$"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
"dependencies": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"description": "Reference dependencies on other ServiceNow application tables and entities",
|
|
134
|
+
"properties": {
|
|
135
|
+
"applications": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"deprecated": true,
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"description": "List of applications that this application depends on",
|
|
140
|
+
"patternProperties": {
|
|
141
|
+
"^global$|^x|sn_[a-z0-9_]+$": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"additionalProperties": false,
|
|
144
|
+
"properties": {
|
|
145
|
+
"tables": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"description": "List of tables that this application depends on (example: 'cmdb_ci')",
|
|
148
|
+
"items": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"minLength": 1,
|
|
151
|
+
"pattern": "^[a-z_][a-z0-9_]*[a-z0-9]$"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"active": {
|
|
161
|
+
"type": "boolean",
|
|
162
|
+
"description": "Is the application active"
|
|
163
|
+
},
|
|
164
|
+
"accessControls": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"description": "Manage scoping restrictions and access to the application",
|
|
168
|
+
"properties": {
|
|
169
|
+
"scopedAdministration": {
|
|
170
|
+
"type": "boolean",
|
|
171
|
+
"description": "If true, System Admins will be prevented from accessing the application",
|
|
172
|
+
"default": false
|
|
173
|
+
},
|
|
174
|
+
"canEditInStudio": {
|
|
175
|
+
"type": "boolean",
|
|
176
|
+
"description": "Can the application be opened in developer studio",
|
|
177
|
+
"default": true
|
|
178
|
+
},
|
|
179
|
+
"runtimeAccessTracking": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"enum": [
|
|
182
|
+
"none",
|
|
183
|
+
"permissive",
|
|
184
|
+
"enforcing"
|
|
185
|
+
],
|
|
186
|
+
"description": "Runtime access tracking for the application",
|
|
187
|
+
"default": "permissive"
|
|
188
|
+
},
|
|
189
|
+
"restrictTableAccess": {
|
|
190
|
+
"type": "boolean",
|
|
191
|
+
"description": "Restrict design time access to tables from outside the application",
|
|
192
|
+
"default": false
|
|
193
|
+
},
|
|
194
|
+
"private": {
|
|
195
|
+
"type": "boolean",
|
|
196
|
+
"description": "Mark the application as private",
|
|
197
|
+
"default": false
|
|
198
|
+
},
|
|
199
|
+
"trackable": {
|
|
200
|
+
"type": "boolean",
|
|
201
|
+
"description": "Mark the application as trackable",
|
|
202
|
+
"default": true
|
|
203
|
+
},
|
|
204
|
+
"uninstallBlocked": {
|
|
205
|
+
"type": "boolean",
|
|
206
|
+
"description": "Uninstall blocked for the application",
|
|
207
|
+
"default": false
|
|
208
|
+
},
|
|
209
|
+
"hideOnUI": {
|
|
210
|
+
"type": "boolean",
|
|
211
|
+
"description": "Application hidden in UI",
|
|
212
|
+
"default": false
|
|
213
|
+
},
|
|
214
|
+
"userRole": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"description": "Role required for end users to access the application and its tables",
|
|
217
|
+
"pattern": "^[0-9a-f]{32}$"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"jsLevel": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"enum": [
|
|
224
|
+
"es_latest",
|
|
225
|
+
"helsinki_es5",
|
|
226
|
+
"traditional"
|
|
227
|
+
],
|
|
228
|
+
"description": "JavaScript level for the application",
|
|
229
|
+
"default": "es_latest"
|
|
230
|
+
},
|
|
231
|
+
"licensing": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"additionalProperties": false,
|
|
234
|
+
"description": " If this application is licensable, set the subscription requirement and model.",
|
|
235
|
+
"properties": {
|
|
236
|
+
"licensable": {
|
|
237
|
+
"type": "boolean",
|
|
238
|
+
"description": "Mark package as licensable",
|
|
239
|
+
"default": true
|
|
240
|
+
},
|
|
241
|
+
"enforceLicense": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"enum": [
|
|
244
|
+
"none",
|
|
245
|
+
"log",
|
|
246
|
+
"enforce"
|
|
247
|
+
],
|
|
248
|
+
"description": "Subscription requirement for the application",
|
|
249
|
+
"default": "log"
|
|
250
|
+
},
|
|
251
|
+
"licenseModel": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"enum": [
|
|
254
|
+
"none",
|
|
255
|
+
"fulfiller",
|
|
256
|
+
"producer",
|
|
257
|
+
"capacity",
|
|
258
|
+
"mixed",
|
|
259
|
+
"app_use"
|
|
260
|
+
],
|
|
261
|
+
"description": "License model for the application",
|
|
262
|
+
"default": "none"
|
|
263
|
+
},
|
|
264
|
+
"licenseCategory": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"enum": [
|
|
267
|
+
"none",
|
|
268
|
+
"general",
|
|
269
|
+
"beta"
|
|
270
|
+
],
|
|
271
|
+
"description": "License category for the application",
|
|
272
|
+
"default": "none"
|
|
273
|
+
},
|
|
274
|
+
"subscriptionEntitlement": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"description": "SysID of the subscription entitlement for the application",
|
|
277
|
+
"pattern": "^[0-9a-f]{32}$"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"menu": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"description": "SysID of the application's primary menu for default table modules",
|
|
284
|
+
"pattern": "^[0-9a-f]{32}$"
|
|
285
|
+
},
|
|
286
|
+
"description": {
|
|
287
|
+
"type": "string",
|
|
288
|
+
"description": "Description of the application"
|
|
289
|
+
},
|
|
290
|
+
"logo": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"description": "SysID of the app logo",
|
|
293
|
+
"pattern": "^[0-9a-f]{32}$"
|
|
294
|
+
},
|
|
295
|
+
"guidedSetupGuid": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"description": "SysID of the Guided Setup to start when the application is upgraded",
|
|
298
|
+
"pattern": "^[0-9a-f]{32}$"
|
|
299
|
+
},
|
|
300
|
+
"installedAsDependency": {
|
|
301
|
+
"type": "boolean",
|
|
302
|
+
"description": "App was installed as a dependency",
|
|
303
|
+
"default": false
|
|
304
|
+
},
|
|
305
|
+
"scripts": {
|
|
306
|
+
"type": "object",
|
|
307
|
+
"description": "Define scripts that are executed with the SDK task runner. The task functions are async and are passed APIs for cross-environment compatibility. Use prebuild to run a script before the build process for custom build tasks.",
|
|
308
|
+
"patternProperties": {
|
|
309
|
+
".*": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"pattern": "\\.m?js$"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
"tableOutputFormat": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"enum": [
|
|
318
|
+
"bootstrap",
|
|
319
|
+
"component"
|
|
320
|
+
],
|
|
321
|
+
"default": "bootstrap",
|
|
322
|
+
"description": "Artifact type built for table definitions. Traditional bootstrap or separate component records."
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"required": [
|
|
326
|
+
"scope",
|
|
327
|
+
"scopeId"
|
|
328
|
+
],
|
|
329
|
+
"not": {
|
|
330
|
+
"required": [
|
|
331
|
+
"modulePaths",
|
|
332
|
+
"tsconfigPath"
|
|
333
|
+
],
|
|
334
|
+
"message": "Cannot specify both 'modulePaths' and 'tsconfigPath'. Use 'tsconfigPath' to supply a custom tsconfig.json file to use for internal transpilation during build. Use 'modulePaths' to map paths from 'serverModulesDir' to output directory if using a separate transpilation step"
|
|
335
|
+
}
|
|
336
|
+
}
|
package/package.json
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicenow/sdk-build-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "ServiceNow SDK Build System Core Libraries",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"src"
|
|
9
|
+
"src",
|
|
10
|
+
"now.config.schema.json"
|
|
10
11
|
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/index.js"
|
|
14
|
+
},
|
|
11
15
|
"dependencies": {
|
|
12
|
-
"fast-
|
|
16
|
+
"fast-glob": "3.3.2",
|
|
17
|
+
"json5": "2.2.3",
|
|
18
|
+
"jsonschema": "1.4.1",
|
|
13
19
|
"lodash": "4.17.21",
|
|
20
|
+
"pathe": "1.1.2",
|
|
21
|
+
"prettier": "3.6.1",
|
|
22
|
+
"readable-stream": "4.5.2",
|
|
23
|
+
"ts-morph": "23.0.0",
|
|
24
|
+
"vscode-languageserver": "9.0.1",
|
|
14
25
|
"xmlbuilder2": "3.1.1",
|
|
15
26
|
"zod": "3.22.4",
|
|
16
|
-
"
|
|
17
|
-
"@servicenow/sdk-core": "
|
|
27
|
+
"fflate": "0.8.2",
|
|
28
|
+
"@servicenow/sdk-core": "4.0.0"
|
|
18
29
|
},
|
|
19
30
|
"overrides": {
|
|
20
31
|
"micromatch": "4.0.7"
|
|
21
32
|
},
|
|
22
33
|
"devDependencies": {
|
|
23
|
-
"@types/lodash": "4.
|
|
34
|
+
"@types/lodash": "4.17.6",
|
|
35
|
+
"@types/readable-stream": "4.0.15",
|
|
36
|
+
"type-fest": "4.26.1"
|
|
24
37
|
},
|
|
25
38
|
"engines": {
|
|
26
|
-
"node": ">=18.
|
|
27
|
-
"pnpm": ">=
|
|
39
|
+
"node": ">=20.18.0",
|
|
40
|
+
"pnpm": ">=10.8.0"
|
|
28
41
|
},
|
|
29
42
|
"scripts": {
|
|
30
43
|
"build": "tsc -b",
|
|
31
44
|
"clean": "tsc -b --clean",
|
|
32
|
-
"lint": "eslint . --ext .ts",
|
|
33
|
-
"prettier:check": "prettier --check --ignore-path=../../.prettierignore .",
|
|
34
|
-
"prettier:write": "prettier --write --ignore-path=../../.prettierignore .",
|
|
35
45
|
"watch": "tsc -b -w",
|
|
36
|
-
"test": "
|
|
46
|
+
"test": "export NODE_OPTIONS=\"--max-old-space-size=8192 --experimental-vm-modules\" && jest --colors --reporters=default --no-cache --logHeapUsage"
|
|
37
47
|
}
|
|
38
48
|
}
|
package/src/app.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FileSystem } from './fs'
|
|
2
|
+
import type { NowConfig } from './now-config'
|
|
3
|
+
import { readJson } from './json'
|
|
4
|
+
import type { PackageJson } from 'type-fest'
|
|
5
|
+
|
|
6
|
+
export type App = {
|
|
7
|
+
/**
|
|
8
|
+
* The parsed package.json
|
|
9
|
+
*/
|
|
10
|
+
package: Package
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* SDK-specific configuration
|
|
14
|
+
*/
|
|
15
|
+
config: NowConfig
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Root directory of the project
|
|
19
|
+
*/
|
|
20
|
+
rootDir: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type Package = PackageJson & {
|
|
24
|
+
name: string
|
|
25
|
+
version: string
|
|
26
|
+
now?: NowConfig
|
|
27
|
+
dependencies?: Record<string, string>
|
|
28
|
+
devDependencies?: Record<string, string>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function parsePackageJson(rootDir: string, fs: FileSystem): Package {
|
|
32
|
+
return readJson(rootDir, 'package.json', fs)
|
|
33
|
+
}
|