From d431aea906fc443ed5d285a9c0966f02920d20ea Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 25 Jun 2023 21:12:35 +0000 Subject: [PATCH] chore(release): 0.1.1-develop.13 [skip ci] ## [0.1.1-develop.13](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.12...v0.1.1-develop.13) (2023-06-25) ### Bug Fixes * add [@ts-ignore](https://git.lumeweb.com/ts-ignore) to import.meta.url ([bdd2b66](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/bdd2b667250024e4ddfe028726778dba4633312f)) --- CHANGELOG.md | 7 +++++++ lib/index.js | 42 ++++++++++++++++++++++++++++++++---------- lib/index.mjs | 21 ++++++++++----------- lib/path.d.ts | 1 + lib/path.js | 9 +++++++++ lib/path.mjs | 6 ++++++ 6 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 lib/path.d.ts create mode 100644 lib/path.js create mode 100644 lib/path.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index e6435ff..5f52ba5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.1.1-develop.13](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.12...v0.1.1-develop.13) (2023-06-25) + + +### Bug Fixes + +* add [@ts-ignore](https://git.lumeweb.com/ts-ignore) to import.meta.url ([bdd2b66](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/bdd2b667250024e4ddfe028726778dba4633312f)) + ## [0.1.1-develop.12](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.11...v0.1.1-develop.12) (2023-06-25) diff --git a/lib/index.js b/lib/index.js index 81ac16e..622ecf0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,20 +1,42 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_VARIABLE = void 0; const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -let DIR; -if (typeof __dirname === "undefined") { - DIR = (0, node_path_1.dirname)((0, node_url_1.fileURLToPath)(import.meta.url)); -} -else { - DIR = __dirname; -} -const TEMPLATES = (0, node_path_1.resolve)(DIR, "..", "templates"); exports.DEFAULT_VARIABLE = { source: "src", }; async function default_1() { + let DIR; + if (typeof __dirname === "undefined") { + DIR = (await Promise.resolve().then(() => __importStar(require("./path.js")))).default(); + } + else { + DIR = __dirname; + } + const TEMPLATES = (0, node_path_1.resolve)(DIR, "..", "templates"); return { extends: ["presetter-preset-strict"], template: { @@ -37,4 +59,4 @@ async function default_1() { }; } exports.default = default_1; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUNBQTZDO0FBQzdDLHVDQUF5QztBQUl6QyxJQUFJLEdBQVcsQ0FBQztBQUVoQixJQUFJLE9BQU8sU0FBUyxLQUFLLFdBQVcsRUFBRTtJQUVwQyxHQUFHLEdBQUcsSUFBQSxtQkFBTyxFQ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0FBQ0osQ0FBQztBQS9CRCw0QkErQkMifQ== \ No newline at end of file diff --git a/lib/index.mjs b/lib/index.mjs index 53004e5..9b59019 100644 --- a/lib/index.mjs +++ b/lib/index.mjs @@ -1,17 +1,16 @@ -import { dirname, resolve } from "node:path"; -import { fileURLToPath } from "node:url"; -let DIR; -if (typeof `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}` === "undefined") { - DIR = dirname(fileURLToPath(import.meta.url)); -} -else { - DIR = `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}`; -} -const TEMPLATES = resolve(DIR, "..", "templates"); +import { resolve } from "node:path"; export const DEFAULT_VARIABLE = { source: "src", }; export default async function () { + let DIR; + if (typeof `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}` === "undefined") { + DIR = (await import("./path.mjs")).default(); + } + else { + DIR = `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}`; + } + const TEMPLATES = resolve(DIR, "..", "templates"); return { extends: ["presetter-preset-strict"], template: { @@ -33,4 +32,4 @@ export default async function () { }, }; } -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDN0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUl6QyxJQUFJLEdBQVcsQ0FBQztBQUVoQixJQUFJLE9BQU8sU0FBUyxLQUFLLFdBQVcsRUFBRTtJQUVwQyxHQUFHLEdBQUcsT0FBTyxDQUFDLGF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LQUNGLENBQUM7QUFDSixDQUFDIn0= \ No newline at end of file diff --git a/lib/path.d.ts b/lib/path.d.ts new file mode 100644 index 0000000..2c5e828 --- /dev/null +++ b/lib/path.d.ts @@ -0,0 +1 @@ +export default function (): string; diff --git a/lib/path.js b/lib/path.js new file mode 100644 index 0000000..3c59ae1 --- /dev/null +++ b/lib/path.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_path_1 = require("node:path"); +const node_url_1 = require("node:url"); +function default_1() { + return (0, node_path_1.dirname)((0, node_url_1.fileURLToPath)(import.meta.url)); +} +exports.default = default_1; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wYXRoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEseUNBQW9DO0FBQ3BDLHVDQUF5QztBQUV6QztJQUVFLE9BQU8sSUFBQSxtQkFBTyxFQUFDLElBQUEsd0JBQWEsRUFBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFDakQsQ0FBQztBQUhELDRCQUdDIn0= \ No newline at end of file diff --git a/lib/path.mjs b/lib/path.mjs new file mode 100644 index 0000000..edb662a --- /dev/null +++ b/lib/path.mjs @@ -0,0 +1,6 @@ +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; +export default function () { + return dirname(fileURLToPath(import.meta.url)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wYXRoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDcEMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUV6QyxNQUFNLENBQUMsT0FBTztJQUVaLE9BQU8sT0FBTyxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFDakQsQ0FBQyJ9 \ No newline at end of file