@form8ion/gitea-workflows 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Travi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and
7
+ associated documentation files (the "Software"), to deal in the Software without
8
+ restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish, distribute,
10
+ sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is furnished
12
+ to do so, subject to the
13
+ following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial
17
+ portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT
21
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
22
+ AND NONINFRINGEMENT. IN NO
23
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24
+ OTHER LIABILITY, WHETHER
25
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26
+ CONNECTION WITH THE SOFTWARE OR THE
27
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # gitea-workflows
2
+
3
+ form8ion plugin for managing Gitea workflows
4
+
5
+ <!--status-badges start -->
6
+
7
+ [![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]
8
+ [![Codecov][coverage-badge]][coverage-link]
9
+ ![SLSA Level 2][slsa-badge]
10
+
11
+ <!--status-badges end -->
12
+
13
+ ## Table of Contents
14
+
15
+ * [Usage](#usage)
16
+ * [Installation](#installation)
17
+ * [Example](#example)
18
+ * [Contributing](#contributing)
19
+ * [Dependencies](#dependencies)
20
+ * [Verification](#verification)
21
+
22
+ ## Usage
23
+
24
+ <!--consumer-badges start -->
25
+
26
+ [![npm][npm-badge]][npm-link]
27
+ [![license][license-badge]][license-link]
28
+
29
+ <!--consumer-badges end -->
30
+
31
+ ### Installation
32
+
33
+ ```sh
34
+ $ npm install @form8ion/gitea-workflows --save-prod
35
+ ```
36
+
37
+ ### Example
38
+
39
+ #### Import
40
+
41
+ ```javascript
42
+ import {scaffold} from '@form8ion/gitea-workflows';
43
+ ```
44
+
45
+ #### Execute
46
+
47
+ ```javascript
48
+ (async () => {
49
+ await scaffold({projectRoot: process.cwd()});
50
+ })();
51
+ ```
52
+
53
+ ## Contributing
54
+
55
+ <!--contribution-badges start -->
56
+
57
+ [![Commitizen friendly][commitizen-badge]][commitizen-link]
58
+ [![Conventional Commits][commit-convention-badge]][commit-convention-link]
59
+ [![Renovate][renovate-badge]][renovate-link]
60
+ [![PRs Welcome][PRs-badge]][PRs-link]
61
+ [![semantic-release: angular][semantic-release-badge]][semantic-release-link]
62
+
63
+ <!--contribution-badges end -->
64
+
65
+ ### Dependencies
66
+
67
+ ```sh
68
+ $ nvm install
69
+ $ npm install
70
+ ```
71
+
72
+ ### Verification
73
+
74
+ ```sh
75
+ $ npm test
76
+ ```
77
+
78
+ [github-actions-ci-link]: https://github.com/form8ion/gitea-workflows/actions?query=workflow%3A%22Node.js+CI%22+branch%3Amaster
79
+
80
+ [github-actions-ci-badge]: https://img.shields.io/github/actions/workflow/status/form8ion/gitea-workflows/node-ci.yml.svg?branch=master&logo=github
81
+
82
+ [coverage-link]: https://codecov.io/github/form8ion/gitea-workflows
83
+
84
+ [coverage-badge]: https://img.shields.io/codecov/c/github/form8ion/gitea-workflows/master?logo=codecov
85
+
86
+ [slsa-badge]: https://slsa.dev/images/gh-badge-level2.svg
87
+
88
+ [commitizen-link]: http://commitizen.github.io/cz-cli/
89
+
90
+ [commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
91
+
92
+ [commit-convention-link]: https://conventionalcommits.org
93
+
94
+ [commit-convention-badge]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
95
+
96
+ [renovate-link]: https://renovatebot.com
97
+
98
+ [renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=renovatebot
99
+
100
+ [PRs-link]: https://makeapullrequest.com
101
+
102
+ [PRs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
103
+
104
+ [semantic-release-link]: https://github.com/semantic-release/semantic-release
105
+
106
+ [semantic-release-badge]: https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release
107
+
108
+ [npm-link]: https://www.npmjs.com/package/@form8ion/gitea-workflows
109
+
110
+ [npm-badge]: https://img.shields.io/npm/v/@form8ion/gitea-workflows?logo=npm
111
+
112
+ [license-link]: LICENSE
113
+
114
+ [license-badge]: https://img.shields.io/github/license/form8ion/gitea-workflows.svg?logo=opensourceinitiative
package/example.js ADDED
@@ -0,0 +1,13 @@
1
+ // #### Import
2
+ // remark-usage-ignore-next
3
+ import stubbedFs from 'mock-fs';
4
+ import {scaffold} from './lib/index.js';
5
+
6
+ // remark-usage-ignore-next
7
+ stubbedFs();
8
+
9
+ // #### Execute
10
+
11
+ (async () => {
12
+ await scaffold({projectRoot: process.cwd()});
13
+ })();
package/lib/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import { promises } from 'node:fs';
2
+ import { directoryExists } from '@form8ion/core';
3
+
4
+ async function scaffold({projectRoot}) {
5
+ if (await directoryExists(`${projectRoot}/.gitea`)) {
6
+ await promises.mkdir(`${projectRoot}/.gitea/workflows`);
7
+ }
8
+
9
+ return {};
10
+ }
11
+
12
+ export { scaffold };
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/scaffolder.js"],"sourcesContent":["import {promises as fs} from 'node:fs';\nimport {directoryExists} from '@form8ion/core';\n\nexport default async function scaffold({projectRoot}) {\n if (await directoryExists(`${projectRoot}/.gitea`)) {\n await fs.mkdir(`${projectRoot}/.gitea/workflows`);\n }\n\n return {};\n}\n"],"names":["fs"],"mappings":";;;AAGe,eAAe,QAAQ,CAAC,CAAC,WAAW,CAAC,EAAE;AACtD,EAAE,IAAI,MAAM,eAAe,CAAC,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE;AACtD,IAAI,MAAMA,QAAE,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACrD,EAAE;;AAEF,EAAE,OAAO,EAAE;AACX;;;;"}
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@form8ion/gitea-workflows",
3
+ "description": "form8ion plugin for managing Gitea workflows",
4
+ "license": "MIT",
5
+ "version": "1.0.0-beta.1",
6
+ "type": "module",
7
+ "author": "Matt Travi <npm@travi.org> (https://matt.travi.org)",
8
+ "repository": "form8ion/gitea-workflows",
9
+ "bugs": "https://github.com/form8ion/gitea-workflows/issues",
10
+ "homepage": "https://npm.im/@form8ion/gitea-workflows",
11
+ "exports": "./lib/index.js",
12
+ "main": "./lib/index.js",
13
+ "sideEffects": false,
14
+ "scripts": {
15
+ "pretest": "run-s build",
16
+ "test": "npm-run-all --print-label --parallel lint:* --parallel test:*",
17
+ "lint:gherkin": "gherkin-lint --config=.gherkin-lintrc.json",
18
+ "lint:js": "eslint . --cache",
19
+ "lint:js:fix": "run-s 'lint:js -- --fix'",
20
+ "lint:lockfile": "lockfile-lint",
21
+ "lint:md": "remark . --frail",
22
+ "lint:peer": "npm ls >/dev/null",
23
+ "lint:publish": "publint --strict",
24
+ "test:unit": "run-s 'test:unit:base -- --coverage'",
25
+ "test:unit:base": "NODE_ENV=test DEBUG=any vitest run src/",
26
+ "test:integration": "run-s 'test:integration:base -- --profile noWip'",
27
+ "pretest:integration:base": "run-s build",
28
+ "test:integration:base": "NODE_OPTIONS=--enable-source-maps DEBUG=any cucumber-js test/integration",
29
+ "test:integration:debug": "DEBUG=test run-s test:integration",
30
+ "test:integration:focus": "run-s 'test:integration:base -- --profile focus'",
31
+ "test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
32
+ "test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
33
+ "prebuild": "run-s clean",
34
+ "build": "npm-run-all --print-label --parallel build:*",
35
+ "build:js": "rollup --config",
36
+ "clean": "rimraf ./lib",
37
+ "pregenerate:md": "run-s build",
38
+ "generate:md": "remark . --output",
39
+ "prepack": "run-s build",
40
+ "prepare": "husky",
41
+ "watch": "run-s 'build:js -- --watch'"
42
+ },
43
+ "files": [
44
+ "example.js",
45
+ "lib/",
46
+ "src/"
47
+ ],
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "packageManager": "npm@11.12.1+sha512.cdca14b85d647b3192028d02aadbe82d75f79a446aceea9874be98e6d768f20ebd3555770a48d0e9906106007877bbc690f715e9372f2e2dc644a3c3157fb14c",
52
+ "devDependencies": {
53
+ "@cucumber/cucumber": "12.7.0",
54
+ "@form8ion/commitlint-config": "2.0.11",
55
+ "@form8ion/eslint-config": "7.0.14",
56
+ "@form8ion/eslint-config-cucumber": "1.4.1",
57
+ "@form8ion/eslint-config-vitest": "1.1.0",
58
+ "@form8ion/remark-lint-preset": "6.0.7",
59
+ "@travi/any": "3.3.0",
60
+ "@vitest/coverage-v8": "4.1.4",
61
+ "cz-conventional-changelog": "3.3.0",
62
+ "gherkin-lint": "4.2.4",
63
+ "husky": "9.1.7",
64
+ "lockfile-lint": "5.0.0",
65
+ "mock-fs": "5.5.0",
66
+ "npm-run-all2": "8.0.4",
67
+ "publint": "0.3.18",
68
+ "remark-cli": "12.0.1",
69
+ "remark-toc": "9.0.0",
70
+ "remark-usage": "11.0.1",
71
+ "rimraf": "6.1.3",
72
+ "rollup": "4.60.1",
73
+ "rollup-plugin-auto-external": "2.0.0",
74
+ "vitest": "4.1.4",
75
+ "vitest-when": "0.10.0"
76
+ },
77
+ "dependencies": {
78
+ "@form8ion/core": "^4.11.1"
79
+ }
80
+ }
@@ -0,0 +1,7 @@
1
+ import {assert, describe, it} from 'vitest';
2
+
3
+ describe('canary', () => {
4
+ it('should pass', () => {
5
+ assert.isTrue(true);
6
+ });
7
+ });
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export {default as scaffold} from './scaffolder.js';
@@ -0,0 +1,10 @@
1
+ import {promises as fs} from 'node:fs';
2
+ import {directoryExists} from '@form8ion/core';
3
+
4
+ export default async function scaffold({projectRoot}) {
5
+ if (await directoryExists(`${projectRoot}/.gitea`)) {
6
+ await fs.mkdir(`${projectRoot}/.gitea/workflows`);
7
+ }
8
+
9
+ return {};
10
+ }
@@ -0,0 +1,31 @@
1
+ import {promises as fs} from 'node:fs';
2
+ import {directoryExists} from '@form8ion/core';
3
+
4
+ import {describe, vi, it, expect} from 'vitest';
5
+ import {when} from 'vitest-when';
6
+ import any from '@travi/any';
7
+
8
+ import scaffoldWorkflows from './scaffolder.js';
9
+
10
+ vi.mock('node:fs');
11
+ vi.mock('@form8ion/core');
12
+
13
+ describe('gitea workflows scaffolder', () => {
14
+ const projectRoot = any.string();
15
+
16
+ it('should create the workflows directory', async () => {
17
+ when(directoryExists).calledWith(`${projectRoot}/.gitea`).thenResolve(true);
18
+
19
+ expect(await scaffoldWorkflows({projectRoot})).toEqual({});
20
+
21
+ expect(fs.mkdir).toHaveBeenCalledWith(`${projectRoot}/.gitea/workflows`);
22
+ });
23
+
24
+ it('should not create the workflows directory when the repository is not hosted on gitea', async () => {
25
+ when(directoryExists).calledWith(`${projectRoot}/.gitea`).thenResolve(false);
26
+
27
+ expect(await scaffoldWorkflows({projectRoot})).toEqual({});
28
+
29
+ expect(fs.mkdir).not.toHaveBeenCalled();
30
+ });
31
+ });