diff --git a/.gitignore b/.gitignore index 30d8a40..d5d2b0e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,7 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/definitions -/_commonjs -/_es2015 -/_bundles +/dist /tmp /coverage /out-tsc diff --git a/.npmignore b/.npmignore index d589a32..6286ae1 100644 --- a/.npmignore +++ b/.npmignore @@ -4,8 +4,8 @@ # But descend into directories # Recursively allow files under subtree -!/src/** -!/_commonjs/** +!/lib/** +!/dist/** !package.json !.npmignore !README.md diff --git a/.vscode/launch.json b/.vscode/launch.json index b319983..9af9b82 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "type": "node", "request": "launch", "name": "Test backup", - "program": "${workspaceFolder}\\src\\node-js\\cli\\app.ts", + "program": "${workspaceFolder}\\lib\\node\\cli\\app.ts", "preLaunchTask": "npm: build:all", "sourceMaps": true, "smartStep": true, @@ -24,7 +24,7 @@ "type": "node", "request": "launch", "name": "Test clean", - "program": "${workspaceFolder}\\src\\node-js\\cli\\app.ts", + "program": "${workspaceFolder}\\lib\\node\\cli\\app.ts", "preLaunchTask": "npm: build:all", "sourceMaps": true, "smartStep": true, @@ -40,7 +40,7 @@ "type": "node", "request": "launch", "name": "Test restore", - "program": "${workspaceFolder}\\src\\node-js\\cli\\app.ts", + "program": "${workspaceFolder}\\lib\\node\\cli\\app.ts", "preLaunchTask": "npm: build:all", "sourceMaps": true, "smartStep": true, diff --git a/src/clean/clean.models.ts b/lib/clean/clean.models.ts similarity index 100% rename from src/clean/clean.models.ts rename to lib/clean/clean.models.ts diff --git a/src/clean/clean.service.ts b/lib/clean/clean.service.ts similarity index 97% rename from src/clean/clean.service.ts rename to lib/clean/clean.service.ts index 919d031..496fcdb 100644 --- a/src/clean/clean.service.ts +++ b/lib/clean/clean.service.ts @@ -1,10 +1,10 @@ -import { AssetFolderModels, IManagementClient, ManagementClient } from '@kentico/kontent-management'; +import { AssetFolderModels, ManagementClient } from '@kentico/kontent-management'; import { ItemType } from '../core'; import { ICleanConfig, ICleanResult } from './clean.models'; export class CleanService { - private readonly client: IManagementClient; + private readonly client: ManagementClient; constructor(private config: ICleanConfig) { this.client = new ManagementClient({ diff --git a/src/clean/index.ts b/lib/clean/index.ts similarity index 100% rename from src/clean/index.ts rename to lib/clean/index.ts diff --git a/src/core/core.models.ts b/lib/core/core.models.ts similarity index 100% rename from src/core/core.models.ts rename to lib/core/core.models.ts diff --git a/src/core/global-helper.ts b/lib/core/global-helper.ts similarity index 100% rename from src/core/global-helper.ts rename to lib/core/global-helper.ts diff --git a/src/core/id-translate-helper.ts b/lib/core/id-translate-helper.ts similarity index 100% rename from src/core/id-translate-helper.ts rename to lib/core/id-translate-helper.ts diff --git a/src/core/index.ts b/lib/core/index.ts similarity index 100% rename from src/core/index.ts rename to lib/core/index.ts diff --git a/src/core/translation-helper.ts b/lib/core/translation-helper.ts similarity index 100% rename from src/core/translation-helper.ts rename to lib/core/translation-helper.ts diff --git a/src/export/export.models.ts b/lib/export/export.models.ts similarity index 100% rename from src/export/export.models.ts rename to lib/export/export.models.ts diff --git a/src/export/export.service.ts b/lib/export/export.service.ts similarity index 99% rename from src/export/export.service.ts rename to lib/export/export.service.ts index 4e17904..ec1baba 100644 --- a/src/export/export.service.ts +++ b/lib/export/export.service.ts @@ -2,7 +2,6 @@ import { ContentItemContracts, ContentTypeContracts, ContentTypeSnippetContracts, - IManagementClient, LanguageVariantContracts, ManagementClient, TaxonomyContracts, @@ -18,7 +17,7 @@ import { ItemType } from '../core'; import { version } from '../../package.json'; export class ExportService { - private readonly client: IManagementClient; + private readonly client: ManagementClient; constructor(private config: IExportConfig) { this.client = new ManagementClient({ diff --git a/src/export/index.ts b/lib/export/index.ts similarity index 100% rename from src/export/index.ts rename to lib/export/index.ts diff --git a/src/import/import.models.ts b/lib/import/import.models.ts similarity index 100% rename from src/import/import.models.ts rename to lib/import/import.models.ts diff --git a/src/import/import.service.ts b/lib/import/import.service.ts similarity index 98% rename from src/import/import.service.ts rename to lib/import/import.service.ts index 325c774..c9d53b3 100644 --- a/src/import/import.service.ts +++ b/lib/import/import.service.ts @@ -1,4 +1,3 @@ -import { HttpService } from '@kentico/kontent-core'; import { AssetContracts, AssetFolderContracts, @@ -9,7 +8,6 @@ import { ContentTypeContracts, ContentTypeModels, ContentTypeSnippetContracts, - IManagementClient, LanguageContracts, LanguageModels, LanguageVariantContracts, @@ -34,7 +32,7 @@ import { IBinaryFile, IImportConfig, IImportSource } from './import.models'; export class ImportService { private readonly defaultLanguageId: string = '00000000-0000-0000-0000-000000000000'; - private readonly client: IManagementClient; + private readonly client: ManagementClient; private readonly publishedWorkflowStepName: string = 'Published'; /** @@ -53,16 +51,7 @@ export class ImportService { canRetryError: (err) => true, // so that timeout errors are retried maxAttempts: 3, deltaBackoffMs: 1000, - maxCumulativeWaitTimeMs: 60000 - }, - httpService: new HttpService({ - axiosRequestConfig: { - // required for uploading large files - // https://github.com/axios/axios/issues/1362 - maxContentLength: 'Infinity' as any, - maxBodyLength: 'Infinity' as any - } - }) + } }); } diff --git a/src/import/index.ts b/lib/import/index.ts similarity index 100% rename from src/import/index.ts rename to lib/import/index.ts diff --git a/src/index.ts b/lib/index.ts similarity index 100% rename from src/index.ts rename to lib/index.ts diff --git a/src/node-js/cli/app.ts b/lib/node/cli/app.ts similarity index 68% rename from src/node-js/cli/app.ts rename to lib/node/cli/app.ts index aedf931..c6696ce 100644 --- a/src/node-js/cli/app.ts +++ b/lib/node/cli/app.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -import * as fs from 'fs'; -import yargs = require('yargs'); +import { readFileSync } from 'fs'; +import * as yargs from 'yargs'; import { CleanService } from '../../clean'; import { ICliFileConfig, getFilenameWithoutExtension, CliAction, ItemType } from '../../core'; @@ -11,7 +11,45 @@ import { ProjectContracts, SharedModels } from '@kentico/kontent-management'; import { FileService } from '../file/file.service'; import { fileHelper } from '../file/file-helper'; -const argv = yargs.argv; +const argv = yargs(process.argv.slice(2)) + .example('kbm --action=backup --apiKey=xxx --projectId=xxx', 'Creates zip backup of Kontent project') + .example( + 'kbm --action=restore --apiKey=xxx --projectId=xxx --zipFilename=backupFile', + 'Read given zip file and recreates data in Kontent project' + ) + .example( + 'kbm --action=clean --apiKey=xxx --projectId=xxx', + 'Deletes data from given Kontent project. Use with care, this action is not reversible.' + ) + .alias('p', 'projectId') + .describe('p', 'ProjectId') + .alias('k', 'apiKey') + .describe('k', 'Management API Key') + .alias('a', 'action') + .describe('a', 'Action to perform. One of: backup, restore & clean') + .alias('z', 'zipFilename') + .describe('z', 'Name of zip used for export / restore') + .alias('l', 'enableLog') + .describe('l', 'Indicates if default logging is enabled (useful to indicate progress)') + .alias('f', 'force') + .describe( + 'f', + 'If enabled, project will we exported / restored even if there are data inconsistencies. Enabled by default.' + ) + .alias('b', 'baseUrl') + .describe('b', 'Custom base URL for Management API calls.') + .alias('p', 'enablePublish') + .describe( + 'p', + 'Indicates if language variants published on the source project are also published on target. Enabled by default' + ) + .alias('e', 'exportFilter') + .describe( + 'e', + 'Can be used to export only selected data types. Expects CSV of types. For example contentType,language will cause backup manager to export only content types & language data.' + ) + .help('h') + .alias('h', 'help').argv; const backupAsync = async (config: ICliFileConfig) => { const exportService = new ExportService({ @@ -146,7 +184,7 @@ const validateConfig = (config?: ICliFileConfig) => { } }; -const process = async () => { +const run = async () => { const config = await getConfig(); validateConfig(config); @@ -183,28 +221,35 @@ const canImport = (importData: IImportSource, config: ICliFileConfig) => { }; const getConfig = async () => { - const configFilename: string = argv.config as string; + const resolvedArgs = await argv; + const configFilename: string = (await resolvedArgs.config) as string; if (configFilename) { // get config from file - const configFile = await fs.promises.readFile(`./${configFilename}`); + const configFile = readFileSync(`./${configFilename}`); return JSON.parse(configFile.toString()) as ICliFileConfig; } - const action: CliAction | undefined = argv.action as CliAction | undefined; - const apiKey: string | undefined = argv.apiKey as string | undefined; - const enableLog: boolean | undefined = (argv.enableLog as boolean | undefined) ?? true; - const force: boolean | undefined = (argv.force as boolean | undefined) ?? true; - const enablePublish: boolean | undefined = (argv.enablePublish as boolean | undefined) ?? true; - const projectId: string | undefined = argv.projectId as string | undefined; - const baseUrl: string | undefined = argv.baseUrl as string | undefined; - const zipFilename: string | undefined = (argv.zipFilename as string | undefined) ?? getDefaultBackupFilename(); - const exportFilter: string | undefined = argv.exportFilter as string | undefined; - - const exportFilterMapped: ItemType[] | undefined = exportFilter ? exportFilter.split(',').map(m => m.trim()).map(m => { - return m as ItemType; - }) : undefined; + const action: CliAction | undefined = resolvedArgs.action as CliAction | undefined; + const apiKey: string | undefined = resolvedArgs.apiKey as string | undefined; + const enableLog: boolean | undefined = (resolvedArgs.enableLog as boolean | undefined) ?? true; + const force: boolean | undefined = (resolvedArgs.force as boolean | undefined) ?? true; + const enablePublish: boolean | undefined = (resolvedArgs.enablePublish as boolean | undefined) ?? true; + const projectId: string | undefined = resolvedArgs.projectId as string | undefined; + const baseUrl: string | undefined = resolvedArgs.baseUrl as string | undefined; + const zipFilename: string | undefined = + (resolvedArgs.zipFilename as string | undefined) ?? getDefaultBackupFilename(); + const exportFilter: string | undefined = resolvedArgs.exportFilter as string | undefined; + + const exportFilterMapped: ItemType[] | undefined = exportFilter + ? exportFilter + .split(',') + .map((m) => m.trim()) + .map((m) => { + return m as ItemType; + }) + : undefined; if (!action) { throw Error(`No action was provided`); @@ -241,7 +286,7 @@ const getDefaultBackupFilename = () => { }-${date.getFullYear()}-${date.getHours()}-${date.getMinutes()}`; }; -process() +run() .then((m) => {}) .catch((err) => { if (err instanceof SharedModels.ContentManagementBaseKontentError) { diff --git a/src/node-js/cli/sample-config.json b/lib/node/cli/sample-config.json similarity index 100% rename from src/node-js/cli/sample-config.json rename to lib/node/cli/sample-config.json diff --git a/src/node-js/file/file-helper.ts b/lib/node/file/file-helper.ts similarity index 57% rename from src/node-js/file/file-helper.ts rename to lib/node/file/file-helper.ts index 7986945..a175186 100644 --- a/src/node-js/file/file-helper.ts +++ b/lib/node/file/file-helper.ts @@ -1,13 +1,11 @@ -import * as fs from 'fs'; +import { promises } from 'fs'; export class FileHelper { - async createFileInCurrentFolderAsync(filename: string, data: any): Promise { const filePath = './' + filename; - await fs.promises.writeFile(filePath, data); + await promises.writeFile(filePath, data); } - } -export const fileHelper = new FileHelper(); \ No newline at end of file +export const fileHelper = new FileHelper(); diff --git a/src/node-js/file/file.models.ts b/lib/node/file/file.models.ts similarity index 100% rename from src/node-js/file/file.models.ts rename to lib/node/file/file.models.ts diff --git a/src/node-js/file/file.service.ts b/lib/node/file/file.service.ts similarity index 87% rename from src/node-js/file/file.service.ts rename to lib/node/file/file.service.ts index e411b16..a2d45aa 100644 --- a/src/node-js/file/file.service.ts +++ b/lib/node/file/file.service.ts @@ -1,4 +1,4 @@ -import * as fs from 'fs'; +import { promises } from 'fs'; import { IFileServiceConfig } from './file.models'; export class FileService { @@ -15,7 +15,7 @@ export class FileService { if (this.config.enableLog) { console.log(`Reading file '${filePath}'`); } - const file = await fs.promises.readFile(filePath); + const file = await promises.readFile(filePath); if (this.config.enableLog) { console.log(`Reading file completed`); } @@ -27,7 +27,7 @@ export class FileService { const filePath = this.getFilePath(fileNameWithoutExtension); console.log(`Writing file '${filePath}'`); - await fs.promises.writeFile(filePath, content); + await promises.writeFile(filePath, content); console.log(`File saved`); } diff --git a/src/node-js/index.ts b/lib/node/index.ts similarity index 100% rename from src/node-js/index.ts rename to lib/node/index.ts diff --git a/src/samples/clean-sample.ts b/lib/samples/clean-sample.ts similarity index 90% rename from src/samples/clean-sample.ts rename to lib/samples/clean-sample.ts index 19ea392..e06a716 100644 --- a/src/samples/clean-sample.ts +++ b/lib/samples/clean-sample.ts @@ -1,4 +1,4 @@ -import { CleanService } from 'src'; +import { CleanService } from 'lib'; const run = async () => { const cleanService = new CleanService({ diff --git a/src/samples/export-sample.ts b/lib/samples/export-sample.ts similarity index 91% rename from src/samples/export-sample.ts rename to lib/samples/export-sample.ts index cc0d2f9..239320c 100644 --- a/src/samples/export-sample.ts +++ b/lib/samples/export-sample.ts @@ -1,7 +1,7 @@ -import { ZipService } from 'src/zip'; +import { ZipService } from 'lib/zip'; import { ExportService } from '../export'; -import { FileService } from '../node-js'; +import { FileService } from '../node'; const run = async () => { const fileService = new FileService({ diff --git a/src/samples/restore-sample.ts b/lib/samples/restore-sample.ts similarity index 92% rename from src/samples/restore-sample.ts rename to lib/samples/restore-sample.ts index 37875d9..7d64795 100644 --- a/src/samples/restore-sample.ts +++ b/lib/samples/restore-sample.ts @@ -1,6 +1,6 @@ -import { ImportService } from 'src'; +import { ImportService } from 'lib'; import { ZipService } from '../zip'; -import { FileService } from '../node-js'; +import { FileService } from '../node'; const run = async () => { const zipService = new ZipService({ diff --git a/src/zip/index.ts b/lib/zip/index.ts similarity index 100% rename from src/zip/index.ts rename to lib/zip/index.ts diff --git a/src/zip/zip.models.ts b/lib/zip/zip.models.ts similarity index 100% rename from src/zip/zip.models.ts rename to lib/zip/zip.models.ts diff --git a/src/zip/zip.service.ts b/lib/zip/zip.service.ts similarity index 99% rename from src/zip/zip.service.ts rename to lib/zip/zip.service.ts index 9a30b2e..a56798b 100644 --- a/src/zip/zip.service.ts +++ b/lib/zip/zip.service.ts @@ -1,5 +1,5 @@ import { AssetContracts } from '@kentico/kontent-management'; -import JSZip = require('jszip'); +import * as JSZip from 'jszip'; import axios, {} from 'axios'; import { IExportAllResult } from '../export'; diff --git a/package-lock.json b/package-lock.json index 17f83eb..3e2a224 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,21 +31,45 @@ } }, "@kentico/kontent-core": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@kentico/kontent-core/-/kontent-core-8.1.0.tgz", - "integrity": "sha512-hfRr0z6sJ24HUaWAuR7kmKbYOIxobbFGSdRVuDjENAZiTIKuiGE6Jv82sNuV3LPnwR0Hg2f8ncBliVI04CkP7w==", + "version": "9.0.0-next.2", + "resolved": "https://registry.npmjs.org/@kentico/kontent-core/-/kontent-core-9.0.0-next.2.tgz", + "integrity": "sha512-5L4p51EqLxjaSejqM8K93Jpq0GBGvzLUXtHo5eQOcIoEOkCJMs3YXRtIhuTHBe4UHshy7iy3i2AnJ5L9LJNEyg==", "requires": { "axios": "0.21.1" } }, "@kentico/kontent-management": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/@kentico/kontent-management/-/kontent-management-0.4.8.tgz", - "integrity": "sha512-hv7xuEbN/7poZOqykPceVh1IDT4il6yPwnxXmRRky3ZV5RQ1x4eYAYoMMB/AIY3w5IwYZGcpNkzNxtq9wEDlpA==", + "version": "1.0.0-next.3", + "resolved": "https://registry.npmjs.org/@kentico/kontent-management/-/kontent-management-1.0.0-next.3.tgz", + "integrity": "sha512-kw5xngF3NmOjiReJXh2qLi31INHPa8vqTnOWpkJiX93sippsnBndSq6ePGGcoRi/Q41EP8qa9pAsUMx6DeUTjw==", "requires": { - "@kentico/kontent-core": "8.1.0" + "@kentico/kontent-core": "9.0.0-next.2" } }, + "@tsconfig/node10": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.7.tgz", + "integrity": "sha512-aBvUmXLQbayM4w3A8TrjwrXs4DZ8iduJnuJLLRGdkWlyakCf1q6uHZJBzXoRA/huAEknG5tcUyQxN3A+In5euQ==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.7.tgz", + "integrity": "sha512-dgasobK/Y0wVMswcipr3k0HpevxFJLijN03A8mYfEPvWvOs14v0ZlYTR4kIgMx8g4+fTyTFv8/jLCIfRqLDJ4A==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.0.tgz", + "integrity": "sha512-RKkL8eTdPv6t5EHgFKIVQgsDapugbuOptNd9OOunN/HAkzmmTnZELx1kNCK0rSdUYGmiFMM3rRQMAWiyp023LQ==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.1.tgz", + "integrity": "sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA==", + "dev": true + }, "@types/jszip": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-3.4.1.tgz", @@ -62,9 +86,9 @@ "dev": true }, "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==", + "version": "15.12.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.1.tgz", + "integrity": "sha512-zyxJM8I1c9q5sRMtVF+zdd13Jt6RU4r4qfhTd7lQubyThvLfx6yYekWSQjGCGV2Tkecgxnlpl/DNlb6Hg+dmEw==", "dev": true }, "@types/normalize-package-data": { @@ -74,9 +98,9 @@ "dev": true }, "@types/yargs": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.0.tgz", - "integrity": "sha512-2nN6AGeMwe8+O6nO9ytQfbMQOJy65oi1yK2y/9oReR08DaXSGtMsrLyCM1ooKqfICpCx4oITaR4LkOmdzz41Ww==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.0.tgz", + "integrity": "sha512-RS7u2X7vdXjVQs160PWY1pjLBw6GJj04utojn0KU8p2rRZR37FSzzK6XOT+KLzT/DVbDYRyezroc0LHIvM5Z2A==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -560,9 +584,9 @@ } }, "detect-indent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true }, "detect-newline": { @@ -711,15 +735,10 @@ } } }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==" - }, "follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" }, "fs-access": { "version": "1.0.1", @@ -736,6 +755,12 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -781,9 +806,9 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "indent-string": { @@ -1029,6 +1054,15 @@ "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1036,9 +1070,9 @@ "dev": true }, "hosted-git-info": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz", - "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -1088,6 +1122,15 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-finite": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", @@ -1302,9 +1345,9 @@ "dev": true }, "map-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", "dev": true }, "meow": { @@ -1337,9 +1380,9 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "read-pkg": { @@ -1455,15 +1498,27 @@ "dev": true }, "normalize-package-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz", - "integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", "dev": true, "requires": { - "hosted-git-info": "^3.0.6", - "resolve": "^1.17.0", - "semver": "^7.3.2", + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + } } }, "null-check": { @@ -1613,9 +1668,9 @@ }, "dependencies": { "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "load-json-file": { @@ -1795,14 +1850,6 @@ "path-parse": "^1.0.6" } }, - "rxjs": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", - "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", - "requires": { - "tslib": "^1.9.0" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1810,9 +1857,9 @@ "dev": true }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -1883,9 +1930,9 @@ } }, "spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", "dev": true }, "split": { @@ -1913,9 +1960,9 @@ "dev": true }, "standard-version": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.1.1.tgz", - "integrity": "sha512-PF9JnRauBwH7DAkmefYu1mB2Kx0MVG13udqDTFmDUiogbyikBAHBdMrVuauxtAb2YIkyZ3FMYCNv0hqUKMOPww==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.3.0.tgz", + "integrity": "sha512-cYxxKXhYfI3S9+CA84HmrJa9B88H56V5FQ302iFF2TNwJukJCNoU8FgWt+11YtwKFXRkQQFpepC2QOF7aDq2Ow==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -1933,12 +1980,29 @@ "semver": "^7.1.1", "stringify-package": "^1.0.1", "yargs": "^16.0.0" + }, + "dependencies": { + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + } } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2017,9 +2081,9 @@ } }, "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true }, "trim-off-newlines": { @@ -2029,11 +2093,15 @@ "dev": true }, "ts-node": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", - "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.0.0.tgz", + "integrity": "sha512-ROWeOIUvfFbPZkoDis0L/55Fk+6gFQNZwwKPLinacRl6tsxstTF1DbAcLKkovwnpKMVvOMHP1TIbnwXwtLg1gg==", "dev": true, "requires": { + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", @@ -2043,9 +2111,10 @@ } }, "tslib": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.0.tgz", - "integrity": "sha512-+Zw5lu0D9tvBMjGP8LpvMb0u2WW2QV3y+D8mO6J+cNzCYIN4sVy43Bf9vl92nqFahutN0I8zHa7cc4vihIshnw==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "dev": true }, "tslint": { "version": "6.1.3", @@ -2073,6 +2142,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true } } }, @@ -2083,6 +2158,14 @@ "dev": true, "requires": { "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "type-fest": { @@ -2098,15 +2181,15 @@ "dev": true }, "typescript": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz", - "integrity": "sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", + "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", "dev": true }, "uglify-js": { - "version": "3.12.8", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.8.tgz", - "integrity": "sha512-fvBeuXOsvqjecUtF/l1dwsrrf5y2BCUk9AOJGzGcm6tE7vegku5u/YvqjyDaAGr422PLoLnrxg3EnRvTqsdC1w==", + "version": "3.13.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.9.tgz", + "integrity": "sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==", "dev": true, "optional": true }, @@ -2154,9 +2237,9 @@ "dev": true }, "y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==" + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, "yallist": { "version": "4.0.0", @@ -2165,9 +2248,9 @@ "dev": true }, "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz", + "integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -2176,20 +2259,12 @@ "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" - }, - "dependencies": { - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" - } } }, "yargs-parser": { "version": "20.2.6", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.6.tgz", - "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==", - "dev": true + "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==" }, "yn": { "version": "3.1.1", diff --git a/package.json b/package.json index c8a5c8d..c4f7746 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,37 @@ { "name": "@kentico/kontent-backup-manager", - "version": "1.16.0", + "version": "2.0.0-next.0", "description": "This utility enables backup & restore of Kentico Kontent projects", "preferGlobal": true, "bin": { - "kbm": "./_commonjs/src/node-js/cli/app.js" + "kbm": "./dist/cjs/lib/node/cli/app.js" }, "repository": { "type": "git", "url": "https://github.com/Kentico/kontent-backup-manager-js" }, "author": "richard sustek", - "main": "./_commonjs/src/index.js", + "main": "./dist/cjs/lib/index.js", + "module": "./dist/esm5/lib/index.js", + "es2015": "./dist/esm/lib/index.js", + "types": "./dist/cjs/lib/index.d.ts", "directories": {}, "scripts": { "test": "echo \"no global test configured\"", "release": "standard-version", - "tsc-local": "./node_modules/.bin/tsc", - "ts-node-local": "./node_modules/.bin/ts-node", "prepublishOnly": "npm run ts-lint:check && npm run build:all", "publish:beta": "npm publish --tag=next", - "build:commonjs": "npm run tsc-local -- -m commonjs --outDir _commonjs", - "build:all": "npm run build:commonjs", + "build:es2015": "tsc --p tsconfig.es2015.json", + "build:es5": "tsc --p tsconfig.es5.json", + "build:cjs": "tsc --p tsconfig.cjs.json", + "build:all": "npm run build:cjs && npm run build:es5 && npm run build:es2015", "test:all": "npm run build:all", - "test:backup": "npm run build:commonjs && cd output && node ../_commonjs/src/node-js/cli/app --config=backup-config.json", - "test:clean": "npm run build:commonjs && cd output && node ../_commonjs/src/node-js/cli/app --config=clean-config.json", - "test:restore": "npm run build:commonjs && cd output && node ../_commonjs/src/node-js/cli/app --config=restore-config.json", - "ts-lint-local": "./node_modules/.bin/tslint", - "ts-lint:fix": "npm run ts-lint:check -- --fix", - "ts-lint:check": "npm run ts-lint-local -- --project ./tsconfig.json" + "test:backup": "npm run build:cjs && cd output && node ../dist/cjs/lib/node/cli/app --config=backup-config.json", + "test:clean": "npm run build:cjs && cd output && node ../dist/cjs/lib/node/cli/app --config=clean-config.json", + "test:restore": "npm run build:cjs && cd output && node ../dist/cjs/lib/node/cli/app --config=restore-config.json", + "ts-lint:fix": "tslint --project ./tsconfig.json", + "ts-lint:check": "tslint --project ./tsconfig.json" }, - "types": "./_commonjs/src/index.d.ts", "keywords": [ "Kentico", "Kontent", @@ -42,19 +43,18 @@ ], "license": "MIT", "dependencies": { - "@kentico/kontent-management": "0.4.8", + "@kentico/kontent-management": "1.0.0-next.3", "jszip": "3.6.0", - "rxjs": "6.6.3", - "yargs": "16.2.0", - "flatted": "3.1.1" + "yargs": "17.0.1" }, "devDependencies": { + "tslib": "2.2.0", "@types/jszip": "3.4.1", - "@types/node": "14.14.31", - "@types/yargs": "16.0.0", - "standard-version": "9.1.1", - "ts-node": "9.1.1", + "@types/node": "15.12.1", + "@types/yargs": "17.0.0", + "standard-version": "9.3.0", + "ts-node": "10.0.0", "tslint": "6.1.3", - "typescript": "4.1.5" + "typescript": "4.3.2" } } diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 0000000..990d931 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "downlevelIteration": true, + "outDir": "dist/cjs", + "baseUrl": "." + }, + "include": [ + "lib/**/*" + ], +} \ No newline at end of file diff --git a/tsconfig.es2015.json b/tsconfig.es2015.json new file mode 100644 index 0000000..ed913f3 --- /dev/null +++ b/tsconfig.es2015.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "importHelpers": true, + "target": "es2015", + "outDir": "dist/es2015" + }, + "include": [ + "lib/**/*" + ] +} \ No newline at end of file diff --git a/tsconfig.es5.json b/tsconfig.es5.json new file mode 100644 index 0000000..cb05608 --- /dev/null +++ b/tsconfig.es5.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "importHelpers": true, + "target": "es5", + "downlevelIteration": true, + "outDir": "dist/es5" + }, + "include": [ + "lib/**/*" + ] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 736618f..78d4d8e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,37 +1,39 @@ { "compileOnSave": true, "compilerOptions": { - "skipLibCheck": true, - "baseUrl": ".", - "sourceMap": true, - "declaration": true, - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "module": "commonjs", - "target": "es5", - "strictNullChecks": true, - "strictPropertyInitialization": true, - "resolveJsonModule": true, - "noImplicitReturns": true, - "allowUnreachableCode": false, - "alwaysStrict": true, - "forceConsistentCasingInFileNames": true, - "noUnusedParameters": false, - "noUnusedLocals": false, - "strictFunctionTypes": true, - "noImplicitAny": true, - "typeRoots": [ - "./node_modules/@types" - ], - "lib": [ - "es2015" - ] + "baseUrl": ".", + "outDir": "dist", + "sourceMap": true, + "declaration": true, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "esnext", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "resolveJsonModule": true, + "noImplicitReturns": true, + "allowUnreachableCode": false, + "alwaysStrict": true, + "forceConsistentCasingInFileNames": true, + "noUnusedParameters": false, + "noUnusedLocals": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "typeRoots": [ + "./node_modules/@types" + ], + "lib": [ + "esnext", + "dom" + ] }, "include": [ - "src/**/*" + "lib/**/*", + "test/**/*", ], "exclude": [ - "node_modules" + "node_modules" ] -} \ No newline at end of file + } \ No newline at end of file