Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot 66bc3ddb51 chore(release): 0.1.1-develop.12 [skip ci]
## [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)

### Bug Fixes

* add __dirname compatibility ([60f45cb](60f45cb8d5))
* switch to hybrid building ([7a58630](7a58630cda))
2023-06-25 20:59:19 +00:00
Derrick Hammer 60f45cb8d5
fix: add __dirname compatibility 2023-06-25 16:58:29 -04:00
Derrick Hammer a5f166210d
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 16:54:04 -04:00
Derrick Hammer 7a58630cda
fix: switch to hybrid building 2023-06-25 16:53:58 -04:00
7 changed files with 98 additions and 16 deletions

View File

@ -1,6 +1,7 @@
{
"preset": [
"presetter-preset-strict"
"presetter-preset-strict",
"presetter-preset-hybrid"
],
"config": {
"prettier": {

View File

@ -1,3 +1,11 @@
## [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)
### Bug Fixes
* add __dirname compatibility ([60f45cb](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/60f45cb8d544de3c77be90359bdce9ea98422040))
* switch to hybrid building ([7a58630](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/7a58630cdaf69e9830a03ca7c2bc6fecd188a2f0))
## [0.1.1-develop.11](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.10...v0.1.1-develop.11) (2023-06-25)

View File

@ -1,19 +1,28 @@
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const DIR = dirname(fileURLToPath(import.meta.url));
const TEMPLATES = resolve(DIR, "..", "templates");
export const DEFAULT_VARIABLE = {
"use strict";
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",
};
export default async function () {
async function default_1() {
return {
extends: ["presetter-preset-strict"],
template: {
".github/workflows/ci.yml": resolve(TEMPLATES, "ci.yml.raw"),
".releaserc.json": resolve(TEMPLATES, ".releaserc.json"),
".github/workflows/ci.yml": (0, node_path_1.resolve)(TEMPLATES, "ci.yml.raw"),
".releaserc.json": (0, node_path_1.resolve)(TEMPLATES, ".releaserc.json"),
},
noSymlinks: [".github/workflows/ci.yml"],
variable: DEFAULT_VARIABLE,
variable: exports.DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
@ -27,4 +36,5 @@ export default async function () {
},
};
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDN0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUl6QyxNQUFNLEdBQUcsR0FBRyxPQUFPLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQUdwRCxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxXQUFXLENBQUMsQ0FBQztBQUNsRCxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRztJQUM5QixNQUFNLEVBQUUsS0FBSztDQUNkLENBQUM7QUFNRixNQUFNLENBQUMsT0FBTyxDQUFDLEtBQUs7SUFDbEIsT0FBTztRQU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0FBRyxFQUFFLElBQUksRUFBRSxXQUFXLENBQUMsQ0FBQztBQUNyQyxRQUFBLGdCQUFnQixHQUFHO0lBQzlCLE1BQU0sRUFBRSxLQUFLO0NBQ2QsQ0FBQztBQU1hLEtBQUs7SUFDbEIsT0FBTztRQUNMLE9BQU8sRUFBRSxDQUFDLHlCQUF5QixDQUFDO1FBQ3BDLFFBQVEsRUFBRTtZQUNSLDBCQUEwQixFQUFFLElBQUEsbUJBQU8sRUFBQyxTQUFTLEVBQUUsWUFBWSxDQUFDO1lBQzVELGlCQUFpQixFQUFFLElBQUEsbUJBQU8sRUFBQyxTQUFTLEVBQUUsaUJBQWlCLENBQUM7U0FDekQ7UUFDRCxVQUFVLEVBQUUsQ0FBQywwQkFBMEIsQ0FBQztRQUN4QyxRQUFRLEVBQUUsd0JBQWdCO1FBQzFCLG1CQUFtQixFQUFFO1lBQ25CLFFBQVEsRUFBRTtnQkFDUixXQUFXLEVBQUUsS0FBSzthQUNuQjtZQUNELFNBQVMsRUFBRSxDQUFDLGlCQUFpQixDQUFDO1lBQzlCLFFBQVEsRUFBRTtnQkFDUixlQUFlLEVBQUU7b0JBQ2YsR0FBRyxFQUFFLENBQUMsUUFBUSxFQUFFLEtBQUssQ0FBQztpQkFDdkI7YUFDRjtTQUNGO0tBQ0YsQ0FBQztBQUNKLENBQUM7QUFyQkQsNEJBcUJDIn0=

36
lib/index.mjs Normal file
View File

@ -0,0 +1,36 @@
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");
export const DEFAULT_VARIABLE = {
source: "src",
};
export default async function () {
return {
extends: ["presetter-preset-strict"],
template: {
".github/workflows/ci.yml": resolve(TEMPLATES, "ci.yml.raw"),
".releaserc.json": resolve(TEMPLATES, ".releaserc.json"),
},
noSymlinks: [".github/workflows/ci.yml"],
variable: DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
gitignore: [".releaserc.json"],
tsconfig: {
compilerOptions: {
lib: ["ES2021", "dom"],
},
},
},
};
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDN0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUl6QyxJQUFJLEdBQVcsQ0FBQztBQUVoQixJQUFJLE9BQU8sU0FBUyxLQUFLLFdBQVcsRUFBRTtJQUVwQyxHQUFHLEdBQUcsT0FBTyxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7Q0FDL0M7S0FBTTtJQUNMLEdBQUcsR0FBRyxTQUFTLENBQUM7Q0FDakI7QUFHRCxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxXQUFXLENBQUMsQ0FBQztBQUNsRCxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRztJQUM5QixNQUFNLEVBQUUsS0FBSztDQUNkLENBQUM7QUFNRixNQUFNLENBQUMsT0FBTyxDQUFDLEtBQUs7SUFDbEIsT0FBTztRQUNMLE9BQU8sRUFBRSxDQUFDLHlCQUF5QixDQUFDO1FBQ3BDLFFBQVEsRUFBRTtZQUNSLDBCQUEwQixFQUFFLE9BQU8sQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDO1lBQzVELGlCQUFpQixFQUFFLE9BQU8sQ0FBQyxTQUFTLEVBQUUsaUJBQWlCLENBQUM7U0FDekQ7UUFDRCxVQUFVLEVBQUUsQ0FBQywwQkFBMEIsQ0FBQztRQUN4QyxRQUFRLEVBQUUsZ0JBQWdCO1FBQzFCLG1CQUFtQixFQUFFO1lBQ25CLFFBQVEsRUFBRTtnQkFDUixXQUFXLEVBQUUsS0FBSzthQUNuQjtZQUNELFNBQVMsRUFBRSxDQUFDLGlCQUFpQixDQUFDO1lBQzlCLFFBQVEsRUFBRTtnQkFDUixlQUFlLEVBQUU7b0JBQ2YsR0FBRyxFQUFFLENBQUMsUUFBUSxFQUFFLEtBQUssQ0FBQztpQkFDdkI7YUFDRjtTQUNGO0tBQ0YsQ0FBQztBQUNKLENBQUMifQ==

17
npm-shrinkwrap.json generated
View File

@ -14,11 +14,9 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"presetter": "^4.0.1",
"presetter-preset-hybrid": "^4.0.1",
"presetter-preset-strict": "^4.0.1",
"semantic-release": "^21.0.5"
},
"peerDependencies": {
"presetter-preset-strict": "workspace:*"
}
},
"node_modules/@ampproject/remapping": {
@ -15130,6 +15128,19 @@
"typescript": ">=4.7.0"
}
},
"node_modules/presetter-preset-hybrid": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/presetter-preset-hybrid/-/presetter-preset-hybrid-4.0.1.tgz",
"integrity": "sha512-0GxC2QrR3cTcRQsP+PwQ+X1O2Fd/rGH2llNqI2CKePbsWZQxRT5YIsW4YsLsC82tkxhyeyrSjzjLS6hsrYf3WA==",
"dev": true,
"dependencies": {
"presetter-types": "4.0.1"
},
"peerDependencies": {
"presetter": "4.0.1",
"presetter-preset-esm": "4.0.1"
}
},
"node_modules/presetter-preset-strict": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/presetter-preset-strict/-/presetter-preset-strict-4.0.1.tgz",

View File

@ -1,8 +1,16 @@
{
"name": "@lumeweb/node-library-preset",
"version": "0.1.0",
"type": "module",
"main": "lib/index.js",
"module": "lib/index.mjs",
"types": "lib/index.d.ts",
"exports": {
".": {
"require": "./lib/index.js",
"import": "./lib/index.mjs"
},
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/node-library-preset.git"
@ -11,6 +19,7 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"presetter": "^4.0.1",
"presetter-preset-hybrid": "^4.0.1",
"presetter-preset-strict": "^4.0.1",
"semantic-release": "^21.0.5"
},

View File

@ -3,7 +3,14 @@ import { fileURLToPath } from "node:url";
import type { PresetAsset } from "presetter-types";
const DIR = dirname(fileURLToPath(import.meta.url));
let DIR: string;
if (typeof __dirname === "undefined") {
// @ts-ignore
DIR = dirname(fileURLToPath(import.meta.url));
} else {
DIR = __dirname;
}
// paths to the template directory
const TEMPLATES = resolve(DIR, "..", "templates");