@intelligentgraphics/ig.gfx.packager 3.0.0-beta.0 → 3.0.0-beta.2
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 +44 -338
- 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/commands/{generate.ts.mjs → generate.mjs} +3 -13
- package/build/commands/generate.mjs.map +1 -0
- package/build/commands/{postinstall.ts.mjs → postinstall.mjs} +4 -11
- package/build/commands/postinstall.mjs.map +1 -0
- package/build/commands/{publish.mjs → 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/commands/{publishNpm.ts.mjs → publishNpm.mjs} +11 -19
- 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} +4 -64
- 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/package.json +2 -2
- package/readme.md +9 -0
- package/build/commands/build.mjs +0 -326
- package/build/commands/build.mjs.map +0 -1
- package/build/commands/generate.ts.mjs.map +0 -1
- package/build/commands/postinstall.ts.mjs.map +0 -1
- package/build/commands/publish.mjs.map +0 -1
- package/build/commands/publishNpm.ts.mjs.map +0 -1
- package/build/dependencies.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,328 +1,17 @@
|
|
|
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
|
-
const instance = y18n({
|
|
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 stripUtf8Bom = text => {
|
|
35
|
-
// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
|
|
36
|
-
// conversion translates it to FEFF (UTF-16 BOM).
|
|
37
|
-
if (text.charCodeAt(0) === 0xfeff) {
|
|
38
|
-
return text.slice(1);
|
|
39
|
-
}
|
|
40
|
-
return text;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const readNpmManifest = directory => {
|
|
44
|
-
const packageJsonPath = path.join(directory, "package.json");
|
|
45
|
-
const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {
|
|
46
|
-
encoding: "utf8"
|
|
47
|
-
}));
|
|
48
|
-
return JSON.parse(packageJson);
|
|
49
|
-
};
|
|
50
|
-
const writeNpmManifest = (directory, packageJson) => {
|
|
51
|
-
const packageJsonPath = path.join(directory, "package.json");
|
|
52
|
-
writePackageSync(packageJsonPath, packageJson);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Functionality related to working with a single package.
|
|
56
|
-
const PACKAGE_FILE = "_Package.json";
|
|
57
|
-
const INDEX_FILE = "_Index.json";
|
|
58
|
-
const ANIMATION_FILE_SUFFIX = ".animation.json";
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Describes the location of a single package.
|
|
62
|
-
*
|
|
63
|
-
* @export
|
|
64
|
-
* @interface PackageLocation
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
const parseCreatorPackageName = manifest => {
|
|
68
|
-
const [domain, ...subdomainParts] = manifest.Package.split(".");
|
|
69
|
-
return {
|
|
70
|
-
domain,
|
|
71
|
-
subdomain: subdomainParts.join(".")
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Detects the package at the given directory.
|
|
76
|
-
*
|
|
77
|
-
* @param {string} directory
|
|
78
|
-
* @returns {PackageLocation}
|
|
79
|
-
*/
|
|
80
|
-
const detectPackage = (workspace, directory) => {
|
|
81
|
-
directory = path.resolve(workspace.path, directory);
|
|
82
|
-
const scriptsPath = path.join(directory, "Scripts");
|
|
83
|
-
const tsPath = path.join(directory, "ts");
|
|
84
|
-
let location;
|
|
85
|
-
if (fs.existsSync(scriptsPath)) {
|
|
86
|
-
location = {
|
|
87
|
-
_kind: "PackageLocation",
|
|
88
|
-
path: directory,
|
|
89
|
-
scriptsDir: scriptsPath,
|
|
90
|
-
manifestDir: scriptsPath
|
|
91
|
-
};
|
|
92
|
-
} else if (fs.existsSync(tsPath)) {
|
|
93
|
-
location = {
|
|
94
|
-
_kind: "PackageLocation",
|
|
95
|
-
path: directory,
|
|
96
|
-
scriptsDir: tsPath,
|
|
97
|
-
manifestDir: directory
|
|
98
|
-
};
|
|
99
|
-
} else {
|
|
100
|
-
location = {
|
|
101
|
-
_kind: "PackageLocation",
|
|
102
|
-
path: directory,
|
|
103
|
-
scriptsDir: directory,
|
|
104
|
-
manifestDir: directory
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
readPackageCreatorManifest(location);
|
|
109
|
-
} catch (err) {
|
|
110
|
-
if (isErrorENOENT(err)) {
|
|
111
|
-
throw new Error(`No _Package.json found in ${location.manifestDir}`);
|
|
112
|
-
}
|
|
113
|
-
throw err;
|
|
114
|
-
}
|
|
115
|
-
return location;
|
|
116
|
-
};
|
|
117
|
-
const readPackageCreatorManifest = location => {
|
|
118
|
-
const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);
|
|
119
|
-
const packageJson = stripUtf8Bom(fs.readFileSync(packageJsonPath, {
|
|
120
|
-
encoding: "utf8"
|
|
121
|
-
}));
|
|
122
|
-
const result = JSON.parse(packageJson);
|
|
123
|
-
return {
|
|
124
|
-
...result,
|
|
125
|
-
Scope: result.Scope || result.Package
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
const writePackageCreatorManifest = (location, creatorPackage) => {
|
|
129
|
-
const packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);
|
|
130
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(creatorPackage, null, "\t") + "\n");
|
|
131
|
-
};
|
|
132
|
-
const readPackageCreatorIndex = location => {
|
|
133
|
-
try {
|
|
134
|
-
const indexPath = path.join(location.manifestDir, INDEX_FILE);
|
|
135
|
-
const index = stripUtf8Bom(fs.readFileSync(indexPath, {
|
|
136
|
-
encoding: "utf8"
|
|
137
|
-
}));
|
|
138
|
-
return JSON.parse(index);
|
|
139
|
-
} catch (err) {
|
|
140
|
-
if (isErrorENOENT(err)) {
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
throw err;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
const writePackageCreatorIndex = (location, index) => {
|
|
147
|
-
const packageJsonPath = path.join(location.manifestDir, INDEX_FILE);
|
|
148
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(index, null, "\t") + "\n");
|
|
149
|
-
};
|
|
150
|
-
const readPackageNpmManifest = location => {
|
|
151
|
-
try {
|
|
152
|
-
return readNpmManifest(location.manifestDir);
|
|
153
|
-
} catch (err) {
|
|
154
|
-
if (isErrorENOENT(err)) {
|
|
155
|
-
return undefined;
|
|
156
|
-
}
|
|
157
|
-
throw err;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const writePackageNpmManifest = (location, packageJson) => {
|
|
161
|
-
writeNpmManifest(location.manifestDir, packageJson);
|
|
162
|
-
};
|
|
163
|
-
const readPackageAnimationList = location => {
|
|
164
|
-
const directoryContent = fs.readdirSync(location.manifestDir);
|
|
165
|
-
const animationPathList = [];
|
|
166
|
-
for (const entry of directoryContent) {
|
|
167
|
-
if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {
|
|
168
|
-
const animationPath = path.join(location.manifestDir, entry);
|
|
169
|
-
animationPathList.push(animationPath);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return animationPathList;
|
|
173
|
-
};
|
|
174
|
-
const getPackageReleasesDirectory = location => path.join(location.path, "Releases");
|
|
175
|
-
|
|
176
|
-
// Functionality related to working with a workspace consisting of multiple packages.
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Describe the location of a workspace constining of n packages.
|
|
180
|
-
*
|
|
181
|
-
* @export
|
|
182
|
-
* @interface WorkspaceLocation
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
const detectWorkspace = directory => {
|
|
186
|
-
directory = path.resolve(process.cwd(), directory);
|
|
187
|
-
return {
|
|
188
|
-
_kind: "WorkspaceLocation",
|
|
189
|
-
path: directory
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
const readWorkspaceNpmManifest = workspace => {
|
|
193
|
-
try {
|
|
194
|
-
return readNpmManifest(workspace.path);
|
|
195
|
-
} catch (err) {
|
|
196
|
-
if (isErrorENOENT(err)) {
|
|
197
|
-
return undefined;
|
|
198
|
-
}
|
|
199
|
-
throw err;
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
const writeWorkspaceNpmManifest = (workspace, packageJson) => writeNpmManifest(workspace.path, packageJson);
|
|
203
|
-
const getWorkspaceOutputPath = workspace => path.join(workspace.path, "bin");
|
|
204
|
-
const getWorkspaceLibPath = workspace => path.join(workspace.path, "lib");
|
|
205
|
-
function* iterateWorkspacePackages(workspace) {
|
|
206
|
-
const entries = fs.readdirSync(workspace.path, {
|
|
207
|
-
withFileTypes: true
|
|
208
|
-
});
|
|
209
|
-
for (const entry of entries) {
|
|
210
|
-
if (!entry.isDirectory()) {
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
try {
|
|
214
|
-
yield detectPackage(workspace, entry.name);
|
|
215
|
-
} catch {}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const createDefaultPrompter = () => {
|
|
220
|
-
return {
|
|
221
|
-
confirm: async message => {
|
|
222
|
-
const {
|
|
223
|
-
confirm
|
|
224
|
-
} = await inquirer.prompt([{
|
|
225
|
-
type: "confirm",
|
|
226
|
-
message,
|
|
227
|
-
name: "confirm"
|
|
228
|
-
}]);
|
|
229
|
-
return confirm;
|
|
230
|
-
},
|
|
231
|
-
ask: async question => {
|
|
232
|
-
const {
|
|
233
|
-
answer
|
|
234
|
-
} = await inquirer.prompt([{
|
|
235
|
-
type: "list",
|
|
236
|
-
message: question.message,
|
|
237
|
-
name: "answer",
|
|
238
|
-
choices: question.options,
|
|
239
|
-
default: question.default
|
|
240
|
-
}]);
|
|
241
|
-
return answer;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
var name = "@intelligentgraphics/ig.gfx.packager";
|
|
247
|
-
var version = "3.0.0-beta.0";
|
|
248
|
-
var description = "IG.GFX.Packager 3.0.0 Beta 0 (3.0.0.11)";
|
|
249
|
-
var author = "Michael Beier <mb@intelligentgraphics.biz>";
|
|
250
|
-
var main = "build/index.mjs";
|
|
251
|
-
var type = "module";
|
|
252
|
-
var publishConfig = {
|
|
253
|
-
access: "public"
|
|
254
|
-
};
|
|
255
|
-
var engines = {
|
|
256
|
-
node: ">=16.19.0"
|
|
257
|
-
};
|
|
258
|
-
var bin = {
|
|
259
|
-
packager: "./build/index.mjs"
|
|
260
|
-
};
|
|
261
|
-
var files = [
|
|
262
|
-
"build",
|
|
263
|
-
"locales",
|
|
264
|
-
"scripts"
|
|
265
|
-
];
|
|
266
|
-
var scripts = {
|
|
267
|
-
dist: "rollup -c rollup.config.mjs",
|
|
268
|
-
clean: "rimraf build *.tsbuildinfo",
|
|
269
|
-
prepublishOnly: "yarn clean && yarn dist",
|
|
270
|
-
test: "vitest",
|
|
271
|
-
format: "prettier --write \"**/*.{ts,tsx,json}\""
|
|
272
|
-
};
|
|
273
|
-
var dependencies = {
|
|
274
|
-
ajv: "^8.12.0",
|
|
275
|
-
axios: "^1.2.5",
|
|
276
|
-
"core-js": "^3.27.2",
|
|
277
|
-
glob: "^8.1.0",
|
|
278
|
-
inquirer: "^9.1.4",
|
|
279
|
-
jszip: "^3.10.1",
|
|
280
|
-
lodash: "^4.17.21",
|
|
281
|
-
resolve: "^1.22.1",
|
|
282
|
-
"simple-git": "^3.16.0",
|
|
283
|
-
"source-map-support": "^0.5.21",
|
|
284
|
-
terser: "^5.16.1",
|
|
285
|
-
typedoc: "~0.23.2",
|
|
286
|
-
typescript: "~4.9.4",
|
|
287
|
-
"update-notifier": "^6.0.2",
|
|
288
|
-
"v8-compile-cache": "^2.3.0",
|
|
289
|
-
"write-pkg": "^5.1.0",
|
|
290
|
-
y18n: "^5.0.8",
|
|
291
|
-
yargs: "^17.6.2"
|
|
292
|
-
};
|
|
293
|
-
var devDependencies = {
|
|
294
|
-
"@babel/preset-env": "^7.18.9",
|
|
295
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
296
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
297
|
-
"@rollup/plugin-commonjs": "^24.0.0",
|
|
298
|
-
"@rollup/plugin-json": "^6.0.0",
|
|
299
|
-
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
300
|
-
"@types/glob": "^8.0.1",
|
|
301
|
-
"@types/inquirer": "^9.0.3",
|
|
302
|
-
"@types/node": "^16.4.11",
|
|
303
|
-
"@types/update-notifier": "^6.0.1",
|
|
304
|
-
"@types/yargs": "^17.0.2",
|
|
305
|
-
rollup: "^3.10.0",
|
|
306
|
-
vitest: "^0.28.1"
|
|
307
|
-
};
|
|
308
|
-
var pjson = {
|
|
309
|
-
name: name,
|
|
310
|
-
version: version,
|
|
311
|
-
description: description,
|
|
312
|
-
author: author,
|
|
313
|
-
main: main,
|
|
314
|
-
"private": false,
|
|
315
|
-
type: type,
|
|
316
|
-
publishConfig: publishConfig,
|
|
317
|
-
engines: engines,
|
|
318
|
-
bin: bin,
|
|
319
|
-
files: files,
|
|
320
|
-
scripts: scripts,
|
|
321
|
-
dependencies: dependencies,
|
|
322
|
-
devDependencies: devDependencies
|
|
323
|
-
};
|
|
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';
|
|
324
11
|
|
|
325
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const pjson = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
|
|
326
15
|
const captureError = err => {
|
|
327
16
|
console.log("");
|
|
328
17
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -358,11 +47,10 @@ const buildOptions = {
|
|
|
358
47
|
default: false
|
|
359
48
|
}
|
|
360
49
|
};
|
|
361
|
-
const preCommandCheck = async
|
|
50
|
+
const preCommandCheck = async workspaceLocation => {
|
|
362
51
|
var _repositoryPackage, _repositoryPackage$de, _repositoryPackage2, _repositoryPackage2$d;
|
|
363
52
|
const executedLocalPackager = path.relative(process.cwd(), __filename).indexOf("..") === -1;
|
|
364
53
|
let repositoryPackage;
|
|
365
|
-
const workspaceLocation = detectWorkspace(process.cwd());
|
|
366
54
|
try {
|
|
367
55
|
repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);
|
|
368
56
|
} catch (err) {}
|
|
@@ -398,17 +86,38 @@ Run "npm install" to get rid of the local packager version.`);
|
|
|
398
86
|
writeWorkspaceNpmManifest(workspaceLocation, repositoryPackage);
|
|
399
87
|
};
|
|
400
88
|
const yargsInstance = yargs(process.argv.slice(2));
|
|
89
|
+
const resolvePackagesFromArgs = (args = [], workspace) => {
|
|
90
|
+
const folders = new Map();
|
|
91
|
+
for (const arg of args) {
|
|
92
|
+
glob.sync(arg, {
|
|
93
|
+
cwd: workspace.path,
|
|
94
|
+
absolute: true
|
|
95
|
+
}).forEach(folder => {
|
|
96
|
+
try {
|
|
97
|
+
const location = detectPackage(workspace, folder);
|
|
98
|
+
folders.set(folder, location);
|
|
99
|
+
} catch (err) {}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return Array.from(folders.values());
|
|
103
|
+
};
|
|
401
104
|
yargsInstance.command("build [directories...]", "Builds the specified directories", argv => argv.options(buildOptions), async ({
|
|
402
105
|
directories = [],
|
|
403
106
|
...options
|
|
404
107
|
}) => {
|
|
405
|
-
|
|
108
|
+
const workspace = detectWorkspace(options.cwd);
|
|
109
|
+
const folders = resolvePackagesFromArgs(options.directories, workspace);
|
|
110
|
+
await preCommandCheck(workspace);
|
|
406
111
|
const {
|
|
407
112
|
buildFolders
|
|
408
|
-
} = await import('./commands/build.mjs')
|
|
113
|
+
} = await import('./commands/build/index.mjs');
|
|
114
|
+
if (folders.length === 0) {
|
|
115
|
+
return console.log(translate("messages.buildSkipEmpty"));
|
|
116
|
+
}
|
|
409
117
|
await buildFolders({
|
|
410
118
|
...options,
|
|
411
|
-
|
|
119
|
+
packages: folders,
|
|
120
|
+
workspace
|
|
412
121
|
}).catch(captureError);
|
|
413
122
|
});
|
|
414
123
|
yargsInstance.command("publish [directory]", "Publishes the specified directory", argv => argv.options({
|
|
@@ -476,7 +185,9 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
|
|
|
476
185
|
license,
|
|
477
186
|
...options
|
|
478
187
|
}) => {
|
|
479
|
-
|
|
188
|
+
const workspace = detectWorkspace(options.cwd);
|
|
189
|
+
const folder = detectPackage(workspace, directory);
|
|
190
|
+
await preCommandCheck(workspace);
|
|
480
191
|
if (!options.noUpload) {
|
|
481
192
|
if (!service) {
|
|
482
193
|
captureError(new Error(translate("options.service.demands", "IG_GFX_ASSET_SERVICE")));
|
|
@@ -520,16 +231,17 @@ yargsInstance.command("publish [directory]", "Publishes the specified directory"
|
|
|
520
231
|
}
|
|
521
232
|
const {
|
|
522
233
|
releaseFolder
|
|
523
|
-
} = await import('./commands/publish.mjs');
|
|
234
|
+
} = await import('./commands/publish/index.mjs');
|
|
524
235
|
const prompter = createDefaultPrompter();
|
|
525
236
|
const fullOptions = {
|
|
526
237
|
...options,
|
|
527
238
|
authentication,
|
|
528
239
|
service: service,
|
|
529
|
-
directory:
|
|
240
|
+
directory: folder,
|
|
530
241
|
banner: true,
|
|
531
242
|
prompter,
|
|
532
|
-
newVersion: options.newVersion
|
|
243
|
+
newVersion: options.newVersion,
|
|
244
|
+
workspace
|
|
533
245
|
};
|
|
534
246
|
await releaseFolder(fullOptions).catch(captureError);
|
|
535
247
|
});
|
|
@@ -546,11 +258,11 @@ yargsInstance.command({
|
|
|
546
258
|
directory,
|
|
547
259
|
ignore
|
|
548
260
|
}) => {
|
|
549
|
-
|
|
261
|
+
const workspace = detectWorkspace(process.cwd());
|
|
262
|
+
await preCommandCheck(workspace);
|
|
550
263
|
const {
|
|
551
264
|
extract
|
|
552
|
-
} = await import('./commands/generate.
|
|
553
|
-
const workspace = detectWorkspace(process.cwd());
|
|
265
|
+
} = await import('./commands/generate.mjs');
|
|
554
266
|
const location = detectPackage(workspace, directory);
|
|
555
267
|
extract(location, ignore);
|
|
556
268
|
}
|
|
@@ -561,7 +273,7 @@ yargsInstance.command({
|
|
|
561
273
|
handler: async () => {
|
|
562
274
|
const {
|
|
563
275
|
executePostInstall
|
|
564
|
-
} = await import('./commands/postinstall.
|
|
276
|
+
} = await import('./commands/postinstall.mjs');
|
|
565
277
|
executePostInstall(detectWorkspace(process.cwd()));
|
|
566
278
|
},
|
|
567
279
|
describe: "Runs postinstall tasks"
|
|
@@ -587,7 +299,7 @@ yargsInstance.command({
|
|
|
587
299
|
const workspace = detectWorkspace(process.cwd());
|
|
588
300
|
const {
|
|
589
301
|
publishToNpm
|
|
590
|
-
} = await import('./commands/publishNpm.
|
|
302
|
+
} = await import('./commands/publishNpm.mjs');
|
|
591
303
|
await publishToNpm({
|
|
592
304
|
workspace,
|
|
593
305
|
location: detectPackage(workspace, directory),
|
|
@@ -598,10 +310,4 @@ yargsInstance.command({
|
|
|
598
310
|
describe: "Publishes the package to npm"
|
|
599
311
|
});
|
|
600
312
|
yargsInstance.demandCommand().pkgConf("packager").showHelpOnFail(false).version().argv;
|
|
601
|
-
|
|
602
|
-
var cli = /*#__PURE__*/Object.freeze({
|
|
603
|
-
__proto__: null
|
|
604
|
-
});
|
|
605
|
-
|
|
606
|
-
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, stripUtf8Bom as s, translate as t, writePackageCreatorManifest as w };
|
|
607
313
|
//# 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/stripUtf8Bom.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\";\nimport * as path from \"path\";\nimport { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst instance = y18n({\n\tdirectory: path.join(__dirname, \"..\", \"locales\"),\n\tupdateFiles: false,\n\tlocale: \"en\",\n\tfallbackToLanguage: true,\n});\n\nexport const setLocale = (locale: string) => {\n\tinstance.setLocale(locale);\n};\n\nexport const translate = (key: string, ...args: string[]) =>\n\tinstance.__(key, ...args);\n","interface NodeError extends Error {\n\tcode: string;\n}\n\nexport const getNodeErrorCode = (error: unknown) => {\n\tif (\n\t\terror !== null &&\n\t\ttypeof error === \"object\" &&\n\t\t(error as NodeError).code !== undefined\n\t) {\n\t\treturn (error as NodeError).code;\n\t}\n};\n\n/**\n * Permission denied: An attempt was made to access a file in a way forbidden by its file access permissions.\n *\n * @param {unknown} error\n */\nexport const isErrorEACCES = (error: unknown) =>\n\tgetNodeErrorCode(error) === \"EACCES\";\n\n/**\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.\n *\n * @param {unknown} error\n */\nexport const isErrorENOENT = (error: unknown) =>\n\tgetNodeErrorCode(error) === \"ENOENT\";\n","export const stripUtf8Bom = (text: string) => {\n\t// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string\n\t// conversion translates it to FEFF (UTF-16 BOM).\n\tif (text.charCodeAt(0) === 0xfeff) {\n\t\treturn text.slice(1);\n\t}\n\n\treturn text;\n};\n","import * as fs from \"fs\";\nimport * as path from \"path\";\nimport { writePackageSync } from \"write-pkg\";\n\nimport { PackageJSON } from \"./packageJSON\";\nimport { stripUtf8Bom } from \"./stripUtf8Bom\";\n\nexport const readNpmManifest = <T extends PackageJSON>(\n\tdirectory: string,\n): T => {\n\tconst packageJsonPath = path.join(directory, \"package.json\");\n\tconst packageJson = stripUtf8Bom(\n\t\tfs.readFileSync(packageJsonPath, {\n\t\t\tencoding: \"utf8\",\n\t\t}),\n\t);\n\treturn JSON.parse(packageJson);\n};\n\nexport const writeNpmManifest = <T extends PackageJSON>(\n\tdirectory: string,\n\tpackageJson: T,\n) => {\n\tconst packageJsonPath = path.join(directory, \"package.json\");\n\twritePackageSync(packageJsonPath, packageJson);\n};\n","// Functionality related to working with a single package.\n\nimport * as path from \"path\";\nimport * as fs from \"fs\";\n\nimport { isErrorENOENT } from \"./error\";\nimport { WorkspaceLocation } from \"./workspace\";\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\nimport { PackageJSON } from \"./packageJSON\";\nimport { stripUtf8Bom } from \"./stripUtf8Bom\";\n\nexport const PACKAGE_FILE = \"_Package.json\";\nexport const INDEX_FILE = \"_Index.json\";\nconst ANIMATION_FILE_SUFFIX = \".animation.json\";\n\n/**\n * Describes the location of a single package.\n *\n * @export\n * @interface PackageLocation\n */\nexport interface PackageLocation {\n\t_kind: \"PackageLocation\";\n\t/**\n\t * Main directory of a package\n\t *\n\t * @type {string}\n\t */\n\tpath: string;\n\t/**\n\t * Directory containing the typescript files\n\t *\n\t * @type {string}\n\t */\n\tscriptsDir: string;\n\t/**\n\t * Diretory containing the _Package.json, _Index.json, package.json and animation.json files\n\t *\n\t * @type {string}\n\t */\n\tmanifestDir: string;\n}\n\nexport interface CreatorPackage {\n\tScope: string;\n\tPackage: string;\n\tRunTime: boolean;\n\tType: \"Interactor\" | \"Mixed\" | \"Core\" | \"Context\" | \"Evaluator\";\n}\n\nexport type CreatorIndex = CreatorIndexEntry[];\n\nexport interface CreatorIndexEntry {\n\tName: string;\n\tDescription?: string;\n\tType: \"Interactor\" | \"Evaluator\";\n\tParameters: CreatorIndexParameter[];\n}\n\nexport interface CreatorIndexParameter {\n\tName: string;\n\tType: CreatorIndexParameterType;\n\tDescription?: string;\n\tDefault?: unknown;\n\tDisplayIndex: number;\n}\n\nexport type CreatorIndexParameterType =\n\t| \"String\"\n\t| \"LengthM\"\n\t| \"Material\"\n\t| \"Boolean\"\n\t| \"Bool\"\n\t| \"ArcDEG\"\n\t| \"Integer\"\n\t| \"Int\"\n\t| \"Float\";\n\nexport const parseCreatorPackageName = (manifest: CreatorPackage) => {\n\tconst [domain, ...subdomainParts] = manifest.Package.split(\".\");\n\treturn {\n\t\tdomain,\n\t\tsubdomain: subdomainParts.join(\".\"),\n\t};\n};\n\nexport interface PackageNpmManifest extends PackageJSON {\n\tig?: {\n\t\tscriptingLibrary?: boolean;\n\t};\n}\n\n/**\n * Detects the package at the given directory.\n *\n * @param {string} directory\n * @returns {PackageLocation}\n */\nexport const detectPackage = (\n\tworkspace: WorkspaceLocation,\n\tdirectory: string,\n): PackageLocation => {\n\tdirectory = path.resolve(workspace.path, directory);\n\n\tconst scriptsPath = path.join(directory, \"Scripts\");\n\tconst tsPath = path.join(directory, \"ts\");\n\n\tlet location: PackageLocation;\n\n\tif (fs.existsSync(scriptsPath)) {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: scriptsPath,\n\t\t\tmanifestDir: scriptsPath,\n\t\t};\n\t} else if (fs.existsSync(tsPath)) {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: tsPath,\n\t\t\tmanifestDir: directory,\n\t\t};\n\t} else {\n\t\tlocation = {\n\t\t\t_kind: \"PackageLocation\",\n\t\t\tpath: directory,\n\t\t\tscriptsDir: directory,\n\t\t\tmanifestDir: directory,\n\t\t};\n\t}\n\n\ttry {\n\t\treadPackageCreatorManifest(location);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\tthrow new Error(\n\t\t\t\t`No _Package.json found in ${location.manifestDir}`,\n\t\t\t);\n\t\t}\n\t\tthrow err;\n\t}\n\n\treturn location;\n};\n\nexport const readPackageCreatorManifest = (\n\tlocation: PackageLocation,\n): CreatorPackage => {\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n\tconst packageJson = stripUtf8Bom(\n\t\tfs.readFileSync(packageJsonPath, { encoding: \"utf8\" }),\n\t);\n\tconst result: Omit<CreatorPackage, \"Scope\"> & { Scope?: string } =\n\t\tJSON.parse(packageJson);\n\treturn {\n\t\t...result,\n\t\tScope: result.Scope || result.Package,\n\t};\n};\n\nexport const writePackageCreatorManifest = (\n\tlocation: PackageLocation,\n\tcreatorPackage: CreatorPackage,\n) => {\n\tconst packageJsonPath = path.join(location.manifestDir, PACKAGE_FILE);\n\tfs.writeFileSync(\n\t\tpackageJsonPath,\n\t\tJSON.stringify(creatorPackage, null, \"\\t\") + \"\\n\",\n\t);\n};\n\nexport const readPackageCreatorIndex = (\n\tlocation: PackageLocation,\n): CreatorIndex | undefined => {\n\ttry {\n\t\tconst indexPath = path.join(location.manifestDir, INDEX_FILE);\n\t\tconst index = stripUtf8Bom(\n\t\t\tfs.readFileSync(indexPath, { encoding: \"utf8\" }),\n\t\t);\n\t\treturn JSON.parse(index);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writePackageCreatorIndex = (\n\tlocation: PackageLocation,\n\tindex: CreatorIndex,\n) => {\n\tconst packageJsonPath = path.join(location.manifestDir, INDEX_FILE);\n\tfs.writeFileSync(packageJsonPath, JSON.stringify(index, null, \"\\t\") + \"\\n\");\n};\n\nexport const readPackageNpmManifest = (\n\tlocation: PackageLocation,\n): PackageNpmManifest | undefined => {\n\ttry {\n\t\treturn readNpmManifest(location.manifestDir);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writePackageNpmManifest = (\n\tlocation: PackageLocation,\n\tpackageJson: PackageNpmManifest,\n) => {\n\twriteNpmManifest(location.manifestDir, packageJson);\n};\n\nexport const readPackageAnimationList = (location: PackageLocation) => {\n\tconst directoryContent = fs.readdirSync(location.manifestDir);\n\tconst animationPathList: string[] = [];\n\n\tfor (const entry of directoryContent) {\n\t\tif (entry.endsWith(ANIMATION_FILE_SUFFIX)) {\n\t\t\tconst animationPath = path.join(location.manifestDir, entry);\n\t\t\tanimationPathList.push(animationPath);\n\t\t}\n\t}\n\n\treturn animationPathList;\n};\n\nexport const getPackageReleasesDirectory = (location: PackageLocation) =>\n\tpath.join(location.path, \"Releases\");\n\nexport const arePackageLocationsEqual = (\n\ta: PackageLocation,\n\tb: PackageLocation,\n) => a.path === b.path;\n","// Functionality related to working with a workspace consisting of multiple packages.\n\nimport * as path from \"path\";\nimport * as fs from \"fs\";\n\nimport { PackageJSON } from \"./packageJSON\";\nimport { isErrorENOENT } from \"./error\";\nimport { readNpmManifest, writeNpmManifest } from \"./npmPackage\";\nimport { detectPackage } from \"./package\";\n\n/**\n * Describe the location of a workspace constining of n packages.\n *\n * @export\n * @interface WorkspaceLocation\n */\nexport interface WorkspaceLocation {\n\t_kind: \"WorkspaceLocation\";\n\tpath: string;\n}\n\nexport interface WorkspacePackageJSON extends PackageJSON {\n\tpackager?: { banner?: string };\n}\n\nexport const detectWorkspace = (directory: string): WorkspaceLocation => {\n\tdirectory = path.resolve(process.cwd(), directory);\n\treturn {\n\t\t_kind: \"WorkspaceLocation\",\n\t\tpath: directory,\n\t};\n};\n\nexport const readWorkspaceNpmManifest = (\n\tworkspace: WorkspaceLocation,\n): WorkspacePackageJSON | undefined => {\n\ttry {\n\t\treturn readNpmManifest<WorkspacePackageJSON>(workspace.path);\n\t} catch (err) {\n\t\tif (isErrorENOENT(err)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthrow err;\n\t}\n};\n\nexport const writeWorkspaceNpmManifest = <T extends WorkspacePackageJSON>(\n\tworkspace: WorkspaceLocation,\n\tpackageJson: T,\n) => writeNpmManifest(workspace.path, packageJson);\n\nexport const getWorkspaceOutputPath = (workspace: WorkspaceLocation) =>\n\tpath.join(workspace.path, \"bin\");\n\nexport const getWorkspaceLibPath = (workspace: WorkspaceLocation) =>\n\tpath.join(workspace.path, \"lib\");\n\nexport function* iterateWorkspacePackages(workspace: WorkspaceLocation) {\n\tconst entries = fs.readdirSync(workspace.path, { withFileTypes: true });\n\n\tfor (const entry of entries) {\n\t\tif (!entry.isDirectory()) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tyield detectPackage(workspace, entry.name);\n\t\t} catch {}\n\t}\n}\n","import inquirer from \"inquirer\";\n\nexport interface PrompterQuestion {\n\tmessage: string;\n\toptions: string[];\n\tdefault?: string;\n}\n\nexport interface Prompter {\n\tconfirm(message: string): Promise<boolean>;\n\n\task(question: PrompterQuestion): Promise<string>;\n}\n\nexport const createDefaultPrompter = (): Prompter => {\n\treturn {\n\t\tconfirm: async (message) => {\n\t\t\tconst { confirm } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tmessage,\n\t\t\t\t\tname: \"confirm\",\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn confirm as boolean;\n\t\t},\n\n\t\task: async (question) => {\n\t\t\tconst { answer } = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: \"list\",\n\t\t\t\t\tmessage: question.message,\n\t\t\t\t\tname: \"answer\",\n\t\t\t\t\tchoices: question.options,\n\t\t\t\t\tdefault: question.default,\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn answer as string;\n\t\t},\n\t};\n};\n","import updateNotifier from \"update-notifier\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport yargs from \"yargs/yargs\";\nimport { fileURLToPath } from \"url\";\n\nimport { translate } from \"./lib/localization\";\nimport { Authentication } from \"./lib/authentication\";\nimport { detectPackage } from \"./lib/package\";\nimport {\n\tdetectWorkspace,\n\treadWorkspaceNpmManifest,\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 () => {\n\tconst executedLocalPackager =\n\t\tpath.relative(process.cwd(), __filename).indexOf(\"..\") === -1;\n\n\tlet repositoryPackage: PackageJSON | undefined;\n\n\tconst workspaceLocation = detectWorkspace(process.cwd());\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\nyargsInstance.command(\n\t\"build [directories...]\",\n\t\"Builds the specified directories\",\n\t(argv) => argv.options(buildOptions),\n\tasync ({ directories = [], ...options }) => {\n\t\tawait preCommandCheck();\n\n\t\tconst { buildFolders } = await import(\"./commands/build\");\n\n\t\tawait buildFolders({\n\t\t\t...options,\n\t\t\tdirectories: directories as string[],\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\tawait preCommandCheck();\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: directory as string,\n\t\t\tbanner: true,\n\t\t\tprompter,\n\t\t\tnewVersion: options.newVersion!,\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\tawait preCommandCheck();\n\n\t\tconst { extract } = await import(\"./commands/generate\");\n\n\t\tconst workspace = detectWorkspace(process.cwd());\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":["__dirname","dirname","fileURLToPath","import","meta","url","instance","y18n","directory","path","join","updateFiles","locale","fallbackToLanguage","translate","key","args","__","getNodeErrorCode","error","code","undefined","isErrorENOENT","stripUtf8Bom","text","charCodeAt","slice","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","workspaceLocation","dependencies","devDependencies","parts","exit","notifier","updateNotifier","pkg","pjson","shouldNotifyInNpmScript","updateCheckInterval","notify","isGlobal","defer","scripts","postinstall","yargsInstance","yargs","argv","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;AAClBC,EAAAA,MAAM,EAAE,IAAI;AACZC,EAAAA,kBAAkB,EAAE,IAAA;AACrB,CAAC,CAAC,CAAA;MAMWC,SAAS,GAAG,CAACC,GAAW,EAAE,GAAGC,IAAc,KACvDV,QAAQ,CAACW,EAAE,CAACF,GAAG,EAAE,GAAGC,IAAI;;ACflB,MAAME,gBAAgB,GAAIC,KAAc,IAAK;AACnD,EAAA,IACCA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,KAAK,QAAQ,IACxBA,KAAK,CAAeC,IAAI,KAAKC,SAAS,EACtC;IACD,OAAQF,KAAK,CAAeC,IAAI,CAAA;AACjC,GAAA;AACD,CAAC,CAAA;;AAUD;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GAAIH,KAAc,IAC3CD,gBAAgB,CAACC,KAAK,CAAC,KAAK;;AC5BhBI,MAAAA,YAAY,GAAIC,IAAY,IAAK;AAC7C;AACA;EACA,IAAIA,IAAI,CAACC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;AAClC,IAAA,OAAOD,IAAI,CAACE,KAAK,CAAC,CAAC,CAAC,CAAA;AACrB,GAAA;AAEA,EAAA,OAAOF,IAAI,CAAA;AACZ;;ACDaG,MAAAA,eAAe,GAC3B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G,EAAE,CAAC,CAAA;IAEhD,MAAM;AAAE+F,MAAAA,YAAAA;AAAa,KAAC,GAAG,MAAM,OAAO,8BAAuB,CAAC,CAAA;AAE9D,IAAA,MAAMA,YAAY,CAAC;MAClBlI,SAAS;AACTI,MAAAA,QAAQ,EAAEL,aAAa,CAACC,SAAS,EAAExC,SAAS,CAAW;AACvD2K,MAAAA,OAAO,EAAE/B,UAAU;AACnB6B,MAAAA,MAAAA;AACD,KAAC,CAAC,CAAC/B,KAAK,CAACxC,YAAY,CAAC,CAAA;GACtB;AACDsE,EAAAA,QAAQ,EAAE,8BAAA;AACX,CAAC,CAAC,CAAA;AAEFpC,aAAa,CACXwC,aAAa,EAAE,CACfC,OAAO,CAAC,UAAU,CAAC,CACnBC,cAAc,CAAC,KAAK,CAAC,CACrBH,OAAO,EAAE,CAACrC,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\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst pjson: PackageJSON = JSON.parse(\n\tfs.readFileSync(path.join(__dirname, \"..\", \"package.json\"), \"utf8\"),\n);\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","__dirname","path","dirname","pjson","JSON","parse","fs","readFileSync","join","captureError","err","console","log","process","env","NODE_ENV","error","translate","message","buildOptions","outDir","description","type","default","coerce","input","undefined","resolve","cwd","minimize","clean","docs","preCommandCheck","workspaceLocation","executedLocalPackager","relative","indexOf","repositoryPackage","readWorkspaceNpmManifest","dependencies","devDependencies","parts","push","exit","notifier","updateNotifier","pkg","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","toString","code","username","releaseFolder","prompter","createDefaultPrompter","fullOptions","banner","builder","option","handler","ignore","extract","executePostInstall","describe","dryRun","publishToNpm","version","demandCommand","pkgConf","showHelpOnFail"],"mappings":";;;;;;;;;;;AAoBA,MAAMA,UAAU,GAAGC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAA;AACjD,MAAMC,SAAS,GAAGC,IAAI,CAACC,OAAO,CAACP,UAAU,CAAC,CAAA;AAE1C,MAAMQ,KAAkB,GAAGC,IAAI,CAACC,KAAK,CACpCC,EAAE,CAACC,YAAY,CAACN,IAAI,CAACO,IAAI,CAACR,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACnE,CAAA;AAED,MAAMS,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,CAACK,KAAK,CAACC,SAAS,CAAC,gBAAgB,EAAEP,GAAG,CAACQ,OAAO,CAAC,CAAC,CAAA;AACxD,GAAA;AACD,CAAC,CAAA;AAED,MAAMC,YAAY,GAAG;AACpBC,EAAAA,MAAM,EAAE;AACPC,IAAAA,WAAW,EAAEJ,SAAS,CAAC,4BAA4B,CAAC;AACpDK,IAAAA,IAAI,EAAE,QAAQ;AACdC,IAAAA,OAAO,EAAE,KAAK;IACdC,MAAM,EAAGC,KAAgC,IACxCA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,GAClCC,SAAS,GACTzB,IAAI,CAAC0B,OAAO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CAACoB,OAAO,CAAC;AACZU,IAAAA,UAAU,EAAE;AACXlE,MAAAA,IAAI,EAAE,QAAQ;AACdD,MAAAA,WAAW,EAAEJ,SAAS,CAAC,gCAAgC,CAAC;AACxDM,MAAAA,OAAO,EAAEV,OAAO,CAACC,GAAG,CAAC2E,OAAO;AAC5BC,MAAAA,QAAQ,EAAE,IAAA;KACV;AACD+B,IAAAA,MAAM,EAAE;AACPnG,MAAAA,IAAI,EAAE,SAAA;AACP,KAAA;AACD,GAAC,CAAC;AACH8F,EAAAA,OAAO,EAAE,OAAO;IAAEf,SAAS;IAAEb,UAAU;AAAEiC,IAAAA,MAAAA;AAAO,GAAC,KAAK;IACrD,MAAM3D,SAAS,GAAGkB,eAAe,CAACnE,OAAO,CAACe,GAAG,EAAE,CAAC,CAAA;IAEhD,MAAM;AAAE8F,MAAAA,YAAAA;AAAa,KAAC,GAAG,MAAM,OAAO,2BAAuB,CAAC,CAAA;AAE9D,IAAA,MAAMA,YAAY,CAAC;MAClB5D,SAAS;AACTS,MAAAA,QAAQ,EAAEC,aAAa,CAACV,SAAS,EAAEuC,SAAS,CAAW;AACvDsB,MAAAA,OAAO,EAAEnC,UAAU;AACnBiC,MAAAA,MAAAA;AACD,KAAC,CAAC,CAACrC,KAAK,CAAC3E,YAAY,CAAC,CAAA;GACtB;AACD+G,EAAAA,QAAQ,EAAE,8BAAA;AACX,CAAC,CAAC,CAAA;AAEFhE,aAAa,CACXoE,aAAa,EAAE,CACfC,OAAO,CAAC,UAAU,CAAC,CACnBC,cAAc,CAAC,KAAK,CAAC,CACrBH,OAAO,EAAE,CAACjE,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.mjs","sources":["../../../src/commands/build/docs.ts"],"sourcesContent":["import typedoc from \"typedoc\";\nimport glob from \"glob\";\nimport ts from \"typescript\";\nimport * as path from \"path\";\nimport { PackageLocation } from \"../../lib/package\";\n\nexport const generateDocs = async (\n\tlocation: PackageLocation,\n\tdeclarationFile: string,\n\toutFolder: string,\n\tname: string,\n) => {\n\tconst app = new typedoc.Application();\n\n\tconst mediaDir = path.join(location.manifestDir, \"Media\");\n\n\tapp.bootstrap({\n\t\tentryPoints: [declarationFile],\n\t\tmedia: mediaDir,\n\t\tout: outFolder,\n\t\ttsconfig: path.join(location.scriptsDir, \"tsconfig.json\"),\n\t\tskipErrorChecking: true,\n\t});\n\n\tapp.options.setCompilerOptions(\n\t\t[declarationFile],\n\t\t{\n\t\t\ttarget: ts.ScriptTarget.ES5,\n\t\t},\n\t\tundefined,\n\t);\n\n\tapp.options.setValue(\"name\", name);\n\n\tconst [readmePath] = glob.sync(\"**/readme.md\", {\n\t\tabsolute: true,\n\t\tcwd: location.manifestDir,\n\t});\n\n\tif (readmePath) {\n\t\tapp.options.setValue(\"readme\", readmePath);\n\t}\n\n\tconst project = app.convert();\n\n\tif (project) {\n\t\tawait app.generateDocs(project, outFolder);\n\t}\n};\n"],"names":["generateDocs","location","declarationFile","outFolder","name","app","typedoc","Application","mediaDir","path","join","manifestDir","bootstrap","entryPoints","media","out","tsconfig","scriptsDir","skipErrorChecking","options","setCompilerOptions","target","ts","ScriptTarget","ES5","undefined","setValue","readmePath","glob","sync","absolute","cwd","project","convert"],"mappings":";;;;;AAMO,MAAMA,YAAY,GAAG,OAC3BC,QAAyB,EACzBC,eAAuB,EACvBC,SAAiB,EACjBC,IAAY,KACR;AACJ,EAAA,MAAMC,GAAG,GAAG,IAAIC,OAAO,CAACC,WAAW,EAAE,CAAA;EAErC,MAAMC,QAAQ,GAAGC,IAAI,CAACC,IAAI,CAACT,QAAQ,CAACU,WAAW,EAAE,OAAO,CAAC,CAAA;EAEzDN,GAAG,CAACO,SAAS,CAAC;IACbC,WAAW,EAAE,CAACX,eAAe,CAAC;AAC9BY,IAAAA,KAAK,EAAEN,QAAQ;AACfO,IAAAA,GAAG,EAAEZ,SAAS;IACda,QAAQ,EAAEP,IAAI,CAACC,IAAI,CAACT,QAAQ,CAACgB,UAAU,EAAE,eAAe,CAAC;AACzDC,IAAAA,iBAAiB,EAAE,IAAA;AACpB,GAAC,CAAC,CAAA;EAEFb,GAAG,CAACc,OAAO,CAACC,kBAAkB,CAC7B,CAAClB,eAAe,CAAC,EACjB;AACCmB,IAAAA,MAAM,EAAEC,EAAE,CAACC,YAAY,CAACC,GAAAA;GACxB,EACDC,SAAS,CACT,CAAA;EAEDpB,GAAG,CAACc,OAAO,CAACO,QAAQ,CAAC,MAAM,EAAEtB,IAAI,CAAC,CAAA;EAElC,MAAM,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