@intelligentgraphics/ig.gfx.packager 3.0.0-alpha.9 → 3.0.0-beta.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/build/cli.mjs +48 -336
- package/build/cli.mjs.map +1 -1
- package/build/commands/build/docs.mjs +34 -0
- package/build/commands/build/docs.mjs.map +1 -0
- package/build/commands/build/index.mjs +169 -0
- package/build/commands/build/index.mjs.map +1 -0
- package/build/commands/build/tsc.mjs +84 -0
- package/build/commands/build/tsc.mjs.map +1 -0
- package/build/{generate.mjs → commands/generate.mjs} +6 -16
- package/build/commands/generate.mjs.map +1 -0
- package/build/{postinstall.mjs → commands/postinstall.mjs} +3 -10
- package/build/commands/postinstall.mjs.map +1 -0
- package/build/{index3.mjs → commands/publish/index.mjs} +20 -288
- package/build/commands/publish/index.mjs.map +1 -0
- package/build/commands/publish/zip.mjs +168 -0
- package/build/commands/publish/zip.mjs.map +1 -0
- package/build/{publishNpm.mjs → commands/publishNpm.mjs} +10 -18
- package/build/commands/publishNpm.mjs.map +1 -0
- package/build/index.mjs +1 -1
- package/build/index.mjs.map +1 -1
- package/build/lib/assetService.mjs +111 -0
- package/build/lib/assetService.mjs.map +1 -0
- package/build/lib/banner.mjs +20 -0
- package/build/lib/banner.mjs.map +1 -0
- package/build/{dependencies.mjs → lib/dependencies.mjs} +9 -60
- package/build/lib/dependencies.mjs.map +1 -0
- package/build/lib/error.mjs +15 -0
- package/build/lib/error.mjs.map +1 -0
- package/build/lib/fs.mjs +19 -0
- package/build/lib/fs.mjs.map +1 -0
- package/build/lib/git.mjs +37 -0
- package/build/lib/git.mjs.map +1 -0
- package/build/lib/localization.mjs +16 -0
- package/build/lib/localization.mjs.map +1 -0
- package/build/lib/log.mjs +9 -0
- package/build/lib/log.mjs.map +1 -0
- package/build/lib/npmPackage.mjs +19 -0
- package/build/lib/npmPackage.mjs.map +1 -0
- package/build/lib/package.mjs +129 -0
- package/build/lib/package.mjs.map +1 -0
- package/build/lib/packageVersion.mjs +174 -0
- package/build/lib/packageVersion.mjs.map +1 -0
- package/build/lib/parseVersion.mjs +54 -0
- package/build/lib/parseVersion.mjs.map +1 -0
- package/build/lib/prompter.mjs +31 -0
- package/build/lib/prompter.mjs.map +1 -0
- package/build/lib/publishedPackage.mjs +66 -0
- package/build/lib/publishedPackage.mjs.map +1 -0
- package/build/{scripts.mjs → lib/scripts.mjs} +1 -2
- package/build/lib/scripts.mjs.map +1 -0
- package/build/lib/stripUtf8Bom.mjs +11 -0
- package/build/lib/stripUtf8Bom.mjs.map +1 -0
- package/build/lib/toposort.mjs +26 -0
- package/build/lib/toposort.mjs.map +1 -0
- package/build/lib/versionFile.mjs +78 -0
- package/build/lib/versionFile.mjs.map +1 -0
- package/build/lib/workspace.mjs +51 -0
- package/build/lib/workspace.mjs.map +1 -0
- package/locales/de.json +18 -18
- package/locales/en.json +37 -37
- package/package.json +2 -2
- package/readme.md +29 -2
- package/scripts/postinstall.js +22 -22
- package/build/dependencies.mjs.map +0 -1
- package/build/generate.mjs.map +0 -1
- package/build/index2.mjs +0 -326
- package/build/index2.mjs.map +0 -1
- package/build/index3.mjs.map +0 -1
- package/build/postinstall.mjs.map +0 -1
- package/build/publishNpm.mjs.map +0 -1
- package/build/scripts.mjs.map +0 -1
- package/build/versionFile.mjs +0 -365
- package/build/versionFile.mjs.map +0 -1
package/build/cli.mjs
CHANGED
|
@@ -1,317 +1,14 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import updateNotifier from 'update-notifier';
|
|
3
2
|
import * as fs from 'fs';
|
|
4
3
|
import * as path from 'path';
|
|
5
|
-
import { dirname } from 'path';
|
|
6
4
|
import yargs from 'yargs/yargs';
|
|
7
5
|
import { fileURLToPath } from 'url';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
directory: path.join(__dirname, "..", "locales"),
|
|
15
|
-
updateFiles: false,
|
|
16
|
-
locale: "en",
|
|
17
|
-
fallbackToLanguage: true
|
|
18
|
-
});
|
|
19
|
-
const translate = (key, ...args) => instance.__(key, ...args);
|
|
20
|
-
|
|
21
|
-
const getNodeErrorCode = error => {
|
|
22
|
-
if (error !== null && typeof error === "object" && error.code !== undefined) {
|
|
23
|
-
return error.code;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.
|
|
29
|
-
*
|
|
30
|
-
* @param {unknown} error
|
|
31
|
-
*/
|
|
32
|
-
const isErrorENOENT = error => getNodeErrorCode(error) === "ENOENT";
|
|
33
|
-
|
|
34
|
-
const readNpmManifest = directory => {
|
|
35
|
-
const packageJsonPath = path.join(directory, "package.json");
|
|
36
|
-
const packageJson = fs.readFileSync(packageJsonPath, {
|
|
37
|
-
encoding: "utf8"
|
|
38
|
-
});
|
|
39
|
-
return JSON.parse(packageJson);
|
|
40
|
-
};
|
|
41
|
-
const writeNpmManifest = (directory, packageJson) => {
|
|
42
|
-
const packageJsonPath = path.join(directory, "package.json");
|
|
43
|
-
writePackageSync(packageJsonPath, packageJson);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// Functionality related to working with a single package.
|
|
47
|
-
const PACKAGE_FILE = "_Package.json";
|
|
48
|
-
const INDEX_FILE = "_Index.json";
|
|
49
|
-
const ANIMATION_FILE_SUFFIX = ".animation.json";
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Describes the location of a single package.
|
|
53
|
-
*
|
|
54
|
-
* @export
|
|
55
|
-
* @interface PackageLocation
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
const parseCreatorPackageName = manifest => {
|
|
59
|
-
const [domain, ...subdomainParts] = manifest.Package.split(".");
|
|
60
|
-
return {
|
|
61
|
-
domain,
|
|
62
|
-
subdomain: subdomainParts.join(".")
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Detects the package at the given directory.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} directory
|
|
69
|
-
* @returns {PackageLocation}
|
|
70
|
-
*/
|
|
71
|
-
const detectPackage = (workspace, directory) => {
|
|
72
|
-
directory = path.resolve(workspace.path, directory);
|
|
73
|
-
const scriptsPath = path.join(directory, "Scripts");
|
|
74
|
-
const tsPath = path.join(directory, "ts");
|
|
75
|
-
let location;
|
|
76
|
-
if (fs.existsSync(scriptsPath)) {
|
|
77
|
-
location = {
|
|
78
|
-
_kind: "PackageLocation",
|
|
79
|
-
path: directory,
|
|
80
|
-
scriptsDir: scriptsPath,
|
|
81
|
-
manifestDir: scriptsPath
|
|
82
|
-
};
|
|
83
|
-
} else if (fs.existsSync(tsPath)) {
|
|
84
|
-
location = {
|
|
85
|
-
_kind: "PackageLocation",
|
|
86
|
-
path: directory,
|
|
87
|
-
scriptsDir: tsPath,
|
|
88
|
-
manifestDir: directory
|
|
89
|
-
};
|
|
90
|
-
} else {
|
|
91
|
-
location = {
|
|
92
|
-
_kind: "PackageLocation",
|
|
93
|
-
path: directory,
|
|
94
|
-
scriptsDir: directory,
|
|
95
|
-
manifestDir: directory
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
readPackageCreatorManifest(location);
|
|
100
|
-
} catch (err) {
|
|
101
|
-
if (isErrorENOENT(err)) {
|
|
102
|
-
throw new Error(`No _Package.json found in ${location.manifestDir}`);
|
|
103
|
-
}
|
|
104
|
-
throw err;
|
|
105
|
-
}
|
|
106
|
-
return location;
|
|
107
|
-
};
|
|
108
|
-
const readPackageCreatorManifest = location => {
|
|
109
|
-
const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);
|
|
110
|
-
const packageJson = fs.readFileSync(packageJsonPath, {
|
|
111
|
-
encoding: "utf8"
|
|
112
|
-
});
|
|
113
|
-
const result = JSON.parse(packageJson);
|
|
114
|
-
return {
|
|
115
|
-
...result,
|
|
116
|
-
Scope: result.Scope || result.Package
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
const writePackageCreatorManifest = (location, creatorPackage) => {
|
|
120
|
-
const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);
|
|
121
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(creatorPackage, null, "\t") + "\n");
|
|
122
|
-
};
|
|
123
|
-
const readPackageCreatorIndex = location => {
|
|
124
|
-
try {
|
|
125
|
-
const indexPath = path.join(location.manifestDir, INDEX_FILE);
|
|
126
|
-
const index = fs.readFileSync(indexPath, {
|
|
127
|
-
encoding: "utf8"
|
|
128
|
-
});
|
|
129
|
-
return JSON.parse(index);
|
|
130
|
-
} catch (err) {
|
|
131
|
-
if (isErrorENOENT(err)) {
|
|
132
|
-
return undefined;
|
|
133
|
-
}
|
|
134
|
-
throw err;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const writePackageCreatorIndex = (location, index) => {
|
|
138
|
-
const packageJsonPath = path.join(location.manifestDir, INDEX_FILE);
|
|
139
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(index, null, "\t") + "\n");
|
|
140
|
-
};
|
|
141
|
-
const readPackageNpmManifest = location => {
|
|
142
|
-
try {
|
|
143
|
-
return readNpmManifest(location.manifestDir);
|
|
144
|
-
} catch (err) {
|
|
145
|
-
if (isErrorENOENT(err)) {
|
|
146
|
-
return undefined;
|
|
147
|
-
}
|
|
148
|
-
throw err;
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
const writePackageNpmManifest = (location, packageJson) => {
|
|
152
|
-
writeNpmManifest(location.manifestDir, packageJson);
|
|
153
|
-
};
|
|
154
|
-
const readPackageAnimationList = location => {
|
|
155
|
-
const directoryContent = fs.readdirSync(location.manifestDir);
|
|
156
|
-
const animationPathList = [];
|
|
157
|
-
for (const entry of directoryContent) {
|
|
158
|
-
if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {
|
|
159
|
-
const animationPath = path.join(location.manifestDir, entry);
|
|
160
|
-
animationPathList.push(animationPath);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return animationPathList;
|
|
164
|
-
};
|
|
165
|
-
const getPackageReleasesDirectory = location => path.join(location.path, "Releases");
|
|
166
|
-
|
|
167
|
-
// Functionality related to working with a workspace consisting of multiple packages.
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Describe the location of a workspace constining of n packages.
|
|
171
|
-
*
|
|
172
|
-
* @export
|
|
173
|
-
* @interface WorkspaceLocation
|
|
174
|
-
*/
|
|
175
|
-
|
|
176
|
-
const detectWorkspace = directory => {
|
|
177
|
-
directory = path.resolve(process.cwd(), directory);
|
|
178
|
-
return {
|
|
179
|
-
_kind: "WorkspaceLocation",
|
|
180
|
-
path: directory
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
const readWorkspaceNpmManifest = workspace => {
|
|
184
|
-
try {
|
|
185
|
-
return readNpmManifest(workspace.path);
|
|
186
|
-
} catch (err) {
|
|
187
|
-
if (isErrorENOENT(err)) {
|
|
188
|
-
return undefined;
|
|
189
|
-
}
|
|
190
|
-
throw err;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
const writeWorkspaceNpmManifest = (workspace, packageJson) => writeNpmManifest(workspace.path, packageJson);
|
|
194
|
-
const getWorkspaceOutputPath = workspace => path.join(workspace.path, "bin");
|
|
195
|
-
const getWorkspaceLibPath = workspace => path.join(workspace.path, "lib");
|
|
196
|
-
function* iterateWorkspacePackages(workspace) {
|
|
197
|
-
const entries = fs.readdirSync(workspace.path, {
|
|
198
|
-
withFileTypes: true
|
|
199
|
-
});
|
|
200
|
-
for (const entry of entries) {
|
|
201
|
-
if (!entry.isDirectory()) {
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
try {
|
|
205
|
-
yield detectPackage(workspace, entry.name);
|
|
206
|
-
} catch {}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const createDefaultPrompter = () => {
|
|
211
|
-
return {
|
|
212
|
-
confirm: async message => {
|
|
213
|
-
const {
|
|
214
|
-
confirm
|
|
215
|
-
} = await inquirer.prompt([{
|
|
216
|
-
type: "confirm",
|
|
217
|
-
message,
|
|
218
|
-
name: "confirm"
|
|
219
|
-
}]);
|
|
220
|
-
return confirm;
|
|
221
|
-
},
|
|
222
|
-
ask: async question => {
|
|
223
|
-
const {
|
|
224
|
-
answer
|
|
225
|
-
} = await inquirer.prompt([{
|
|
226
|
-
type: "list",
|
|
227
|
-
message: question.message,
|
|
228
|
-
name: "answer",
|
|
229
|
-
choices: question.options,
|
|
230
|
-
default: question.default
|
|
231
|
-
}]);
|
|
232
|
-
return answer;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
var name = "@intelligentgraphics/ig.gfx.packager";
|
|
238
|
-
var version = "3.0.0-alpha.9";
|
|
239
|
-
var description = "IG.GFX.Packager 3.0.0 Alpha 9 (3.0.0.10)";
|
|
240
|
-
var author = "Michael Beier <mb@intelligentgraphics.biz>";
|
|
241
|
-
var main = "build/index.mjs";
|
|
242
|
-
var type = "module";
|
|
243
|
-
var publishConfig = {
|
|
244
|
-
access: "public"
|
|
245
|
-
};
|
|
246
|
-
var engines = {
|
|
247
|
-
node: ">=16.19.0"
|
|
248
|
-
};
|
|
249
|
-
var bin = {
|
|
250
|
-
packager: "./build/index.mjs"
|
|
251
|
-
};
|
|
252
|
-
var files = [
|
|
253
|
-
"build",
|
|
254
|
-
"locales",
|
|
255
|
-
"scripts"
|
|
256
|
-
];
|
|
257
|
-
var scripts = {
|
|
258
|
-
dist: "rollup -c rollup.config.mjs",
|
|
259
|
-
clean: "rimraf build *.tsbuildinfo",
|
|
260
|
-
prepublishOnly: "yarn clean && yarn dist",
|
|
261
|
-
test: "vitest",
|
|
262
|
-
format: "prettier --write \"**/*.{ts,tsx,json}\""
|
|
263
|
-
};
|
|
264
|
-
var dependencies = {
|
|
265
|
-
ajv: "^8.12.0",
|
|
266
|
-
axios: "^1.2.5",
|
|
267
|
-
"core-js": "^3.27.2",
|
|
268
|
-
glob: "^8.1.0",
|
|
269
|
-
inquirer: "^9.1.4",
|
|
270
|
-
jszip: "^3.10.1",
|
|
271
|
-
lodash: "^4.17.21",
|
|
272
|
-
resolve: "^1.22.1",
|
|
273
|
-
"simple-git": "^3.16.0",
|
|
274
|
-
"source-map-support": "^0.5.21",
|
|
275
|
-
terser: "^5.16.1",
|
|
276
|
-
typedoc: "~0.23.2",
|
|
277
|
-
typescript: "~4.9.4",
|
|
278
|
-
"update-notifier": "^6.0.2",
|
|
279
|
-
"v8-compile-cache": "^2.3.0",
|
|
280
|
-
"write-pkg": "^5.1.0",
|
|
281
|
-
y18n: "^5.0.8",
|
|
282
|
-
yargs: "^17.6.2"
|
|
283
|
-
};
|
|
284
|
-
var devDependencies = {
|
|
285
|
-
"@babel/preset-env": "^7.18.9",
|
|
286
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
287
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
288
|
-
"@rollup/plugin-commonjs": "^24.0.0",
|
|
289
|
-
"@rollup/plugin-json": "^6.0.0",
|
|
290
|
-
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
291
|
-
"@types/glob": "^8.0.1",
|
|
292
|
-
"@types/inquirer": "^9.0.3",
|
|
293
|
-
"@types/node": "^16.4.11",
|
|
294
|
-
"@types/update-notifier": "^6.0.1",
|
|
295
|
-
"@types/yargs": "^17.0.2",
|
|
296
|
-
rollup: "^3.10.0",
|
|
297
|
-
vitest: "^0.28.1"
|
|
298
|
-
};
|
|
299
|
-
var pjson = {
|
|
300
|
-
name: name,
|
|
301
|
-
version: version,
|
|
302
|
-
description: description,
|
|
303
|
-
author: author,
|
|
304
|
-
main: main,
|
|
305
|
-
"private": false,
|
|
306
|
-
type: type,
|
|
307
|
-
publishConfig: publishConfig,
|
|
308
|
-
engines: engines,
|
|
309
|
-
bin: bin,
|
|
310
|
-
files: files,
|
|
311
|
-
scripts: scripts,
|
|
312
|
-
dependencies: dependencies,
|
|
313
|
-
devDependencies: devDependencies
|
|
314
|
-
};
|
|
6
|
+
import glob from 'glob';
|
|
7
|
+
import { translate } from './lib/localization.mjs';
|
|
8
|
+
import { detectPackage } from './lib/package.mjs';
|
|
9
|
+
import { detectWorkspace, readWorkspaceNpmManifest, writeWorkspaceNpmManifest } from './lib/workspace.mjs';
|
|
10
|
+
import { createDefaultPrompter } from './lib/prompter.mjs';
|
|
11
|
+
import pjson from '../package.json';
|
|
315
12
|
|
|
316
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
317
14
|
const captureError = err => {
|
|
@@ -349,13 +46,12 @@ const buildOptions = {
|
|
|
349
46
|
default: false
|
|
350
47
|
}
|
|
351
48
|
};
|
|
352
|
-
const preCommandCheck = async
|
|
49
|
+
const preCommandCheck = async workspaceLocation => {
|
|
353
50
|
var _repositoryPackage, _repositoryPackage$de, _repositoryPackage2, _repositoryPackage2$d;
|
|
354
51
|
const executedLocalPackager = path.relative(process.cwd(), __filename).indexOf("..") === -1;
|
|
355
52
|
let repositoryPackage;
|
|
356
53
|
try {
|
|
357
|
-
|
|
358
|
-
repositoryPackage = JSON.parse(repositoryPackageJson);
|
|
54
|
+
repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);
|
|
359
55
|
} catch (err) {}
|
|
360
56
|
if ((_repositoryPackage = repositoryPackage) !== null && _repositoryPackage !== void 0 && (_repositoryPackage$de = _repositoryPackage.dependencies) !== null && _repositoryPackage$de !== void 0 && _repositoryPackage$de["@intelligentgraphics/ig.gfx.packager"] || (_repositoryPackage2 = repositoryPackage) !== null && _repositoryPackage2 !== void 0 && (_repositoryPackage2$d = _repositoryPackage2.devDependencies) !== null && _repositoryPackage2$d !== void 0 && _repositoryPackage2$d["@intelligentgraphics/ig.gfx.packager"]) {
|
|
361
57
|
const parts = ["Detected locally installed ig.gfx.packager."];
|
|
@@ -381,27 +77,46 @@ Run "npm install" to get rid of the local packager version.`);
|
|
|
381
77
|
isGlobal: true,
|
|
382
78
|
defer: true
|
|
383
79
|
});
|
|
384
|
-
|
|
385
|
-
const packageJson = readWorkspaceNpmManifest(workspaceLocation);
|
|
386
|
-
if (packageJson === undefined) {
|
|
80
|
+
if (repositoryPackage === undefined) {
|
|
387
81
|
throw new Error("Could not load package.json file in current directory");
|
|
388
82
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
writeWorkspaceNpmManifest(workspaceLocation,
|
|
83
|
+
repositoryPackage.scripts ??= {};
|
|
84
|
+
repositoryPackage.scripts.postinstall = "packager postinstall";
|
|
85
|
+
writeWorkspaceNpmManifest(workspaceLocation, repositoryPackage);
|
|
392
86
|
};
|
|
393
87
|
const yargsInstance = yargs(process.argv.slice(2));
|
|
88
|
+
const resolvePackagesFromArgs = (args = [], workspace) => {
|
|
89
|
+
const folders = new Map();
|
|
90
|
+
for (const arg of args) {
|
|
91
|
+
glob.sync(arg, {
|
|
92
|
+
cwd: workspace.path,
|
|
93
|
+
absolute: true
|
|
94
|
+
}).forEach(folder => {
|
|
95
|
+
try {
|
|
96
|
+
const location = detectPackage(workspace, folder);
|
|
97
|
+
folders.set(folder, location);
|
|
98
|
+
} catch (err) {}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return Array.from(folders.values());
|
|
102
|
+
};
|
|
394
103
|
yargsInstance.command("build [directories...]", "Builds the specified directories", argv => argv.options(buildOptions), async ({
|
|
395
104
|
directories = [],
|
|
396
105
|
...options
|
|
397
106
|
}) => {
|
|
398
|
-
|
|
107
|
+
const workspace = detectWorkspace(options.cwd);
|
|
108
|
+
const folders = resolvePackagesFromArgs(options.directories, workspace);
|
|
109
|
+
await preCommandCheck(workspace);
|
|
399
110
|
const {
|
|
400
111
|
buildFolders
|
|
401
|
-
} = await import('./
|
|
112
|
+
} = await import('./commands/build/index.mjs');
|
|
113
|
+
if (folders.length === 0) {
|
|
114
|
+
return console.log(translate("messages.buildSkipEmpty"));
|
|
115
|
+
}
|
|
402
116
|
await buildFolders({
|
|
403
117
|
...options,
|
|
404
|
-
|
|
118
|
+
packages: folders,
|
|
119
|
+
workspace
|
|
405
120
|
}).catch(captureError);
|
|
406
121
|
});
|
|
407
122
|
yargsInstance.command("publish [directory]", "Publishes the specified directory", argv => argv.options({
|
|
@@ -469,7 +184,9 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
|
|
|
469
184
|
license,
|
|
470
185
|
...options
|
|
471
186
|
}) => {
|
|
472
|
-
|
|
187
|
+
const workspace = detectWorkspace(options.cwd);
|
|
188
|
+
const folder = detectPackage(workspace, directory);
|
|
189
|
+
await preCommandCheck(workspace);
|
|
473
190
|
if (!options.noUpload) {
|
|
474
191
|
if (!service) {
|
|
475
192
|
captureError(new Error(translate("options.service.demands", "IG_GFX_ASSET_SERVICE")));
|
|
@@ -513,16 +230,17 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
|
|
|
513
230
|
}
|
|
514
231
|
const {
|
|
515
232
|
releaseFolder
|
|
516
|
-
} = await import('./
|
|
233
|
+
} = await import('./commands/publish/index.mjs');
|
|
517
234
|
const prompter = createDefaultPrompter();
|
|
518
235
|
const fullOptions = {
|
|
519
236
|
...options,
|
|
520
237
|
authentication,
|
|
521
238
|
service: service,
|
|
522
|
-
directory:
|
|
239
|
+
directory: folder,
|
|
523
240
|
banner: true,
|
|
524
241
|
prompter,
|
|
525
|
-
newVersion: options.newVersion
|
|
242
|
+
newVersion: options.newVersion,
|
|
243
|
+
workspace
|
|
526
244
|
};
|
|
527
245
|
await releaseFolder(fullOptions).catch(captureError);
|
|
528
246
|
});
|
|
@@ -539,11 +257,11 @@ yargsInstance.command({
|
|
|
539
257
|
directory,
|
|
540
258
|
ignore
|
|
541
259
|
}) => {
|
|
542
|
-
|
|
260
|
+
const workspace = detectWorkspace(process.cwd());
|
|
261
|
+
await preCommandCheck(workspace);
|
|
543
262
|
const {
|
|
544
263
|
extract
|
|
545
|
-
} = await import('./generate.mjs');
|
|
546
|
-
const workspace = detectWorkspace(process.cwd());
|
|
264
|
+
} = await import('./commands/generate.mjs');
|
|
547
265
|
const location = detectPackage(workspace, directory);
|
|
548
266
|
extract(location, ignore);
|
|
549
267
|
}
|
|
@@ -554,7 +272,7 @@ yargsInstance.command({
|
|
|
554
272
|
handler: async () => {
|
|
555
273
|
const {
|
|
556
274
|
executePostInstall
|
|
557
|
-
} = await import('./postinstall.mjs');
|
|
275
|
+
} = await import('./commands/postinstall.mjs');
|
|
558
276
|
executePostInstall(detectWorkspace(process.cwd()));
|
|
559
277
|
},
|
|
560
278
|
describe: "Runs postinstall tasks"
|
|
@@ -580,7 +298,7 @@ yargsInstance.command({
|
|
|
580
298
|
const workspace = detectWorkspace(process.cwd());
|
|
581
299
|
const {
|
|
582
300
|
publishToNpm
|
|
583
|
-
} = await import('./publishNpm.mjs');
|
|
301
|
+
} = await import('./commands/publishNpm.mjs');
|
|
584
302
|
await publishToNpm({
|
|
585
303
|
workspace,
|
|
586
304
|
location: detectPackage(workspace, directory),
|
|
@@ -591,10 +309,4 @@ yargsInstance.command({
|
|
|
591
309
|
describe: "Publishes the package to npm"
|
|
592
310
|
});
|
|
593
311
|
yargsInstance.demandCommand().pkgConf("packager").showHelpOnFail(false).version().argv;
|
|
594
|
-
|
|
595
|
-
var cli = /*#__PURE__*/Object.freeze({
|
|
596
|
-
__proto__: null
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
export { INDEX_FILE as I, PACKAGE_FILE as P, detectPackage as a, readPackageNpmManifest as b, readPackageAnimationList as c, detectWorkspace as d, readPackageCreatorIndex as e, readWorkspaceNpmManifest as f, getWorkspaceOutputPath as g, getPackageReleasesDirectory as h, isErrorENOENT as i, readNpmManifest as j, writePackageCreatorIndex as k, getWorkspaceLibPath as l, writePackageNpmManifest as m, iterateWorkspacePackages as n, cli as o, parseCreatorPackageName as p, readPackageCreatorManifest as r, translate as t, writePackageCreatorManifest as w };
|
|
600
312
|
//# sourceMappingURL=cli.mjs.map
|
package/build/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","sources":["../src/lib/localization.ts","../src/lib/error.ts","../src/lib/npmPackage.ts","../src/lib/package.ts","../src/lib/workspace.ts","../src/lib/prompter.ts","../src/cli.ts"],"sourcesContent":["import y18n from \"y18n\";\r\nimport * as path from \"path\";\r\nimport { dirname } from \"path\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nconst __dirname = dirname(fileURLToPath(import.meta.url));\r\n\r\nconst instance = y18n({\r\n\tdirectory: path.join(__dirname, \"..\", \"locales\"),\r\n\tupdateFiles: false,\r\n\tlocale: \"en\",\r\n\tfallbackToLanguage: true,\r\n});\r\n\r\nexport const setLocale = (locale: string) => {\r\n\tinstance.setLocale(locale);\r\n};\r\n\r\nexport const translate = (key: string, ...args: string[]) =>\r\n\tinstance.__(key, ...args);\r\n","interface NodeError extends Error {\r\n\tcode: string;\r\n}\r\n\r\nexport const getNodeErrorCode = (error: unknown) => {\r\n\tif (\r\n\t\terror !== null &&\r\n\t\ttypeof error === \"object\" &&\r\n\t\t(error as NodeError).code !== undefined\r\n\t) {\r\n\t\treturn (error as NodeError).code;\r\n\t}\r\n};\r\n\r\n/**\r\n * Permission denied: An attempt was made to access a file in a way forbidden by its file access permissions.\r\n *\r\n * @param {unknown} error\r\n */\r\nexport const isErrorEACCES = (error: unknown) =>\r\n\tgetNodeErrorCode(error) === \"EACCES\";\r\n\r\n/**\r\n * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.\r\n *\r\n * @param {unknown} error\r\n */\r\nexport const isErrorENOENT = (error: unknown) =>\r\n\tgetNodeErrorCode(error) === \"ENOENT\";\r\n","import * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport { writePackageSync } from \"write-pkg\";\r\n\r\nimport { PackageJSON } from \"./packageJSON\";\r\n\r\nexport const readNpmManifest = <T extends PackageJSON>(\r\n\tdirectory: string,\r\n): T => {\r\n\tconst packageJsonPath = path.join(directory, \"package.json\");\r\n\tconst packageJson = fs.readFileSync(packageJsonPath, {\r\n\t\tencoding: \"utf8\",\r\n\t});\r\n\treturn JSON.parse(packageJson);\r\n};\r\n\r\nexport const writeNpmManifest = <T extends PackageJSON>(\r\n\tdirectory: string,\r\n\tpackageJson: T,\r\n) => {\r\n\tconst packageJsonPath = path.join(directory, \"package.json\");\r\n\twritePackageSync(packageJsonPath, packageJson);\r\n};\r\n","// Functionality related to working with a single package.\r\n\r\nimport * as path from \"path\";\r\nimport * as fs from \"fs\";\r\n\r\nimport { isErrorENOENT } from \"./error\";\r\nimport { WorkspaceLocation } from \"./workspace\";\r\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\r\nimport { PackageJSON } from \"./packageJSON\";\r\n\r\nexport const PACKAGE_FILE = \"_Package.json\";\r\nexport const INDEX_FILE = \"_Index.json\";\r\nconst ANIMATION_FILE_SUFFIX = \".animation.json\";\r\n\r\n/**\r\n * Describes the location of a single package.\r\n *\r\n * @export\r\n * @interface PackageLocation\r\n */\r\nexport interface PackageLocation {\r\n\t_kind: \"PackageLocation\";\r\n\t/**\r\n\t * Main directory of a package\r\n\t *\r\n\t * @type {string}\r\n\t */\r\n\tpath: string;\r\n\t/**\r\n\t * Directory containing the typescript files\r\n\t *\r\n\t * @type {string}\r\n\t */\r\n\tscriptsDir: string;\r\n\t/**\r\n\t * Diretory containing the _Package.json, _Index.json, package.json and animation.json files\r\n\t *\r\n\t * @type {string}\r\n\t */\r\n\tmanifestDir: string;\r\n}\r\n\r\nexport interface CreatorPackage {\r\n\tScope: string;\r\n\tPackage: string;\r\n\tRunTime: boolean;\r\n\tType: \"Interactor\" | \"Mixed\" | \"Core\" | \"Context\" | \"Evaluator\";\r\n}\r\n\r\nexport type CreatorIndex = CreatorIndexEntry[];\r\n\r\nexport interface CreatorIndexEntry {\r\n\tName: string;\r\n\tDescription?: string;\r\n\tType: \"Interactor\" | \"Evaluator\";\r\n\tParameters: CreatorIndexParameter[];\r\n}\r\n\r\nexport interface CreatorIndexParameter {\r\n\tName: string;\r\n\tType: CreatorIndexParameterType;\r\n\tDescription?: string;\r\n\tDefault?: unknown;\r\n\tDisplayIndex: number;\r\n}\r\n\r\nexport type CreatorIndexParameterType =\r\n\t| \"String\"\r\n\t| \"LengthM\"\r\n\t| \"Material\"\r\n\t| \"Boolean\"\r\n\t| \"Bool\"\r\n\t| \"ArcDEG\"\r\n\t| \"Integer\"\r\n\t| \"Int\"\r\n\t| \"Float\";\r\n\r\nexport const parseCreatorPackageName = (manifest: CreatorPackage) => {\r\n\tconst [domain, ...subdomainParts] = manifest.Package.split(\".\");\r\n\treturn {\r\n\t\tdomain,\r\n\t\tsubdomain: subdomainParts.join(\".\"),\r\n\t};\r\n};\r\n\r\nexport interface PackageNpmManifest extends PackageJSON {\r\n\tig?: {\r\n\t\tscriptingLibrary?: boolean;\r\n\t};\r\n}\r\n\r\n/**\r\n * Detects the package at the given directory.\r\n *\r\n * @param {string} directory\r\n * @returns {PackageLocation}\r\n */\r\nexport const detectPackage = (\r\n\tworkspace: WorkspaceLocation,\r\n\tdirectory: string,\r\n): PackageLocation => {\r\n\tdirectory = path.resolve(workspace.path, directory);\r\n\r\n\tconst scriptsPath = path.join(directory, \"Scripts\");\r\n\tconst tsPath = path.join(directory, \"ts\");\r\n\r\n\tlet location: PackageLocation;\r\n\r\n\tif (fs.existsSync(scriptsPath)) {\r\n\t\tlocation = {\r\n\t\t\t_kind: \"PackageLocation\",\r\n\t\t\tpath: directory,\r\n\t\t\tscriptsDir: scriptsPath,\r\n\t\t\tmanifestDir: scriptsPath,\r\n\t\t};\r\n\t} else if (fs.existsSync(tsPath)) {\r\n\t\tlocation = {\r\n\t\t\t_kind: \"PackageLocation\",\r\n\t\t\tpath: directory,\r\n\t\t\tscriptsDir: tsPath,\r\n\t\t\tmanifestDir: directory,\r\n\t\t};\r\n\t} else {\r\n\t\tlocation = {\r\n\t\t\t_kind: \"PackageLocation\",\r\n\t\t\tpath: directory,\r\n\t\t\tscriptsDir: directory,\r\n\t\t\tmanifestDir: directory,\r\n\t\t};\r\n\t}\r\n\r\n\ttry {\r\n\t\treadPackageCreatorManifest(location);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`No _Package.json found in ${location.manifestDir}`,\r\n\t\t\t);\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n\r\n\treturn location;\r\n};\r\n\r\nexport const readPackageCreatorManifest = (\r\n\tlocation: PackageLocation,\r\n): CreatorPackage => {\r\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\r\n\tconst packageJson = fs.readFileSync(packageJsonPath, { encoding: \"utf8\" });\r\n\tconst result: Omit<CreatorPackage, \"Scope\"> & { Scope?: string } =\r\n\t\tJSON.parse(packageJson);\r\n\treturn {\r\n\t\t...result,\r\n\t\tScope: result.Scope || result.Package,\r\n\t};\r\n};\r\n\r\nexport const writePackageCreatorManifest = (\r\n\tlocation: PackageLocation,\r\n\tcreatorPackage: CreatorPackage,\r\n) => {\r\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\r\n\tfs.writeFileSync(\r\n\t\tpackageJsonPath,\r\n\t\tJSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\",\r\n\t);\r\n};\r\n\r\nexport const readPackageCreatorIndex = (\r\n\tlocation: PackageLocation,\r\n): CreatorIndex | undefined => {\r\n\ttry {\r\n\t\tconst indexPath = path.join(location.manifestDir, INDEX_FILE);\r\n\t\tconst index = fs.readFileSync(indexPath, { encoding: \"utf8\" });\r\n\t\treturn JSON.parse(index);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const writePackageCreatorIndex = (\r\n\tlocation: PackageLocation,\r\n\tindex: CreatorIndex,\r\n) => {\r\n\tconst packageJsonPath = path.join(location.manifestDir, INDEX_FILE);\r\n\tfs.writeFileSync(packageJsonPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\r\n};\r\n\r\nexport const readPackageNpmManifest = (\r\n\tlocation: PackageLocation,\r\n): PackageNpmManifest | undefined => {\r\n\ttry {\r\n\t\treturn readNpmManifest(location.manifestDir);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const writePackageNpmManifest = (\r\n\tlocation: PackageLocation,\r\n\tpackageJson: PackageNpmManifest,\r\n) => {\r\n\twriteNpmManifest(location.manifestDir, packageJson);\r\n};\r\n\r\nexport const readPackageAnimationList = (location: PackageLocation) => {\r\n\tconst directoryContent = fs.readdirSync(location.manifestDir);\r\n\tconst animationPathList: string[] = [];\r\n\r\n\tfor (const entry of directoryContent) {\r\n\t\tif (entry.endsWith(ANIMATION_FILE_SUFFIX)) {\r\n\t\t\tconst animationPath = path.join(location.manifestDir, entry);\r\n\t\t\tanimationPathList.push(animationPath);\r\n\t\t}\r\n\t}\r\n\r\n\treturn animationPathList;\r\n};\r\n\r\nexport const getPackageReleasesDirectory = (location: PackageLocation) =>\r\n\tpath.join(location.path, \"Releases\");\r\n\r\nexport const arePackageLocationsEqual = (\r\n\ta: PackageLocation,\r\n\tb: PackageLocation,\r\n) => a.path === b.path;\r\n","// Functionality related to working with a workspace consisting of multiple packages.\r\n\r\nimport * as path from \"path\";\r\nimport * as fs from \"fs\";\r\n\r\nimport { PackageJSON } from \"./packageJSON\";\r\nimport { isErrorENOENT } from \"./error\";\r\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\r\nimport { detectPackage } from \"./package\";\r\n\r\n/**\r\n * Describe the location of a workspace constining of n packages.\r\n *\r\n * @export\r\n * @interface WorkspaceLocation\r\n */\r\nexport interface WorkspaceLocation {\r\n\t_kind: \"WorkspaceLocation\";\r\n\tpath: string;\r\n}\r\n\r\nexport interface WorkspacePackageJSON extends PackageJSON {\r\n\tpackager?: { banner?: string };\r\n}\r\n\r\nexport const detectWorkspace = (directory: string): WorkspaceLocation => {\r\n\tdirectory = path.resolve(process.cwd(), directory);\r\n\treturn {\r\n\t\t_kind: \"WorkspaceLocation\",\r\n\t\tpath: directory,\r\n\t};\r\n};\r\n\r\nexport const readWorkspaceNpmManifest = (\r\n\tworkspace: WorkspaceLocation,\r\n): WorkspacePackageJSON | undefined => {\r\n\ttry {\r\n\t\treturn readNpmManifest<WorkspacePackageJSON>(workspace.path);\r\n\t} catch (err) {\r\n\t\tif (isErrorENOENT(err)) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tthrow err;\r\n\t}\r\n};\r\n\r\nexport const writeWorkspaceNpmManifest = <T extends WorkspacePackageJSON>(\r\n\tworkspace: WorkspaceLocation,\r\n\tpackageJson: T,\r\n) => writeNpmManifest(workspace.path, packageJson);\r\n\r\nexport const getWorkspaceOutputPath = (workspace: WorkspaceLocation) =>\r\n\tpath.join(workspace.path, \"bin\");\r\n\r\nexport const getWorkspaceLibPath = (workspace: WorkspaceLocation) =>\r\n\tpath.join(workspace.path, \"lib\");\r\n\r\nexport function* iterateWorkspacePackages(workspace: WorkspaceLocation) {\r\n\tconst entries = fs.readdirSync(workspace.path, { withFileTypes: true });\r\n\r\n\tfor (const entry of entries) {\r\n\t\tif (!entry.isDirectory()) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tyield detectPackage(workspace, entry.name);\r\n\t\t} catch {}\r\n\t}\r\n}\r\n","import inquirer from \"inquirer\";\r\n\r\nexport interface PrompterQuestion {\r\n\tmessage: string;\r\n\toptions: string[];\r\n\tdefault?: string;\r\n}\r\n\r\nexport interface Prompter {\r\n\tconfirm(message: string): Promise<boolean>;\r\n\r\n\task(question: PrompterQuestion): Promise<string>;\r\n}\r\n\r\nexport const createDefaultPrompter = (): Prompter => {\r\n\treturn {\r\n\t\tconfirm: async (message) => {\r\n\t\t\tconst { confirm } = await inquirer.prompt([\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: \"confirm\",\r\n\t\t\t\t\tmessage,\r\n\t\t\t\t\tname: \"confirm\",\r\n\t\t\t\t},\r\n\t\t\t]);\r\n\t\t\treturn confirm as boolean;\r\n\t\t},\r\n\r\n\t\task: async (question) => {\r\n\t\t\tconst { answer } = await inquirer.prompt([\r\n\t\t\t\t{\r\n\t\t\t\t\ttype: \"list\",\r\n\t\t\t\t\tmessage: question.message,\r\n\t\t\t\t\tname: \"answer\",\r\n\t\t\t\t\tchoices: question.options,\r\n\t\t\t\t\tdefault: question.default,\r\n\t\t\t\t},\r\n\t\t\t]);\r\n\t\t\treturn answer as string;\r\n\t\t},\r\n\t};\r\n};\r\n","import updateNotifier from \"update-notifier\";\r\nimport * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport yargs from \"yargs/yargs\";\r\nimport { fileURLToPath } from \"url\";\r\n\r\nimport { translate } from \"./lib/localization\";\r\nimport { Authentication } from \"./lib/authentication\";\r\nimport { detectPackage } from \"./lib/package\";\r\nimport {\r\n\tdetectWorkspace,\r\n\treadWorkspaceNpmManifest,\r\n\twriteWorkspaceNpmManifest,\r\n} from \"./lib/workspace\";\r\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\r\nimport { createDefaultPrompter } from \"./lib/prompter\";\r\n\r\nimport pjson from \"../package.json\";\r\n\r\nconst __filename = fileURLToPath(import.meta.url);\r\n\r\nconst captureError = (err: Error) => {\r\n\tconsole.log(\"\");\r\n\r\n\tif (process.env.NODE_ENV !== \"production\") {\r\n\t\tconsole.error(err);\r\n\t} else {\r\n\t\tconsole.error(translate(\"messages.error\", err.message));\r\n\t}\r\n};\r\n\r\nconst buildOptions = {\r\n\toutDir: {\r\n\t\tdescription: translate(\"options.outDir.description\"),\r\n\t\ttype: \"string\",\r\n\t\tdefault: \"bin\",\r\n\t\tcoerce: (input: string | undefined | null) =>\r\n\t\t\tinput === undefined || input === null\r\n\t\t\t\t? undefined\r\n\t\t\t\t: path.resolve(process.cwd(), input),\r\n\t},\r\n\tminimize: {\r\n\t\tdescription: translate(\"options.minimize.description\"),\r\n\t\ttype: \"boolean\",\r\n\t\tdefault: true,\r\n\t},\r\n\tcwd: {\r\n\t\tdescription: translate(\"options.cwd.description\"),\r\n\t\ttype: \"string\",\r\n\t\tdefault: process.cwd(),\r\n\t},\r\n\tclean: {\r\n\t\tdescription: translate(\"options.clean.description\"),\r\n\t\ttype: \"boolean\",\r\n\t\tdefault: false,\r\n\t},\r\n\tdocs: {\r\n\t\ttype: \"boolean\",\r\n\t\tdefault: false,\r\n\t},\r\n} as const;\r\n\r\nconst preCommandCheck = async () => {\r\n\tconst executedLocalPackager =\r\n\t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\r\n\r\n\tlet repositoryPackage:\r\n\t\t| {\r\n\t\t\t\tdependencies?: Record<string, string>;\r\n\t\t\t\tdevDependencies?: Record<string, string>;\r\n\t\t }\r\n\t\t| undefined;\r\n\r\n\ttry {\r\n\t\tconst repositoryPackageJson = fs.readFileSync(\r\n\t\t\tpath.resolve(process.cwd(), \"package.json\"),\r\n\t\t\t\"utf8\",\r\n\t\t);\r\n\r\n\t\trepositoryPackage = JSON.parse(repositoryPackageJson);\r\n\t} catch (err) {}\r\n\r\n\tif (\r\n\t\trepositoryPackage?.dependencies?.[\r\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\r\n\t\t] ||\r\n\t\trepositoryPackage?.devDependencies?.[\r\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\r\n\t\t]\r\n\t) {\r\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\r\n\r\n\t\tif (executedLocalPackager) {\r\n\t\t\tparts.push(\r\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\r\n\t\t\t);\r\n\t\t}\r\n\t\tparts.push(\r\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\r\n\t\t);\r\n\r\n\t\tconsole.error(parts.join(\"\\n\"));\r\n\t\tprocess.exit(1);\r\n\t}\r\n\r\n\tif (executedLocalPackager) {\r\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\r\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\r\nRun \"npm install\" to get rid of the local packager version.`);\r\n\t\tprocess.exit(1);\r\n\t}\r\n\r\n\tconst notifier = updateNotifier({\r\n\t\tpkg: pjson,\r\n\t\tshouldNotifyInNpmScript: true,\r\n\t\tupdateCheckInterval: 1000 * 60,\r\n\t});\r\n\r\n\tnotifier.notify({\r\n\t\tisGlobal: true,\r\n\t\tdefer: true,\r\n\t});\r\n\r\n\tconst workspaceLocation = detectWorkspace(process.cwd());\r\n\r\n\tconst packageJson = readWorkspaceNpmManifest(workspaceLocation);\r\n\r\n\tif (packageJson === undefined) {\r\n\t\tthrow new Error(\r\n\t\t\t\"Could not load package.json file in current directory\",\r\n\t\t);\r\n\t}\r\n\r\n\tpackageJson.scripts ??= {};\r\n\tpackageJson.scripts.postinstall = \"packager postinstall\";\r\n\r\n\twriteWorkspaceNpmManifest(workspaceLocation, packageJson);\r\n};\r\n\r\nconst yargsInstance = yargs(process.argv.slice(2));\r\n\r\nyargsInstance.command(\r\n\t\"build [directories...]\",\r\n\t\"Builds the specified directories\",\r\n\t(argv) => argv.options(buildOptions),\r\n\tasync ({ directories = [], ...options }) => {\r\n\t\tawait preCommandCheck();\r\n\r\n\t\tconst { buildFolders } = await import(\"./commands/build\");\r\n\r\n\t\tawait buildFolders({\r\n\t\t\t...options,\r\n\t\t\tdirectories: directories as string[],\r\n\t\t}).catch(captureError);\r\n\t},\r\n);\r\n\r\nyargsInstance.command(\r\n\t\"publish [directory]\",\r\n\t\"Publishes the specified directory\",\r\n\t(argv) =>\r\n\t\targv.options({\r\n\t\t\t...buildOptions,\r\n\t\t\tnoUpload: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t\tdescription: translate(\"options.noUpload.description\"),\r\n\t\t\t},\r\n\t\t\tdomain: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.domain.description\"),\r\n\t\t\t},\r\n\t\t\tsubdomain: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.subdomain.description\"),\r\n\t\t\t},\r\n\t\t\tnewVersion: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\r\n\t\t\t\tdefault: process.env.VERSION,\r\n\t\t\t\trequired: true,\r\n\t\t\t},\r\n\t\t\taddress: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.address.description\"),\r\n\t\t\t\tdefault: \"localhost\",\r\n\t\t\t},\r\n\t\t\tservice: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.service.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\r\n\t\t\t\trequired: true,\r\n\t\t\t},\r\n\t\t\tuser: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.user.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_USER,\r\n\t\t\t},\r\n\t\t\tpassword: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.password.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\r\n\t\t\t},\r\n\t\t\tdocs: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t\tdescription: translate(\"options.docs.description\"),\r\n\t\t\t},\r\n\t\t\tpushOnly: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t\tdefault: false,\r\n\t\t\t\tdescription: translate(\"options.pushOnly.description\"),\r\n\t\t\t},\r\n\t\t\tlicense: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.license.description\"),\r\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\r\n\t\t\t},\r\n\t\t}),\r\n\tasync ({ directory, user, password, service, license, ...options }) => {\r\n\t\tawait preCommandCheck();\r\n\r\n\t\tif (!options.noUpload) {\r\n\t\t\tif (!service) {\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\ttranslate(\r\n\t\t\t\t\t\t\t\"options.service.demands\",\r\n\t\t\t\t\t\t\t\"IG_GFX_ASSET_SERVICE\",\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!license && (!user || !password)) {\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\r\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\r\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet authentication: Authentication | undefined;\r\n\r\n\t\tif (license) {\r\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\r\n\t\t\ttry {\r\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\r\n\t\t\t\tauthentication = {\r\n\t\t\t\t\ttype: \"license\",\r\n\t\t\t\t\tlicense: content.toString(\"base64\"),\r\n\t\t\t\t};\r\n\t\t\t} catch (err) {\r\n\t\t\t\tif (err?.code === \"ENOENT\") {\r\n\t\t\t\t\tcaptureError(\r\n\t\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcaptureError(\r\n\t\t\t\t\tnew Error(\r\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} else if (user && password) {\r\n\t\t\tconsole.log(\r\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\r\n\t\t\t);\r\n\t\t\tauthentication = {\r\n\t\t\t\ttype: \"credentials\",\r\n\t\t\t\tusername: user,\r\n\t\t\t\tpassword,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\r\n\r\n\t\tconst prompter = createDefaultPrompter();\r\n\r\n\t\tconst fullOptions: ReleaseFolderOptions = {\r\n\t\t\t...options,\r\n\t\t\tauthentication,\r\n\t\t\tservice: service!,\r\n\t\t\tdirectory: directory as string,\r\n\t\t\tbanner: true,\r\n\t\t\tprompter,\r\n\t\t\tnewVersion: options.newVersion!,\r\n\t\t};\r\n\r\n\t\tawait releaseFolder(fullOptions).catch(captureError);\r\n\t},\r\n);\r\n\r\nyargsInstance.command({\r\n\tcommand: \"generateIndex [directory]\",\r\n\tbuilder: (argv) => {\r\n\t\treturn argv.option(\"ignore\", {\r\n\t\t\ttype: \"array\",\r\n\t\t\tdefault: [],\r\n\t\t\tdescription: translate(\"options.ignore.description\"),\r\n\t\t});\r\n\t},\r\n\thandler: async ({ directory, ignore }) => {\r\n\t\tawait preCommandCheck();\r\n\r\n\t\tconst { extract } = await import(\"./commands/generate\");\r\n\r\n\t\tconst workspace = detectWorkspace(process.cwd());\r\n\t\tconst location = detectPackage(workspace, directory as string);\r\n\r\n\t\textract(location, ignore as string[]);\r\n\t},\r\n});\r\n\r\nyargsInstance.command({\r\n\tcommand: \"postinstall\",\r\n\tbuilder: (argv) => argv,\r\n\thandler: async () => {\r\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\r\n\r\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\r\n\t},\r\n\tdescribe: \"Runs postinstall tasks\",\r\n});\r\n\r\nyargsInstance.command({\r\n\tcommand: \"publishNpm [directory]\",\r\n\tbuilder: (argv) =>\r\n\t\targv.options({\r\n\t\t\tnewVersion: {\r\n\t\t\t\ttype: \"string\",\r\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\r\n\t\t\t\tdefault: process.env.VERSION,\r\n\t\t\t\trequired: true,\r\n\t\t\t},\r\n\t\t\tdryRun: {\r\n\t\t\t\ttype: \"boolean\",\r\n\t\t\t},\r\n\t\t}),\r\n\thandler: async ({ directory, newVersion, dryRun }) => {\r\n\t\tconst workspace = detectWorkspace(process.cwd());\r\n\r\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\r\n\r\n\t\tawait publishToNpm({\r\n\t\t\tworkspace,\r\n\t\t\tlocation: detectPackage(workspace, directory as string),\r\n\t\t\tversion: newVersion,\r\n\t\t\tdryRun,\r\n\t\t}).catch(captureError);\r\n\t},\r\n\tdescribe: \"Publishes the package to npm\",\r\n});\r\n\r\nyargsInstance\r\n\t.demandCommand()\r\n\t.pkgConf(\"packager\")\r\n\t.showHelpOnFail(false)\r\n\t.version().argv;\r\n"],"names":["__dirname","dirname","fileURLToPath","import","meta","url","instance","y18n","directory","path","join","updateFiles","locale","fallbackToLanguage","translate","key","args","__","getNodeErrorCode","error","code","undefined","isErrorENOENT","readNpmManifest","packageJsonPath","packageJson","fs","readFileSync","encoding","JSON","parse","writeNpmManifest","writePackageSync","PACKAGE_FILE","INDEX_FILE","ANIMATION_FILE_SUFFIX","parseCreatorPackageName","manifest","domain","subdomainParts","Package","split","subdomain","detectPackage","workspace","resolve","scriptsPath","tsPath","location","existsSync","_kind","scriptsDir","manifestDir","readPackageCreatorManifest","err","Error","result","Scope","writePackageCreatorManifest","creatorPackage","writeFileSync","stringify","readPackageCreatorIndex","indexPath","index","writePackageCreatorIndex","readPackageNpmManifest","writePackageNpmManifest","readPackageAnimationList","directoryContent","readdirSync","animationPathList","entry","endsWith","animationPath","push","getPackageReleasesDirectory","detectWorkspace","process","cwd","readWorkspaceNpmManifest","writeWorkspaceNpmManifest","getWorkspaceOutputPath","getWorkspaceLibPath","iterateWorkspacePackages","entries","withFileTypes","isDirectory","name","createDefaultPrompter","confirm","message","inquirer","prompt","type","ask","question","answer","choices","options","default","__filename","captureError","console","log","env","NODE_ENV","buildOptions","outDir","description","coerce","input","minimize","clean","docs","preCommandCheck","executedLocalPackager","relative","indexOf","repositoryPackage","repositoryPackageJson","dependencies","devDependencies","parts","exit","notifier","updateNotifier","pkg","pjson","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","workspaceLocation","scripts","postinstall","yargsInstance","yargs","argv","slice","command","directories","buildFolders","catch","noUpload","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","user","IG_GFX_USER","password","IG_GFX_PWD","pushOnly","license","IG_GFX_LICENSE","authentication","fullLicensePath","content","toString","username","releaseFolder","prompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAKA,MAAMA,SAAS,GAAGC,OAAO,CAACC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAA;AAEzD,MAAMC,QAAQ,GAAGC,IAAI,CAAC;EACrBC,SAAS,EAAEC,IAAI,CAACC,IAAI,CAACV,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC;AAChDW,EAAAA,WAAW,EAAE,KAAK;A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rBH,OAAO,EAAE,CAACtC,IAAI;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"cli.mjs","sources":["../src/cli.ts"],"sourcesContent":["import updateNotifier from \"update-notifier\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"url\";\nimport glob from \"glob\";\n\nimport { translate } from \"./lib/localization\";\nimport { Authentication } from \"./lib/authentication\";\nimport { detectPackage, PackageLocation } from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\n\tWorkspaceLocation,\n\twriteWorkspaceNpmManifest,\n} from \"./lib/workspace\";\nimport type { ReleaseFolderOptions } from \"./commands/publish\";\nimport { createDefaultPrompter } from \"./lib/prompter\";\nimport { PackageJSON } from \"./lib/packageJSON\";\n\nimport pjson from \"../package.json\";\n\nconst __filename = fileURLToPath(import.meta.url);\n\nconst captureError = (err: Error) => {\n\tconsole.log(\"\");\n\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconsole.error(err);\n\t} else {\n\t\tconsole.error(translate(\"messages.error\", err.message));\n\t}\n};\n\nconst buildOptions = {\n\toutDir: {\n\t\tdescription: translate(\"options.outDir.description\"),\n\t\ttype: \"string\",\n\t\tdefault: \"bin\",\n\t\tcoerce: (input: string | undefined | null) =>\n\t\t\tinput === undefined || input === null\n\t\t\t\t? undefined\n\t\t\t\t: path.resolve(process.cwd(), input),\n\t},\n\tminimize: {\n\t\tdescription: translate(\"options.minimize.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: true,\n\t},\n\tcwd: {\n\t\tdescription: translate(\"options.cwd.description\"),\n\t\ttype: \"string\",\n\t\tdefault: process.cwd(),\n\t},\n\tclean: {\n\t\tdescription: translate(\"options.clean.description\"),\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n\tdocs: {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t},\n} as const;\n\nconst preCommandCheck = async (workspaceLocation: WorkspaceLocation) => {\n\tconst executedLocalPackager =\n\t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\n\n\tlet repositoryPackage: PackageJSON | undefined;\n\n\ttry {\n\t\trepositoryPackage = readWorkspaceNpmManifest(workspaceLocation);\n\t} catch (err) {}\n\n\tif (\n\t\trepositoryPackage?.dependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t] ||\n\t\trepositoryPackage?.devDependencies?.[\n\t\t\t\"@intelligentgraphics/ig.gfx.packager\"\n\t\t]\n\t) {\n\t\tconst parts = [\"Detected locally installed ig.gfx.packager.\"];\n\n\t\tif (executedLocalPackager) {\n\t\t\tparts.push(\n\t\t\t\t'Run \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.',\n\t\t\t);\n\t\t}\n\t\tparts.push(\n\t\t\t'Run \"npm uninstall @intelligentgraphics/ig.gfx.packager\" to remove the local version.',\n\t\t);\n\n\t\tconsole.error(parts.join(\"\\n\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (executedLocalPackager) {\n\t\tconsole.error(`Detected locally installed ig.gfx.packager.\nRun \"npm install -g @intelligentgraphics/ig.gfx.packager@latest\" to install the global version, if it is not yet installed.\nRun \"npm install\" to get rid of the local packager version.`);\n\t\tprocess.exit(1);\n\t}\n\n\tconst notifier = updateNotifier({\n\t\tpkg: pjson,\n\t\tshouldNotifyInNpmScript: true,\n\t\tupdateCheckInterval: 1000 * 60,\n\t});\n\n\tnotifier.notify({\n\t\tisGlobal: true,\n\t\tdefer: true,\n\t});\n\n\tif (repositoryPackage === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Could not load package.json file in current directory\",\n\t\t);\n\t}\n\n\trepositoryPackage.scripts ??= {};\n\trepositoryPackage.scripts.postinstall = \"packager postinstall\";\n\n\twriteWorkspaceNpmManifest(workspaceLocation, repositoryPackage);\n};\n\nconst yargsInstance = yargs(process.argv.slice(2));\n\nconst resolvePackagesFromArgs = (\n\targs: string[] = [],\n\tworkspace: WorkspaceLocation,\n) => {\n\tconst folders = new Map<string, PackageLocation>();\n\n\tfor (const arg of args) {\n\t\tglob.sync(arg, { cwd: workspace.path, absolute: true }).forEach(\n\t\t\t(folder) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst location = detectPackage(workspace, folder);\n\t\t\t\t\tfolders.set(folder, location);\n\t\t\t\t} catch (err) {}\n\t\t\t},\n\t\t);\n\t}\n\n\treturn Array.from(folders.values());\n};\n\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) => argv.options(buildOptions),\n\tasync ({ directories = [], ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folders = resolvePackagesFromArgs(\n\t\t\toptions.directories as string[],\n\t\t\tworkspace,\n\t\t);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { buildFolders } = await import(\"./commands/build\");\n\n\t\tif (folders.length === 0) {\n\t\t\treturn console.log(translate(\"messages.buildSkipEmpty\"));\n\t\t}\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tpackages: folders,\n\t\t\tworkspace,\n\t\t}).catch(captureError);\n\t},\n);\n\nyargsInstance.command(\n\t\"publish [directory]\",\n\t\"Publishes the specified directory\",\n\t(argv) =>\n\t\targv.options({\n\t\t\t...buildOptions,\n\t\t\tnoUpload: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.noUpload.description\"),\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.domain.description\"),\n\t\t\t},\n\t\t\tsubdomain: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.subdomain.description\"),\n\t\t\t},\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\taddress: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.address.description\"),\n\t\t\t\tdefault: \"localhost\",\n\t\t\t},\n\t\t\tservice: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.service.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_ASSET_SERVICE,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.user.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_USER,\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.password.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_PWD,\n\t\t\t},\n\t\t\tdocs: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.docs.description\"),\n\t\t\t},\n\t\t\tpushOnly: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: translate(\"options.pushOnly.description\"),\n\t\t\t},\n\t\t\tlicense: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.license.description\"),\n\t\t\t\tdefault: process.env.IG_GFX_LICENSE,\n\t\t\t},\n\t\t}),\n\tasync ({ directory, user, password, service, license, ...options }) => {\n\t\tconst workspace = detectWorkspace(options.cwd);\n\t\tconst folder = detectPackage(workspace, directory as string);\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tif (!options.noUpload) {\n\t\t\tif (!service) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\ttranslate(\n\t\t\t\t\t\t\t\"options.service.demands\",\n\t\t\t\t\t\t\t\"IG_GFX_ASSET_SERVICE\",\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!license && (!user || !password)) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected authentication to be provided through either of the following methods:\n\t - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable\n\t - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (license && !license.endsWith(\".iglic\")) {\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Expected the license path to end with the extension .iglic. Received the path \"${license}\". You may need to reload your environment variables by restarting the program you're using to execute the packager.`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tlet authentication: Authentication | undefined;\n\n\t\tif (license) {\n\t\t\tconst fullLicensePath = path.resolve(process.cwd(), license);\n\t\t\ttry {\n\t\t\t\tconst content = fs.readFileSync(fullLicensePath);\n\t\t\t\tauthentication = {\n\t\t\t\t\ttype: \"license\",\n\t\t\t\t\tlicense: content.toString(\"base64\"),\n\t\t\t\t};\n\t\t\t} catch (err) {\n\t\t\t\tif (err?.code === \"ENOENT\") {\n\t\t\t\t\tcaptureError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t`Expected to find a license file at path: ${fullLicensePath}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcaptureError(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t`Failed to read license file at path: ${fullLicensePath}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (user && password) {\n\t\t\tconsole.log(\n\t\t\t\t`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`,\n\t\t\t);\n\t\t\tauthentication = {\n\t\t\t\ttype: \"credentials\",\n\t\t\t\tusername: user,\n\t\t\t\tpassword,\n\t\t\t};\n\t\t}\n\n\t\tconst { releaseFolder } = await import(\"./commands/publish\");\n\n\t\tconst prompter = createDefaultPrompter();\n\n\t\tconst fullOptions: ReleaseFolderOptions = {\n\t\t\t...options,\n\t\t\tauthentication,\n\t\t\tservice: service!,\n\t\t\tdirectory: folder,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\n\t\t\tworkspace,\n\t\t};\n\n\t\tawait releaseFolder(fullOptions).catch(captureError);\n\t},\n);\n\nyargsInstance.command({\n\tcommand: \"generateIndex [directory]\",\n\tbuilder: (argv) => {\n\t\treturn argv.option(\"ignore\", {\n\t\t\ttype: \"array\",\n\t\t\tdefault: [],\n\t\t\tdescription: translate(\"options.ignore.description\"),\n\t\t});\n\t},\n\thandler: async ({ directory, ignore }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tawait preCommandCheck(workspace);\n\n\t\tconst { extract } = await import(\"./commands/generate\");\n\n\t\tconst location = detectPackage(workspace, directory as string);\n\n\t\textract(location, ignore as string[]);\n\t},\n});\n\nyargsInstance.command({\n\tcommand: \"postinstall\",\n\tbuilder: (argv) => argv,\n\thandler: async () => {\n\t\tconst { executePostInstall } = await import(\"./commands/postinstall\");\n\n\t\texecutePostInstall(detectWorkspace(process.cwd()));\n\t},\n\tdescribe: \"Runs postinstall tasks\",\n});\n\nyargsInstance.command({\n\tcommand: \"publishNpm [directory]\",\n\tbuilder: (argv) =>\n\t\targv.options({\n\t\t\tnewVersion: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: translate(\"options.newVersion.description\"),\n\t\t\t\tdefault: process.env.VERSION,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\tdryRun: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t}),\n\thandler: async ({ directory, newVersion, dryRun }) => {\n\t\tconst workspace = detectWorkspace(process.cwd());\n\n\t\tconst { publishToNpm } = await import(\"./commands/publishNpm\");\n\n\t\tawait publishToNpm({\n\t\t\tworkspace,\n\t\t\tlocation: detectPackage(workspace, directory as string),\n\t\t\tversion: newVersion,\n\t\t\tdryRun,\n\t\t}).catch(captureError);\n\t},\n\tdescribe: \"Publishes the package to npm\",\n});\n\nyargsInstance\n\t.demandCommand()\n\t.pkgConf(\"packager\")\n\t.showHelpOnFail(false)\n\t.version().argv;\n"],"names":["__filename","fileURLToPath","import","meta","url","captureError","err","console","log","process","env","NODE_ENV","error","translate","message","buildOptions","outDir","description","type","default","coerce","input","undefined","path","resolve","cwd","minimize","clean","docs","preCommandCheck","workspaceLocation","executedLocalPackager","relative","indexOf","repositoryPackage","readWorkspaceNpmManifest","dependencies","devDependencies","parts","push","join","exit","notifier","updateNotifier","pkg","pjson","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","Error","scripts","postinstall","writeWorkspaceNpmManifest","yargsInstance","yargs","argv","slice","resolvePackagesFromArgs","args","workspace","folders","Map","arg","glob","sync","absolute","forEach","folder","location","detectPackage","set","Array","from","values","command","options","directories","detectWorkspace","buildFolders","length","packages","catch","noUpload","domain","subdomain","newVersion","VERSION","required","address","service","IG_GFX_ASSET_SERVICE","user","IG_GFX_USER","password","IG_GFX_PWD","pushOnly","license","IG_GFX_LICENSE","directory","endsWith","authentication","fullLicensePath","content","fs","readFileSync","toString","code","username","releaseFolder","prompter","createDefaultPrompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;;AAsBA,MAAMA,UAAU,GAAGC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAA;AAEjD,MAAMC,YAAY,GAAIC,GAAU,IAAK;AACpCC,EAAAA,OAAO,CAACC,GAAG,CAAC,EAAE,CAAC,CAAA;AAEf,EAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;AAC1CJ,IAAAA,OAAO,CAACK,KAAK,CAACN,GAAG,CAAC,CAAA;AACnB,GAAC,MAAM;IACNC,OAAO,C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,EAAE,8BAAA;AACX,CAAC,CAAC,CAAA;AAEFlE,aAAa,CACXsE,aAAa,EAAE,CACfC,OAAO,CAAC,UAAU,CAAC,CACnBC,cAAc,CAAC,KAAK,CAAC,CACrBH,OAAO,EAAE,CAACnE,IAAI"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import typedoc from 'typedoc';
|
|
2
|
+
import glob from 'glob';
|
|
3
|
+
import ts from 'typescript';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
|
|
6
|
+
const generateDocs = async (location, declarationFile, outFolder, name) => {
|
|
7
|
+
const app = new typedoc.Application();
|
|
8
|
+
const mediaDir = path.join(location.manifestDir, "Media");
|
|
9
|
+
app.bootstrap({
|
|
10
|
+
entryPoints: [declarationFile],
|
|
11
|
+
media: mediaDir,
|
|
12
|
+
out: outFolder,
|
|
13
|
+
tsconfig: path.join(location.scriptsDir, "tsconfig.json"),
|
|
14
|
+
skipErrorChecking: true
|
|
15
|
+
});
|
|
16
|
+
app.options.setCompilerOptions([declarationFile], {
|
|
17
|
+
target: ts.ScriptTarget.ES5
|
|
18
|
+
}, undefined);
|
|
19
|
+
app.options.setValue("name", name);
|
|
20
|
+
const [readmePath] = glob.sync("**/readme.md", {
|
|
21
|
+
absolute: true,
|
|
22
|
+
cwd: location.manifestDir
|
|
23
|
+
});
|
|
24
|
+
if (readmePath) {
|
|
25
|
+
app.options.setValue("readme", readmePath);
|
|
26
|
+
}
|
|
27
|
+
const project = app.convert();
|
|
28
|
+
if (project) {
|
|
29
|
+
await app.generateDocs(project, outFolder);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { generateDocs };
|
|
34
|
+
//# sourceMappingURL=docs.mjs.map
|