diff --git a/VERSION b/VERSION index eb1591a..fe059cc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.20 \ No newline at end of file +0.0.22 \ No newline at end of file diff --git a/dist/js/class/PackageCreator.js b/dist/js/class/PackageCreator.js index 327a59a..71d9c06 100644 --- a/dist/js/class/PackageCreator.js +++ b/dist/js/class/PackageCreator.js @@ -19,6 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); // ============================================================================ var promises_1 = __importDefault(require("fs/promises")); var path_1 = __importDefault(require("path")); +// import { PackageJson } from '../interface/PackageJson.js'; var package_config_js_1 = __importDefault(require("../config/package.config.js")); // ============================================================================ // Classes diff --git a/dist/js/function/readPackageJson.d.ts b/dist/js/function/readPackageJson.d.ts new file mode 100644 index 0000000..bf8e1d8 --- /dev/null +++ b/dist/js/function/readPackageJson.d.ts @@ -0,0 +1,7 @@ +/** + * Reads and parses the package.json file. + * @param packageJsonPath - The path to the package.json file. + * @returns The parsed package.json object. + */ +declare function readPackageJson(packageJsonPath: string): Promise; +export default readPackageJson; diff --git a/dist/js/function/readPackageJson.js b/dist/js/function/readPackageJson.js new file mode 100644 index 0000000..888c813 --- /dev/null +++ b/dist/js/function/readPackageJson.js @@ -0,0 +1,19 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// Assuming you're using ES6 module syntax +var promises_1 = __importDefault(require("fs/promises")); +var path_1 = __importDefault(require("path")); +/** + * Reads and parses the package.json file. + * @param packageJsonPath - The path to the package.json file. + * @returns The parsed package.json object. + */ +async function readPackageJson(packageJsonPath) { + const fullPath = path_1.default.resolve(packageJsonPath); + const fileContent = await promises_1.default.readFile(fullPath, 'utf-8'); + return JSON.parse(fileContent); +} +exports.default = readPackageJson; diff --git a/dist/js/index.d.ts b/dist/js/index.d.ts index 216ad57..f39690a 100644 --- a/dist/js/index.d.ts +++ b/dist/js/index.d.ts @@ -17,4 +17,5 @@ import TemplateWriter from './class/TemplateWriter.js'; import SvgToPngConverter from './class/SvgToPngConverter.js'; import gl_installer from './function/gl_installer'; import cleanDirectory from './function/clean_directory'; -export { DirectoryCleaner, DirectoryCopier, DirectoryCreator, FileCopier, FileRenamer, FontGenerator, PackageCreator, SvgPackager, StyleProcessor, SvgSpriteGenerator, VersionWriter, TypeScriptCompiler, JavaScriptMinifier, NpmCommandRunner, StylizedLogger, TemplateWriter, SvgToPngConverter, gl_installer, cleanDirectory, }; +import readPackageJson from "./function/readPackageJson.js"; +export { DirectoryCleaner, DirectoryCopier, DirectoryCreator, FileCopier, FileRenamer, FontGenerator, PackageCreator, SvgPackager, StyleProcessor, SvgSpriteGenerator, VersionWriter, TypeScriptCompiler, JavaScriptMinifier, NpmCommandRunner, StylizedLogger, TemplateWriter, SvgToPngConverter, gl_installer, cleanDirectory, readPackageJson, }; diff --git a/dist/js/index.js b/dist/js/index.js index 63aec03..de86d16 100644 --- a/dist/js/index.js +++ b/dist/js/index.js @@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.cleanDirectory = exports.gl_installer = exports.SvgToPngConverter = exports.TemplateWriter = exports.StylizedLogger = exports.NpmCommandRunner = exports.JavaScriptMinifier = exports.TypeScriptCompiler = exports.VersionWriter = exports.SvgSpriteGenerator = exports.StyleProcessor = exports.SvgPackager = exports.PackageCreator = exports.FontGenerator = exports.FileRenamer = exports.FileCopier = exports.DirectoryCreator = exports.DirectoryCopier = exports.DirectoryCleaner = void 0; +exports.readPackageJson = exports.cleanDirectory = exports.gl_installer = exports.SvgToPngConverter = exports.TemplateWriter = exports.StylizedLogger = exports.NpmCommandRunner = exports.JavaScriptMinifier = exports.TypeScriptCompiler = exports.VersionWriter = exports.SvgSpriteGenerator = exports.StyleProcessor = exports.SvgPackager = exports.PackageCreator = exports.FontGenerator = exports.FileRenamer = exports.FileCopier = exports.DirectoryCreator = exports.DirectoryCopier = exports.DirectoryCleaner = void 0; // Copyright 2023 Scape Agency BV // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -59,3 +59,5 @@ var gl_installer_1 = __importDefault(require("./function/gl_installer")); exports.gl_installer = gl_installer_1.default; var clean_directory_1 = __importDefault(require("./function/clean_directory")); exports.cleanDirectory = clean_directory_1.default; +var readPackageJson_js_1 = __importDefault(require("./function/readPackageJson.js")); +exports.readPackageJson = readPackageJson_js_1.default; diff --git a/dist/js/interface/PackageJson.d.ts b/dist/js/interface/PackageJson.d.ts deleted file mode 100644 index 0942d41..0000000 --- a/dist/js/interface/PackageJson.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -export interface PackageJson { - name: string; - version: string; - description?: string; - main?: string; - scripts?: Record; - dependencies?: Record; - devDependencies?: Record; - repository?: { - type: string; - url: string; - }; - keywords?: string[]; - author?: string | { - name: string; - email?: string; - url?: string; - }; - license?: string; - bugs?: { - url?: string; - email?: string; - }; - homepage?: string; - private?: boolean; - peerDependencies?: Record; - engines?: { - node?: string; - npm?: string; - }; - bin?: Record; - types?: string; - contributors?: Array; - funding?: string | { - type: string; - url: string; - }; - files?: string[]; - browserslist?: string[] | Record; - publishConfig?: Record; - config?: Record; - typings?: string; - exports?: Record; - module?: string; - sideEffects?: boolean | string[]; - optionalDependencies?: Record; - bundledDependencies?: string[]; - peerDependenciesMeta?: Record; - resolutions?: Record; - workspaces?: string[] | { - packages: string[]; - }; - eslintConfig?: Record; - babel?: Record; - prettier?: Record; - husky?: Record; - jest?: Record; - enginesStrict?: boolean; - os?: string[]; - cpu?: string[]; -} diff --git a/dist/js/interface/PackageJson.js b/dist/js/interface/PackageJson.js deleted file mode 100644 index 7f5f816..0000000 --- a/dist/js/interface/PackageJson.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -// ============================================================================ -// Interfaces -// ============================================================================ -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/package.json b/dist/package.json index 6af293d..57ede8c 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1,6 +1,6 @@ { "name": "pack.gl", - "version": "0.0.20", + "version": "0.0.22", "description": "Package Builder.", "keywords": [ "pack.gl", diff --git a/dist/ts/class/PackageCreator.ts b/dist/ts/class/PackageCreator.ts index 7ce9fc2..5337a10 100644 --- a/dist/ts/class/PackageCreator.ts +++ b/dist/ts/class/PackageCreator.ts @@ -21,9 +21,10 @@ import fs from 'fs/promises'; import path from 'path'; -import { PackageJson } from '../interface/PackageJson.js'; +// import { PackageJson } from '../interface/PackageJson.js'; import packageConfig from "../config/package.config.js" + // ============================================================================ // Classes // ============================================================================ diff --git a/dist/ts/index.ts b/dist/ts/index.ts index e784d3a..11f2926 100644 --- a/dist/ts/index.ts +++ b/dist/ts/index.ts @@ -43,6 +43,7 @@ import SvgToPngConverter from './class/SvgToPngConverter.js'; // Import | Internal Functions import gl_installer from './function/gl_installer'; import cleanDirectory from './function/clean_directory'; +import readPackageJson from "./function/readPackageJson.js" // ============================================================================ @@ -75,5 +76,6 @@ export { // Export | Internal Functions gl_installer, cleanDirectory, + readPackageJson, }; diff --git a/package.json b/package.json index ed4d4d9..904d97e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pack.gl", "description": "Package Builder.", - "version": "0.0.21", + "version": "0.0.22", "config": { "version_short": "0.0" }, diff --git a/script/js/config/config.js.map b/script/js/config/config.js.map index 8859d25..20bb397 100644 --- a/script/js/config/config.js.map +++ b/script/js/config/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../ts/config/config.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,IAAM,MAAM,GAAG;IAClB,IAAI,EAAE;QACF,GAAG,EAAO,OAAO;QACjB,IAAI,EAAO,QAAQ;QAEnB,WAAW,EAAS,QAAQ;QAC5B,QAAQ,EAAY,UAAU;QAC9B,SAAS,EAAW,WAAW;QAC/B,SAAS,EAAW,WAAW;KAElC;CAEJ,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../ts/config/config.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,IAAM,MAAM,GAAG;IAClB,IAAI,EAAE;QACF,GAAG,EAAO,OAAO;QACjB,IAAI,EAAO,QAAQ;QACnB,WAAW,EAAS,QAAQ;QAC5B,QAAQ,EAAY,UAAU;QAC9B,SAAS,EAAW,WAAW;QAC/B,SAAS,EAAW,WAAW;KAElC;CAEJ,CAAC"} \ No newline at end of file diff --git a/script/js/index.js.map b/script/js/index.js.map index 971f2f9..7d53bc4 100644 --- a/script/js/index.js.map +++ b/script/js/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";AAsBA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAEhB,aAAa,EAGb,kBAAkB,GAErB,MAAM,SAAS,CAAC;AACjB,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAkB3D,IAAM,UAAU,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAe5C,IAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AAC1C,IAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAC9C,IAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAChD,IAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAEhD,IAAM,MAAM,GAAG;IACX,IAAI,EAAE;QACF,GAAG,EAAO,OAAO;QACjB,IAAI,EAAO,QAAQ;QACnB,WAAW,EAAS,QAAQ;QAC5B,QAAQ,EAAY,UAAU;QAC9B,SAAS,EAAW,WAAW;QAC/B,SAAS,EAAW,WAAW;KAElC;CAEJ,CAAC;AAWF,SAAe,IAAI;;;;;;;oBAMX,gBAAgB,CAAC,cAA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,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;oBAmB/C,WAAM,eAAe,CAAC,aAAa,CAC/B,MAAM,CAAC,IAAI,CAAC,QAAQ,EACpB,MAAM,CAAC,IAAI,CAAC,SAAS,CACxB,EAAA;;oBAHD,SAGC,CAAC;oBACF,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;;;;oBAE1C,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,OAAK,CAAC,CAAC;;wBAMvD,WAAM,aAAa,CAAC,kBAAkB,CAAC,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,EAAA;;oBAAxE,SAAwE,CAAC;oBAYzE,IAAI,CAAC;wBAIK,OAAO,GAAG;4BACZ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;yBAI9C,CAAC;wBACI,SAAS,GAAG,WAAW,CAAC;wBAE9B,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;wBAClD,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;wBACvC,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;oBAGrD,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACb,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;oBAC/C,CAAC;;;;oBAID,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,OAAK,CAAC,CAAC;;;;;;CAGlD;AAQD,IAAI,EAAE,CAAC"} \ No newline at end of file diff --git a/script/ts/config/config.ts b/script/ts/config/config.ts index 1a7c930..a502c53 100644 --- a/script/ts/config/config.ts +++ b/script/ts/config/config.ts @@ -3,7 +3,6 @@ export const CONFIG = { path: { src: './src', dist: './dist', - json_output: './dist', ts_input: './src/ts', ts_output: './dist/ts', diff --git a/script/ts/index.ts b/script/ts/index.ts index b100dfa..eb7685d 100644 --- a/script/ts/index.ts +++ b/script/ts/index.ts @@ -103,12 +103,8 @@ async function main() { console.log(`Directory cleaned: ${CONFIG.path.dist}`); - - const localPackageConfig = await readPackageJson('./package.json'); - const packageCreator = new PackageCreator(localPackageConfig); - const packageConfig = packageCreator.config packageCreator.createPackageJson(CONFIG.path.dist); diff --git a/src/ts/index.ts b/src/ts/index.ts index e784d3a..11f2926 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -43,6 +43,7 @@ import SvgToPngConverter from './class/SvgToPngConverter.js'; // Import | Internal Functions import gl_installer from './function/gl_installer'; import cleanDirectory from './function/clean_directory'; +import readPackageJson from "./function/readPackageJson.js" // ============================================================================ @@ -75,5 +76,6 @@ export { // Export | Internal Functions gl_installer, cleanDirectory, + readPackageJson, };