@react-datatable/cli 1.2.1 → 1.2.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/bin/react-datatable.mjs +66 -0
- package/package.json +1 -1
package/bin/react-datatable.mjs
CHANGED
|
@@ -322,11 +322,77 @@ async function installDatatable(cwd, plan, token) {
|
|
|
322
322
|
if (plan.noInstall) {
|
|
323
323
|
console.log("Dependency installation skipped by --no-install.")
|
|
324
324
|
}
|
|
325
|
+
printLicenseSummary(manifest.license, path.relative(cwd, path.join(targetPath, "LICENSE.react-datatable.txt")) || "LICENSE.react-datatable.txt")
|
|
325
326
|
} finally {
|
|
326
327
|
await rm(tempDir, { recursive: true, force: true })
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
330
|
|
|
331
|
+
function printLicenseSummary(license, licensePath) {
|
|
332
|
+
if (!license?.licenseType || !license?.licenseeName) {
|
|
333
|
+
return
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
console.log("")
|
|
337
|
+
console.log("License Summary:")
|
|
338
|
+
console.log(`- Licensed to: ${license.licenseeName}`)
|
|
339
|
+
console.log(`- License type: ${formatLicenseType(license.licenseType)}`)
|
|
340
|
+
|
|
341
|
+
if (license.licenseType === "commercial") {
|
|
342
|
+
console.log("- Scope: Use in unlimited internal or commercial applications for the licensed company or individual.")
|
|
343
|
+
console.log("- Source code: May be modified for licensed applications and kept in private repositories.")
|
|
344
|
+
console.log("- Distribution: May be bundled only as part of compiled production builds.")
|
|
345
|
+
console.log("- Not allowed: resale, redistribution, sublicensing, open-source publishing, or transfer to another company or client.")
|
|
346
|
+
} else if (license.licenseType === "trial") {
|
|
347
|
+
const trialPeriod = formatTrialPeriod(license.startsAt, license.expiresAt)
|
|
348
|
+
if (trialPeriod) {
|
|
349
|
+
console.log(`- Trial period: ${trialPeriod}`)
|
|
350
|
+
}
|
|
351
|
+
console.log("- Purpose: Trying and evaluating the software during the trial period.")
|
|
352
|
+
console.log("- Not allowed: internal applications, commercial applications, production deployment, customer-facing products, or revenue-generating products.")
|
|
353
|
+
console.log("- Source code: May not be published open source, redistributed, sublicensed, resold, or transferred.")
|
|
354
|
+
} else if (license.licenseType === "community") {
|
|
355
|
+
console.log("- Scope: Non-commercial projects only.")
|
|
356
|
+
console.log("- Source code: May be modified for those non-commercial projects and kept private.")
|
|
357
|
+
console.log("- Distribution: May be bundled only as part of compiled production builds for non-commercial projects.")
|
|
358
|
+
console.log("- Revocation: License may be revoked without prior notice; after revocation, the software must be removed within 90 days.")
|
|
359
|
+
console.log("- Not allowed: commercial use, internal business use, resale, redistribution, sublicensing, open-source publishing, or transfer.")
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
console.log("")
|
|
363
|
+
console.log("For binding terms, read:")
|
|
364
|
+
console.log(licensePath)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function formatLicenseType(type) {
|
|
368
|
+
if (type === "commercial") return "Commercial"
|
|
369
|
+
if (type === "trial") return "Trial"
|
|
370
|
+
if (type === "community") return "Community"
|
|
371
|
+
return type
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function formatTrialPeriod(startsAt, expiresAt) {
|
|
375
|
+
if (!startsAt || !expiresAt) {
|
|
376
|
+
return ""
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return `${formatLicenseDate(startsAt)} to ${formatLicenseDate(expiresAt)}`
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function formatLicenseDate(value) {
|
|
383
|
+
const date = new Date(value)
|
|
384
|
+
if (Number.isNaN(date.getTime())) {
|
|
385
|
+
return String(value)
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
389
|
+
month: "long",
|
|
390
|
+
day: "numeric",
|
|
391
|
+
year: "numeric",
|
|
392
|
+
timeZone: "UTC",
|
|
393
|
+
}).format(date)
|
|
394
|
+
}
|
|
395
|
+
|
|
330
396
|
async function fetchInstallManifest(manifestUrl, token) {
|
|
331
397
|
const response = await fetch(manifestUrl, {
|
|
332
398
|
method: "POST",
|