feat: initial version

This commit is contained in:
Derrick Hammer 2023-06-24 22:00:40 -04:00
parent 3e348c881f
commit 1f8d48d5ea
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
9 changed files with 19358 additions and 1 deletions

45
.circleci/config.yml Normal file
View File

@ -0,0 +1,45 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
ssh: credijusto/ssh@0.5.2
workflows:
release:
jobs:
- node/run:
name: build
npm-run: build
post-steps:
- persist_to_workspace:
root: .
paths:
- lib/
filters:
branches:
only:
- master
- develop
- /^develop-.*$/
- node/run:
name: release
npm-run: semantic-release
requires:
- build
filters:
branches:
only:
- master
- develop
- /^develop-.*$/
context:
- publish
setup:
- attach_workspace:
at: ./
- add_ssh_keys:
fingerprints:
- "47:cf:a1:17:d9:81:8e:c5:51:e5:53:c8:33:e4:33:b9"
- ssh/ssh-add-host:
host_url: GITEA_HOST

14
.presetterrc.json Normal file
View File

@ -0,0 +1,14 @@
{
"preset": [
"presetter-preset-strict"
],
"config": {
"prettier": {
"singleQuote": false
}
},
"variable": {
"source": "src"
}
}

68
.releaserc.json Normal file
View File

@ -0,0 +1,68 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "minor",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md",
"npm-shrinkwrap.json",
"lib/**"
]
}
]
],
"branches": [
"master",
{
"name": "develop",
"prerelease": true
},
{
"name": "develop-*",
"prerelease": true
}
]
}

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2023 Hammer Technologies LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

19080
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "@lumeweb/node-library-preset",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/node-library-preset.git"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"presetter": "^4.0.1",
"presetter-preset-strict": "^4.0.1",
"semantic-release": "^21.0.5"
},
"readme": "ERROR: No README data found!",
"_id": "@lumeweb/node-library-preset@0.1.0",
"scripts": {
"prepare": "presetter bootstrap",
"build": "run build",
"semantic-release": "semantic-release"
},
"dependencies": {
"presetter-types": "^4.0.1"
},
"peerDependencies": {
"presetter-preset-strict": "workspace:*"
}
}

31
src/index.ts Normal file
View File

@ -0,0 +1,31 @@
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import type { PresetAsset } from "presetter-types";
const DIR = dirname(fileURLToPath(import.meta.url));
// paths to the template directory
const TEMPLATES = resolve(DIR, "..", "templates");
export const DEFAULT_VARIABLE = {
source: "src",
};
/**
* get the list of templates provided by this preset
* @returns list of preset templates
*/
export default async function (): Promise<PresetAsset> {
return {
extends: ["presetter-preset-strict"],
template: {
".circleci/config.yml": resolve(TEMPLATES, "circleci.yml"),
},
variable: DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
},
};
}

46
templates/.releaserc.json Normal file
View File

@ -0,0 +1,46 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{ "breaking": true, "release": "major" },
{ "revert": true, "release": "patch" },
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" }
{ "type": "refactor", "release": "patch" }
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md",
"npm-shrinkwrap.json"
]
}
]
],
"branches": [
"master",
{
"name": "develop",
"prerelease": true
},
{
"name": "develop-*",
"prerelease": true
}
]
}

45
templates/circleci.yml Normal file
View File

@ -0,0 +1,45 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
ssh: credijusto/ssh@0.5.2
workflows:
release:
jobs:
- node/run:
name: build
npm-run: build
post-steps:
- persist_to_workspace:
root: .
paths:
- lib/
filters:
branches:
only:
- master
- develop
- /^develop-.*$/
- node/run:
name: release
npm-run: semantic-release
requires:
- build
filters:
branches:
only:
- master
- develop
- /^develop-.*$/
context:
- publish
setup:
- attach_workspace:
at: ./
- add_ssh_keys:
fingerprints:
- "47:cf:a1:17:d9:81:8e:c5:51:e5:53:c8:33:e4:33:b9"
- ssh/ssh-add-host:
host_url: GITEA_HOST