@suitegeezus/suitecloud-stacker 25.2.127

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.
Files changed (113) hide show
  1. package/.idea/compiler.xml +6 -0
  2. package/.idea/git_toolbox_blame.xml +6 -0
  3. package/.idea/git_toolbox_prj.xml +15 -0
  4. package/.idea/misc.xml +6 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/suitecloud-stacker.iml +9 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/CONTRIBUTING.md +72 -0
  9. package/README.md +242 -0
  10. package/bin/updateModule.d.ts +6 -0
  11. package/bin/updateModule.js +12 -0
  12. package/commands/CONTRIBUTING.md +7 -0
  13. package/commands/accountManageauth.d.ts +93 -0
  14. package/commands/accountManageauth.js +228 -0
  15. package/commands/accountSetup.d.ts +56 -0
  16. package/commands/accountSetup.js +218 -0
  17. package/commands/customhook/compiless.d.ts +10 -0
  18. package/commands/customhook/compiless.js +46 -0
  19. package/commands/customhook/watchss.d.ts +14 -0
  20. package/commands/customhook/watchss.js +77 -0
  21. package/commands/fileImport.d.ts +31 -0
  22. package/commands/fileImport.js +503 -0
  23. package/commands/fileList.d.ts +19 -0
  24. package/commands/fileList.js +40 -0
  25. package/commands/fileUpload.d.ts +52 -0
  26. package/commands/fileUpload.js +355 -0
  27. package/commands/generic.d.ts +5 -0
  28. package/commands/generic.js +13 -0
  29. package/commands/objectImport.d.ts +32 -0
  30. package/commands/objectImport.js +287 -0
  31. package/commands/objectList.d.ts +13 -0
  32. package/commands/objectList.js +78 -0
  33. package/commands/projectCreate.d.ts +31 -0
  34. package/commands/projectCreate.js +506 -0
  35. package/commands/projectDeploy.d.ts +25 -0
  36. package/commands/projectDeploy.js +371 -0
  37. package/commands/projectPackage.d.ts +10 -0
  38. package/commands/projectPackage.js +32 -0
  39. package/commands/projectValidate.d.ts +21 -0
  40. package/commands/projectValidate.js +112 -0
  41. package/commands/sdfAcs_authmap.d.ts +15 -0
  42. package/commands/sdfAcs_authmap.js +26 -0
  43. package/commands/sdfAcs_clean.d.ts +20 -0
  44. package/commands/sdfAcs_clean.js +22 -0
  45. package/deleteManifest.cjs +11 -0
  46. package/demo.md +26 -0
  47. package/index.d.ts +284 -0
  48. package/lib/MakeJestTestsFromDeploy.d.ts +13 -0
  49. package/lib/MakeJestTestsFromDeploy.js +60 -0
  50. package/lib/addGitKeep.d.ts +5 -0
  51. package/lib/addGitKeep.js +40 -0
  52. package/lib/addSdfObjectDirs.d.ts +5 -0
  53. package/lib/addSdfObjectDirs.js +16 -0
  54. package/lib/callCli.d.ts +7 -0
  55. package/lib/callCli.js +26 -0
  56. package/lib/compileHelper.d.ts +44 -0
  57. package/lib/compileHelper.js +196 -0
  58. package/lib/deleteProjectJson.d.ts +6 -0
  59. package/lib/deleteProjectJson.js +16 -0
  60. package/lib/deployFileHelper.d.ts +77 -0
  61. package/lib/deployFileHelper.js +249 -0
  62. package/lib/handleRootProjectJson.d.ts +10 -0
  63. package/lib/handleRootProjectJson.js +30 -0
  64. package/lib/isProd.d.ts +9 -0
  65. package/lib/isProd.js +13 -0
  66. package/lib/logHelper.d.ts +5 -0
  67. package/lib/logHelper.js +13 -0
  68. package/lib/logger.d.ts +6 -0
  69. package/lib/logger.js +10 -0
  70. package/lib/makeDeployXml.d.ts +6 -0
  71. package/lib/makeDeployXml.js +30 -0
  72. package/lib/makeJest.d.ts +12 -0
  73. package/lib/makeJest.js +58 -0
  74. package/lib/makeManifestXml.d.ts +6 -0
  75. package/lib/makeManifestXml.js +21 -0
  76. package/lib/makeProjectJson.d.ts +6 -0
  77. package/lib/makeProjectJson.js +16 -0
  78. package/lib/onErrorHelper.d.ts +31 -0
  79. package/lib/onErrorHelper.js +93 -0
  80. package/lib/pathHelpers.d.ts +133 -0
  81. package/lib/pathHelpers.js +428 -0
  82. package/lib/pause.d.ts +6 -0
  83. package/lib/pause.js +10 -0
  84. package/lib/projectJsonHelpers.d.ts +29 -0
  85. package/lib/projectJsonHelpers.js +92 -0
  86. package/lib/promptHelpers.d.ts +77 -0
  87. package/lib/promptHelpers.js +195 -0
  88. package/lib/removeFiles.d.ts +20 -0
  89. package/lib/removeFiles.js +46 -0
  90. package/lib/sdf.d.ts +11 -0
  91. package/lib/sdf.js +158 -0
  92. package/lib/spawnSuitecloudChild.d.ts +30 -0
  93. package/lib/spawnSuitecloudChild.js +88 -0
  94. package/lib/switchAuth.d.ts +17 -0
  95. package/lib/switchAuth.js +23 -0
  96. package/lib/tempFileHelper.d.ts +29 -0
  97. package/lib/tempFileHelper.js +70 -0
  98. package/lib/updateModule.d.ts +10 -0
  99. package/lib/updateModule.js +79 -0
  100. package/lib/validators.d.ts +12 -0
  101. package/lib/validators.js +25 -0
  102. package/package.json +38 -0
  103. package/safeCommands.d.ts +95 -0
  104. package/safeCommands.js +959 -0
  105. package/sdf.config.js +15 -0
  106. package/sdf.exe.js +16 -0
  107. package/templates/customizations.projectroot.d.ts +74 -0
  108. package/templates/makeModuleTypeDef.d.ts +5 -0
  109. package/templates/makeModuleTypeDef.js +29 -0
  110. package/templates/sdfGitIgnore.txt +42 -0
  111. package/templates/suitecloud.config.js +17 -0
  112. package/templates/tsconfig.ss21.projectroot.json +64 -0
  113. package/types/colors.d.ts +43 -0
package/index.d.ts ADDED
@@ -0,0 +1,284 @@
1
+ /**
2
+ * @file sdf/index.d.ts
3
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
4
+ */
5
+
6
+ declare enum ProjectFolder {
7
+ DIST = 'dist',
8
+ IMPORT = 'src',
9
+ }
10
+
11
+ type AccountCustomizationRoots =
12
+ 'FileCabinet'
13
+ | 'SuiteScripts'
14
+ | 'Objects'
15
+ | 'Translations'
16
+ | 'AccountConfiguration'
17
+ | 'Templates'
18
+ | 'Web Site Hosting Files';
19
+
20
+ type SdfObjectTypes = 'addressForm'
21
+ | 'advancedpdftemplate'
22
+ | 'bundleinstallationscript'
23
+ | 'center'
24
+ | 'centercategory'
25
+ | 'centerlink'
26
+ | 'centertab'
27
+ | 'clientscript'
28
+ | 'crmcustomfield'
29
+ | 'csvimport'
30
+ | 'customlist'
31
+ | 'customrecordtype'
32
+ | 'customsegment'
33
+ | 'customtransactiontype'
34
+ | 'dataset'
35
+ | 'emailcaptureplugin'
36
+ | 'emailtemplate'
37
+ | 'entitycustomfield'
38
+ | 'entryForm'
39
+ | 'financiallayout'
40
+ | 'integration'
41
+ | 'itemcustomfield'
42
+ | 'itemnumbercustomfield'
43
+ | 'kpiscorecard'
44
+ | 'mapreducescript'
45
+ | 'massupdatescript'
46
+ | 'othercustomfield'
47
+ | 'plugintype'
48
+ | 'plugintypeimpl'
49
+ | 'portlet'
50
+ | 'publisheddashboard'
51
+ | 'reportdefinition'
52
+ | 'restlet'
53
+ | 'role'
54
+ | 'savedsearch'
55
+ | 'scheduledscript'
56
+ | 'sublist'
57
+ | 'subtab'
58
+ | 'suitelet'
59
+ | 'transactionForm'
60
+ | 'transactionbodycustomfield'
61
+ | 'transactioncolumncustomfield'
62
+ | 'translationcollection'
63
+ | 'usereventscript'
64
+ | 'workbook'
65
+ | 'workflow'
66
+ | 'workflowactionscript'
67
+
68
+
69
+ type NativeProjectJsonContents = {
70
+ defaultAuthId: string;
71
+ defaultProjectFolder?: string;
72
+ }
73
+
74
+ type ProjectJsonContents = Partial<NativeProjectJsonContents> & Partial<{
75
+ certificateid: string;
76
+ privatekeypath: string;
77
+ }>;
78
+
79
+ interface BasicBeforeExecutingOptions {
80
+ command: unknown;
81
+ isProd?: boolean;
82
+ readonly authId?: string;
83
+ executionPath?: string;
84
+ projectFolder?: string; // the relative path
85
+ projectPath: string; //"/Users/geraldgillespie/code/myproject/src/FileCabinet/SuiteScripts/Apps/billingItemShip",
86
+ arguments: {
87
+ authid?: string;
88
+ runhooks?: 'pre'|'post'|'all'|'none'|'quiet';
89
+ debug?: string;
90
+ name?: string;
91
+ customflag?: boolean;
92
+ customoptions?: string[];
93
+ noconfig?: boolean;
94
+ readonly interactive?: boolean;
95
+ };
96
+ }
97
+
98
+ interface BasicOnCompletedOptions {
99
+ _status: 'SUCCESS' | 'ERROR' | string;
100
+ _data: unknown;
101
+ /** @description - this is usually an object of key value pairs.
102
+ * The values are often strings,
103
+ * but sometimes the values are quoted strings (i.e. JSON strings). An example is file:import has "paths" key whihch is a list of quoted strings
104
+ */
105
+ _commandParameters?: unknown;
106
+ _actionExecuted?: unknown;
107
+ }
108
+
109
+ interface AccountMangementOnCompletedOptions extends BasicOnCompletedOptions {
110
+ "_data": Record<string /* "5854873-LYMI-PROD" */, {
111
+ "accountInfo": {
112
+ "companyId": string; // "5854873",
113
+ "companyName": string; // "Lymi Inc. - The Reformation (PRODUCTION)",
114
+ "roleId": string; // "3",
115
+ "roleName": string; // "Administrator",
116
+ "entityId": string; // "21585"
117
+ },
118
+ "token": {
119
+ "accessToken": string; // "eyJraWQiOiJjLjU4NTQ4NzMuMjAyNS0wMy0wN
120
+ "expirationDate": string; // "2025-03-08T13:34.3861Z"
121
+ },
122
+ "domain"?: string;
123
+ "hostInfo"?: {
124
+ "hostName": string; // "5854873.app.netsuite.com",
125
+ "clientId": string; // "6da57bf05a6247fc876c6
126
+ },
127
+ "certificateInfo": {
128
+ "privateKeyPath"?: string; // "/Users/geraldgillespie/.keys/sdfgg.pem",
129
+ "certificateId": string; // "yyHF3-KhYaEB5fUY
130
+ "privateKey"?: string;
131
+ }
132
+ }>;
133
+ _commandParameters: {},
134
+ _actionExecuted: "list"
135
+ }
136
+
137
+ interface AccountSetupBeforeExecutingOptions extends BasicBeforeExecutingOptions {
138
+ command: "account:setup:ci";
139
+ projectPath: string; // "/Users/geraldgillespie/code/nsaccounts";
140
+ arguments: {
141
+ account: string; //"5390900_SB2",
142
+ authid: string; //"5390900-OPTIMASUAT",
143
+ certificateid: string; // "g0EVzozmKsf5-8iqeT2An48gmRKnJ7pA3uti42eOYbI",
144
+ privatekeypath: string; // "/Users/geraldgillespie/.keys/sdfgg25_rsa.private.pem",
145
+ domain: string; // "5390900-sb2.app.netsuite.com"
146
+ }
147
+ }
148
+
149
+ interface FileImportBeforeExecutingOptions extends BasicBeforeExecutingOptions {
150
+ command: 'file:import';
151
+ arguments: {
152
+ /** @description - Always begin with a discrete path such as `/SuiteScripts` */
153
+ paths: Array<`/SuiteScripts/${string}` | string>;
154
+ excludeproperties: boolean;
155
+ readonly authid: string; // CUST-PROD
156
+ calledfromcomparefiles?: boolean;
157
+ calledfromupdate?: boolean;
158
+ readonly interactive?: boolean;
159
+ } & BasicBeforeExecutingOptions['arguments']
160
+ }
161
+
162
+ interface FileUploadBeforeExecutingOptions extends BasicBeforeExecutingOptions {
163
+ command: 'file:import';
164
+ _isProd?: boolean;
165
+ arguments: {
166
+ /** @description - Always begin with a discrete path such as `/SuiteScripts` */
167
+ paths: Array<`/SuiteScripts/${string}` | string>;
168
+ readonly authid: string; // CUST-PROD
169
+ readonly interactive?: boolean;
170
+ } & BasicBeforeExecutingOptions['arguments']
171
+ }
172
+
173
+ interface ObjectImportOptions extends BasicBeforeExecutingOptions {
174
+ command: "object:import",
175
+ projectPath: string; // "/Users/geraldgillespie/code/netsuite/src/FileCabinet/SuiteScripts/billingItemShip",
176
+ arguments: {
177
+ scriptid: string[];// ["customscript_gl_pymnt_usc1"]
178
+ type: "customglplugin" | string;
179
+ destinationfolder: "/Objects",
180
+ readonly authid: string; // "LYMI-SB1"
181
+ readonly interactive?: boolean;
182
+ } & BasicBeforeExecutingOptions['arguments']
183
+ }
184
+
185
+ interface ObjectImportOnCompletedOptions extends BasicOnCompletedOptions {
186
+ "_status": "SUCCESS" | string,
187
+ "_data": {
188
+ "failedImports": [],
189
+ "successfulImports": [{
190
+ "customObject": {
191
+ "id": string; // "customscript_gl_pymnt_usc1",
192
+ "type": 'customglplugin' | string,
193
+ "result": { "code": "SUCCESS" | string };
194
+ },
195
+ "referencedFileImportResult": { "successfulImports": [], "failedImports": [] }
196
+ }],
197
+ "errorImports": []
198
+ },
199
+ "_commandParameters": {
200
+ type: 'customglplugin' | string;
201
+ destinationfolder: string; // "\"/Objects\"",
202
+ authid: string; // "AVID-SB1",
203
+ project: string; // "\"/Users/geraldgillespie/code/nsaccounts/6403833\"",
204
+ scriptid: string; // "customscript_gl_pymnt_usc1"
205
+ },
206
+ "_commandFlags": Array<'excludefiles' | string>
207
+ }
208
+
209
+ interface ObjectListOptions extends BasicBeforeExecutingOptions {
210
+ command: "object:list",
211
+ projectPath: string; // "/Users/geraldgillespie/code/netsuite/src/FileCabinet/SuiteScripts/billingItemShip",
212
+ arguments: {
213
+ scriptid: string;
214
+ type?: string[] // ALL is implied when missing
215
+ readonly authid: string;
216
+ }
217
+ }
218
+
219
+ interface ObjectListOnCompletedOptions extends BasicOnCompletedOptions {
220
+ _status: "SUCCESS",
221
+ _data: [
222
+ {
223
+ scriptId: string;
224
+ type: SdfObjectTypes | string;
225
+ }
226
+ ],
227
+ _commandParameters: {
228
+ scriptid?: string;
229
+ authid: string;
230
+ type?: string[];
231
+ }
232
+ }
233
+
234
+ interface SdfCommandBeforeExecutingGeneric<O extends Record<string,any>> {
235
+ /**
236
+ * @description
237
+ */
238
+ (options: O): O | Promise<O>;
239
+ }
240
+
241
+ /**
242
+ * @description - Command
243
+ * @see https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_155931221634.html#subsect_156380094347
244
+ * Some things that an SDF command should do are:
245
+ * - Stack trace is difficult w/ SDF so all error messages should begin with the `_origin` name of the handler
246
+ * - any fatal errors should be trapped and rethrown.
247
+ * - Error handlers should detect their own `_origin` and conditionally handle the error message
248
+ * - use safeCommands.onErrorHelper
249
+ */
250
+ interface SdfCommand<
251
+ F = undefined,
252
+ B = SdfCommandBeforeExecutingGeneric<any>,
253
+ C = Function,
254
+ E = Function
255
+ > {
256
+ beforeExecuting?: B extends Function ? B : never;
257
+ onCompleted?: C extends Function ? C : never;
258
+ onError?: E extends Function ? E : never;
259
+ projectFolder?: F extends ProjectFolder | string ? `${F}` : undefined;
260
+ /** @description - non native but added for detection */
261
+ readonly stacked?: true;
262
+ isStackable?: boolean;
263
+ _origin?: string;
264
+ }
265
+
266
+ /**
267
+ * @example {
268
+ * command: 'file:import',
269
+ * projectPath: '/Users/geraldgillespie/code/nsaccounts',
270
+ * arguments: {
271
+ * paths: [ '/SuiteScripts/sullivansoftware1.js' ],
272
+ * excludeproperties: true,
273
+ * authid: 'td2954232'
274
+ * }
275
+ * }
276
+ */
277
+
278
+ type StackableHook<F, B, C, E> = {
279
+ (options?: Record<string, any>, ...args: any[]): SdfCommand<F, B, C, E>;
280
+ }
281
+
282
+ export type FileImportCommand = SdfCommand<ProjectFolder.IMPORT, SdfCommandBeforeExecutingGeneric<FileImportBeforeExecutingOptions>>;
283
+
284
+ export type FileUploadCommand = SdfCommand<ProjectFolder.DIST, SdfCommandBeforeExecutingGeneric<any>>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file sdf/lib/MakeJestTestsFromDeploy.ts
3
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
4
+ */
5
+ /**
6
+ * @deprecated - Sometimes a deploy.xml will use wildcards. This only works when no wild cards are used.
7
+ * The superior operation to this is to do a `dryrun` that will give you the specific js files that will attempt to deploy
8
+ * regardless of wildcards. Then you only need to test those files
9
+ * @description - assumes no wildcards in a deploy.xml
10
+ * @param {string[]} deployFiles
11
+ * @returns {Promise<string[]>}
12
+ */
13
+ export declare const getEveryJsTestFromTheDeployXml: (deployFiles: string[]) => Promise<string[]>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * @file sdf/lib/MakeJestTestsFromDeploy.ts
4
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getEveryJsTestFromTheDeployXml = void 0;
8
+ const fs = require("node:fs/promises");
9
+ const path = require("node:path");
10
+ const promptHelpers_1 = require("./promptHelpers");
11
+ /**
12
+ * @deprecated - Sometimes a deploy.xml will use wildcards. This only works when no wild cards are used.
13
+ * The superior operation to this is to do a `dryrun` that will give you the specific js files that will attempt to deploy
14
+ * regardless of wildcards. Then you only need to test those files
15
+ * @description - assumes no wildcards in a deploy.xml
16
+ * @param {string[]} deployFiles
17
+ * @returns {Promise<string[]>}
18
+ */
19
+ const getEveryJsTestFromTheDeployXml = async (deployFiles) => {
20
+ const fileGroups = await Promise.all(deployFiles.map(async (file) => {
21
+ const contents = await fs.readFile(file, 'utf8');
22
+ const listWitHoles = await Promise.all(contents.split('\n').map(
23
+ /**
24
+ * @example `<path>~/FileCabinet/SuiteScripts/Apps/glplugins/acs_gl_adjust_discount_tax.js</path>`
25
+ * @param line
26
+ * @returns {[*]|*[]}
27
+ */
28
+ async (line) => {
29
+ if (!/FileCabinet.Suite/.test(line))
30
+ return;
31
+ const newRoot = process.cwd().replace(/^(.*)\bFileCabinet.*$/, '$1');
32
+ const [jsMaybe] = line.split(/<.?path>/).map((s) => s.trim()).filter(Boolean).map(
33
+ // remove the beginning
34
+ (s) => s.replace(/^.*\b(FileCabinet.*)$/, '$1'));
35
+ if (!/\.js$/.test(jsMaybe))
36
+ return;
37
+ // add the newRoot
38
+ const fullPath = path.join(newRoot, jsMaybe);
39
+ // convert to a test path
40
+ const testPath = path.join(
41
+ // strip off the file
42
+ path.dirname(fullPath),
43
+ // add __tests__
44
+ '__tests__',
45
+ // mutate the file name
46
+ path.basename(fullPath).replace('.js', '.test.js'));
47
+ // check if the test file is readable
48
+ return await fs.access(testPath, fs.constants.R_OK)
49
+ .then(() => testPath)
50
+ .catch(() => {
51
+ process.stdout.write((0, promptHelpers_1.goColor)('\n', testPath, ' not readable'));
52
+ return;
53
+ });
54
+ }));
55
+ return listWitHoles.filter(Boolean);
56
+ }));
57
+ return fileGroups.flat();
58
+ };
59
+ exports.getEveryJsTestFromTheDeployXml = getEveryJsTestFromTheDeployXml;
60
+ //# sourceMappingURL=MakeJestTestsFromDeploy.js.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file sdf/lib/addGitKeeps.ts
3
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
4
+ */
5
+ export declare const add: (projectFolder: string) => Promise<void>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * @file sdf/lib/addGitKeeps.ts
4
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.add = void 0;
8
+ const fs = require("node:fs/promises");
9
+ const path = require("node:path");
10
+ const promptHelpers_1 = require("./promptHelpers");
11
+ async function addTouchToEmptyDirs(dir, fileName) {
12
+ try {
13
+ // Read directory entries with file type info.
14
+ const entries = await fs.readdir(dir, { withFileTypes: true });
15
+ // If the directory is empty, create a .gitKeep file.
16
+ if (entries.length === 0) {
17
+ const touchFile = path.join(dir, fileName);
18
+ await fs.writeFile(touchFile, '');
19
+ console.log((0, promptHelpers_1.goColor)('INFO', `Created: `), (0, promptHelpers_1.goColor)('SUBTLE', `${touchFile}`));
20
+ }
21
+ else {
22
+ // Recursively process subdirectories.
23
+ for (const entry of entries) {
24
+ if (entry.isDirectory()) {
25
+ const fullPath = path.join(dir, entry.name);
26
+ await addTouchToEmptyDirs(fullPath, fileName);
27
+ }
28
+ }
29
+ }
30
+ }
31
+ catch (error) {
32
+ console.error((0, promptHelpers_1.goColor)('BAD', `Error processing directory ${dir}:`), (0, promptHelpers_1.goColor)('SUBTLE', error));
33
+ }
34
+ }
35
+ const add = async (projectFolder) => {
36
+ // go through every directory and if it is empty then add a `.gitKeep`
37
+ return addTouchToEmptyDirs(projectFolder, '.gitKeep');
38
+ };
39
+ exports.add = add;
40
+ //# sourceMappingURL=addGitKeep.js.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file sdf/lib/addSdfObjectDirs.ts
3
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
4
+ */
5
+ export declare const add: (objectFolder: string) => Promise<void>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * @file sdf/lib/addSdfObjectDirs.ts
4
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.add = void 0;
8
+ const fs = require("node:fs/promises");
9
+ const path = require("node:path");
10
+ const add = async (objectFolder) => {
11
+ await Promise.all(['customglplugin', 'transactioncolumncustomfield'].map(async (type) => {
12
+ await fs.mkdir(path.join(objectFolder, type));
13
+ }));
14
+ };
15
+ exports.add = add;
16
+ //# sourceMappingURL=addSdfObjectDirs.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @file sdf/lib/callCli.ts
3
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
4
+ */
5
+ import { ChildProcess } from "node:child_process";
6
+ declare const callCli: (incomingArguments: string[]) => ChildProcess;
7
+ export = callCli;
package/lib/callCli.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * @file sdf/lib/callCli.ts
4
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
5
+ */
6
+ const child_process = require("node:child_process");
7
+ const sdfExec = process.env['SUITECLOUD_EXE'] || 'sdf';
8
+ const callCli = (incomingArguments) => {
9
+ console.log('spawning native', incomingArguments);
10
+ console.log('SDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGINSDFBEGIN\n');
11
+ const nativeProcess = child_process.spawn(sdfExec, [
12
+ ...incomingArguments,
13
+ ], {
14
+ cwd: process.cwd(),
15
+ stdio: 'inherit' // ,'pipe','inherit','pipe']
16
+ });
17
+ nativeProcess.on('close', (code) => {
18
+ if (code)
19
+ console.error('error', code);
20
+ else
21
+ console.log('success');
22
+ });
23
+ return nativeProcess;
24
+ };
25
+ module.exports = callCli;
26
+ //# sourceMappingURL=callCli.js.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @file /Users/geraldgillespie/code/nsaccounts/sdf/lib/compileHelper
3
+ * @author Gerald Gillespie <gerald.gillespie@fullscript.com>
4
+ */
5
+ /**
6
+ * @description
7
+ * @returns {string|void}
8
+ */
9
+ export declare const hasTsConfig: () => Promise<string | void>;
10
+ /**
11
+ * @description - Trigger a compile of TypeScript according to the local config file
12
+ * @param configFile
13
+ */
14
+ export declare const compileTsConfig: (configFile?: string) => Promise<number>;
15
+ /**
16
+ * @param path
17
+ * @returns {string} - contents
18
+ */
19
+ export declare const previewFile: (path: string) => Promise<string>;
20
+ /**
21
+ * @description - takes a list of files and create a TS config. JS files becomes TS only if they exist.
22
+ * - relative paths will be used
23
+ * @param {string[]} jsPaths - could be a list of paths from deploy.xml or not.
24
+ * @param {string} [rootConfigFile='tsconfig.ss21.json'] - defaults to tsconfig.ss21.json
25
+ * @returns {{config:string; files: string[]}} - path of the new tsconfig file
26
+ */
27
+ export declare const generateTsConfigFromList: (jsPaths: string[], overwriteConfig: boolean, rootConfigFile?: string) => Promise<{
28
+ config: string | null;
29
+ files: string[];
30
+ }>;
31
+ /**
32
+ * @description
33
+ */
34
+ export declare const makeJestConfig: () => Promise<void>;
35
+ /**
36
+ * @description
37
+ */
38
+ export declare const getAllTestFiles: () => Promise<string[]>;
39
+ /**
40
+ * @description - we might be running tests OR we might be testing files
41
+ * @param {string[]} jsFilesToTest - Get the list of files from a dryrun
42
+ * @param {boolean} allowMissing - whether to require tests or not
43
+ */
44
+ export declare const runJestTest: (jsFilesToTest: string[], allowMissing?: boolean) => Promise<number>;