@tymonmarek/wally 0.1.0
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/.editorconfig +21 -0
- package/.github/dependabot.yml +6 -0
- package/.github/workflows/build.yml +31 -0
- package/.github/workflows/release.yml +55 -0
- package/.github/workflows/test.yml +31 -0
- package/.husky/pre-commit +3 -0
- package/.prettierignore +2 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/build/error.d.ts +12 -0
- package/build/error.d.ts.map +1 -0
- package/build/error.js +26 -0
- package/build/error.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +3 -0
- package/build/index.js.map +1 -0
- package/coverage/clover.xml +39 -0
- package/coverage/coverage-final.json +2 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/error.ts.html +175 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +116 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +46 -0
- package/docs/CHANGELOG.md +0 -0
- package/docs/CODE_OF_CONDUCT.md +82 -0
- package/docs/CONTRIBUTING.md +55 -0
- package/docs/SECURITY.md +21 -0
- package/eslint.config.mts +30 -0
- package/jest.config.ts +202 -0
- package/package.json +100 -0
- package/prettier.config.ts +0 -0
- package/src/error.ts +30 -0
- package/src/index.ts +56 -0
- package/tests/error.test.ts +31 -0
- package/tsconfig.build.json +13 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Our Pledge](#our-pledge)
|
|
6
|
+
- [Our Standards](#our-standards)
|
|
7
|
+
- [Our Responsibilities](#our-responsibilities)
|
|
8
|
+
- [Scope](#scope)
|
|
9
|
+
- [Enforcement](#enforcement)
|
|
10
|
+
- [Attribution](#attribution)
|
|
11
|
+
|
|
12
|
+
## Our Pledge
|
|
13
|
+
|
|
14
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
15
|
+
contributors and maintainers pledge to making participation in our project and
|
|
16
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
17
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
18
|
+
education, socio-economic status, nationality, personal appearance, race,
|
|
19
|
+
religion, or sexual identity and orientation.
|
|
20
|
+
|
|
21
|
+
## Our Standards
|
|
22
|
+
|
|
23
|
+
Examples of behavior that contributes to creating a positive environment
|
|
24
|
+
include:
|
|
25
|
+
|
|
26
|
+
- Using welcoming and inclusive language
|
|
27
|
+
- Being respectful of differing viewpoints and experiences
|
|
28
|
+
- Gracefully accepting constructive criticism
|
|
29
|
+
- Focusing on what is best for the community
|
|
30
|
+
- Showing empathy towards other community members
|
|
31
|
+
|
|
32
|
+
Examples of unacceptable behavior by participants include:
|
|
33
|
+
|
|
34
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or
|
|
35
|
+
advances
|
|
36
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
37
|
+
- Public or private harassment
|
|
38
|
+
- Publishing others' private information, such as a physical or electronic
|
|
39
|
+
address, without explicit permission
|
|
40
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
41
|
+
professional setting
|
|
42
|
+
|
|
43
|
+
## Our Responsibilities
|
|
44
|
+
|
|
45
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
46
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
47
|
+
response to any instances of unacceptable behavior.
|
|
48
|
+
|
|
49
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
50
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
51
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
52
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
53
|
+
threatening, offensive, or harmful.
|
|
54
|
+
|
|
55
|
+
## Scope
|
|
56
|
+
|
|
57
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
58
|
+
when an individual is representing the project or its community. Examples of
|
|
59
|
+
representing a project or community include using an official project e-mail
|
|
60
|
+
address, posting via an official social media account, or acting as an appointed
|
|
61
|
+
representative at an online or offline event. Representation of a project may be
|
|
62
|
+
further defined and clarified by project maintainers.
|
|
63
|
+
|
|
64
|
+
## Enforcement
|
|
65
|
+
|
|
66
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
67
|
+
reported by contacting the project team at {{ email }}. All
|
|
68
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
69
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
70
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
71
|
+
Further details of specific enforcement policies may be posted separately.
|
|
72
|
+
|
|
73
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
74
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
75
|
+
members of the project's leadership.
|
|
76
|
+
|
|
77
|
+
## Attribution
|
|
78
|
+
|
|
79
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
80
|
+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
|
|
81
|
+
|
|
82
|
+
[homepage]: https://www.contributor-covenant.org
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help is greatly appreciated.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [How to Contribute](#how-to-contribute)
|
|
8
|
+
- [Code of Conduct](#code-of-conduct)
|
|
9
|
+
- [Reporting Issues](#reporting-issues)
|
|
10
|
+
- [Submitting Pull Requests](#submitting-pull-requests)
|
|
11
|
+
- [Style Guidelines](#style-guidelines)
|
|
12
|
+
- [Getting Help](#getting-help)
|
|
13
|
+
|
|
14
|
+
## How to Contribute
|
|
15
|
+
|
|
16
|
+
1. Fork the repository to your own GitHub account.
|
|
17
|
+
2. Clone the forked repository to your local machine.
|
|
18
|
+
3. Create a new branch for your feature or bug fix.
|
|
19
|
+
4. Make your changes and commit them with clear messages.
|
|
20
|
+
5. Push your changes to your forked repository.
|
|
21
|
+
6. Open a pull request against the main repository.
|
|
22
|
+
|
|
23
|
+
## Code of Conduct
|
|
24
|
+
|
|
25
|
+
We expect all contributors to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it to understand the standards we uphold in our community.
|
|
26
|
+
|
|
27
|
+
## Reporting Issues
|
|
28
|
+
|
|
29
|
+
If you encounter a bug or have a feature request, please open an issue on GitHub. Provide as much detail as possible, including steps to reproduce the issue, expected behavior, and any relevant screenshots or logs.
|
|
30
|
+
|
|
31
|
+
## Submitting Pull Requests
|
|
32
|
+
|
|
33
|
+
When submitting a pull request, please ensure that:
|
|
34
|
+
|
|
35
|
+
- Your code follows the project's coding style and conventions.
|
|
36
|
+
- You have added tests for any new functionality.
|
|
37
|
+
- All existing tests pass.
|
|
38
|
+
- You have updated documentation as necessary.
|
|
39
|
+
- You provide a clear description of the changes made.
|
|
40
|
+
|
|
41
|
+
## Style Guidelines
|
|
42
|
+
|
|
43
|
+
Please follow these style guidelines to maintain code consistency:
|
|
44
|
+
|
|
45
|
+
- Use meaningful variable and function names.
|
|
46
|
+
- Write clear and concise comments.
|
|
47
|
+
- Follow the project's indentation and formatting rules.
|
|
48
|
+
- Ensure your code is modular and reusable.
|
|
49
|
+
- Avoid large commits; break changes into smaller, manageable pieces.
|
|
50
|
+
|
|
51
|
+
## Getting Help
|
|
52
|
+
|
|
53
|
+
If you need assistance or have questions, feel free to reach out to the community through our discussion forums or chat channels. We're here to help!
|
|
54
|
+
|
|
55
|
+
Thank you for contributing to our project! Your efforts help make it better for everyone.
|
package/docs/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
We take the security of our project seriously. This document outlines our security policy, including how to report vulnerabilities and our approach to handling security issues.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Reporting a Vulnerability](#reporting-a-vulnerability)
|
|
8
|
+
- [Supported Versions](#supported-versions)
|
|
9
|
+
- [Security Updates](#security-updates)
|
|
10
|
+
|
|
11
|
+
## Reporting a Vulnerability
|
|
12
|
+
|
|
13
|
+
If you discover a security vulnerability in our project, please report it using GitHub's [Security Advisories](https://docs.github.com/en/code-security/security-advisories) feature. This allows us to manage the disclosure process effectively and ensures that we can address the issue promptly.
|
|
14
|
+
|
|
15
|
+
## Supported Versions
|
|
16
|
+
|
|
17
|
+
Please refer to our [Releases](https://github.com/TymonMarek/semantic-release-plugin-template/releases) page for detailed information on each version's support status and updates.
|
|
18
|
+
|
|
19
|
+
## Security Updates
|
|
20
|
+
|
|
21
|
+
We are committed to addressing security vulnerabilities in a timely manner. Once a vulnerability is reported, we will investigate and, if confirmed, work on a fix as quickly as possible. Security updates will be communicated through our GitHub repository and release notes.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as js from "@eslint/js";
|
|
2
|
+
import * as globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import markdown from "@eslint/markdown";
|
|
5
|
+
import { defineConfig } from "eslint/config";
|
|
6
|
+
|
|
7
|
+
export default defineConfig([
|
|
8
|
+
{
|
|
9
|
+
files: ["src/**/*.{ts,mts,cts}"],
|
|
10
|
+
plugins: { js },
|
|
11
|
+
extends: ["js/recommended"],
|
|
12
|
+
languageOptions: { globals: globals.node },
|
|
13
|
+
},
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
{
|
|
16
|
+
files: ["tests/**/*.{ts,mts,cts}"],
|
|
17
|
+
plugins: { js },
|
|
18
|
+
extends: ["js/recommended"],
|
|
19
|
+
languageOptions: { globals: { ...globals.node, ...globals.jest } },
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
ignores: ["dist/**", "node_modules/**", "**/*.d.ts"],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
files: ["**/*.md"],
|
|
26
|
+
plugins: { markdown },
|
|
27
|
+
language: "markdown/gfm",
|
|
28
|
+
extends: ["markdown/recommended"],
|
|
29
|
+
},
|
|
30
|
+
]);
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For a detailed explanation regarding each configuration property, visit:
|
|
3
|
+
* https://jestjs.io/docs/configuration
|
|
4
|
+
*/
|
|
5
|
+
import type { Config } from "@jest/types";
|
|
6
|
+
|
|
7
|
+
const config: Config.InitialOptions = {
|
|
8
|
+
// All imported modules in your tests should be mocked automatically
|
|
9
|
+
// automock: false,
|
|
10
|
+
|
|
11
|
+
// Stop running tests after `n` failures
|
|
12
|
+
// bail: 0,
|
|
13
|
+
|
|
14
|
+
// The directory where Jest should store its cached dependency information
|
|
15
|
+
// cacheDirectory: "C:\\Users\\Tymon\\AppData\\Local\\Temp\\jest",
|
|
16
|
+
|
|
17
|
+
// Automatically clear mock calls, instances, contexts and results before every test
|
|
18
|
+
clearMocks: true,
|
|
19
|
+
|
|
20
|
+
// Indicates whether the coverage information should be collected while executing the test
|
|
21
|
+
collectCoverage: true,
|
|
22
|
+
|
|
23
|
+
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
|
24
|
+
// collectCoverageFrom: undefined,
|
|
25
|
+
|
|
26
|
+
// The directory where Jest should output its coverage files
|
|
27
|
+
coverageDirectory: "coverage",
|
|
28
|
+
|
|
29
|
+
// An array of regexp pattern strings used to skip coverage collection
|
|
30
|
+
// coveragePathIgnorePatterns: [
|
|
31
|
+
// "\\\\node_modules\\\\"
|
|
32
|
+
// ],
|
|
33
|
+
|
|
34
|
+
// Indicates which provider should be used to instrument code for coverage
|
|
35
|
+
coverageProvider: "v8",
|
|
36
|
+
|
|
37
|
+
// A list of reporter names that Jest uses when writing coverage reports
|
|
38
|
+
// coverageReporters: [
|
|
39
|
+
// "json",
|
|
40
|
+
// "text",
|
|
41
|
+
// "lcov",
|
|
42
|
+
// "clover"
|
|
43
|
+
// ],
|
|
44
|
+
|
|
45
|
+
// An object that configures minimum threshold enforcement for coverage results
|
|
46
|
+
// coverageThreshold: undefined,
|
|
47
|
+
|
|
48
|
+
// A path to a custom dependency extractor
|
|
49
|
+
// dependencyExtractor: undefined,
|
|
50
|
+
|
|
51
|
+
// Make calling deprecated APIs throw helpful error messages
|
|
52
|
+
// errorOnDeprecated: false,
|
|
53
|
+
|
|
54
|
+
// The default configuration for fake timers
|
|
55
|
+
// fakeTimers: {
|
|
56
|
+
// "enableGlobally": false
|
|
57
|
+
// },
|
|
58
|
+
|
|
59
|
+
// Force coverage collection from ignored files using an array of glob patterns
|
|
60
|
+
// forceCoverageMatch: [],
|
|
61
|
+
|
|
62
|
+
// A path to a module which exports an async function that is triggered once before all test suites
|
|
63
|
+
// globalSetup: undefined,
|
|
64
|
+
|
|
65
|
+
// A path to a module which exports an async function that is triggered once after all test suites
|
|
66
|
+
// globalTeardown: undefined,
|
|
67
|
+
|
|
68
|
+
// A set of global variables that need to be available in all test environments
|
|
69
|
+
// globals: {},
|
|
70
|
+
|
|
71
|
+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
|
72
|
+
// maxWorkers: "50%",
|
|
73
|
+
|
|
74
|
+
// An array of directory names to be searched recursively up from the requiring module's location
|
|
75
|
+
// moduleDirectories: [
|
|
76
|
+
// "node_modules"
|
|
77
|
+
// ],
|
|
78
|
+
|
|
79
|
+
// An array of file extensions your modules use
|
|
80
|
+
// moduleFileExtensions: [
|
|
81
|
+
// "js",
|
|
82
|
+
// "mjs",
|
|
83
|
+
// "cjs",
|
|
84
|
+
// "jsx",
|
|
85
|
+
// "ts",
|
|
86
|
+
// "mts",
|
|
87
|
+
// "cts",
|
|
88
|
+
// "tsx",
|
|
89
|
+
// "json",
|
|
90
|
+
// "node"
|
|
91
|
+
// ],
|
|
92
|
+
|
|
93
|
+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
|
94
|
+
// moduleNameMapper: {},
|
|
95
|
+
|
|
96
|
+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
|
97
|
+
// modulePathIgnorePatterns: [],
|
|
98
|
+
|
|
99
|
+
// Activates notifications for test results
|
|
100
|
+
// notify: false,
|
|
101
|
+
|
|
102
|
+
// An enum that specifies notification mode. Requires { notify: true }
|
|
103
|
+
// notifyMode: "failure-change",
|
|
104
|
+
|
|
105
|
+
// A preset that is used as a base for Jest's configuration
|
|
106
|
+
preset: "ts-jest",
|
|
107
|
+
|
|
108
|
+
// Run tests from one or more projects
|
|
109
|
+
// projects: undefined,
|
|
110
|
+
|
|
111
|
+
// Use this configuration option to add custom reporters to Jest
|
|
112
|
+
// reporters: undefined,
|
|
113
|
+
|
|
114
|
+
// Automatically reset mock state before every test
|
|
115
|
+
// resetMocks: false,
|
|
116
|
+
|
|
117
|
+
// Reset the module registry before running each individual test
|
|
118
|
+
// resetModules: false,
|
|
119
|
+
|
|
120
|
+
// A path to a custom resolver
|
|
121
|
+
// resolver: undefined,
|
|
122
|
+
|
|
123
|
+
// Automatically restore mock state and implementation before every test
|
|
124
|
+
// restoreMocks: false,
|
|
125
|
+
|
|
126
|
+
// The root directory that Jest should scan for tests and modules within
|
|
127
|
+
// rootDir: undefined,
|
|
128
|
+
|
|
129
|
+
// A list of paths to directories that Jest should use to search for files in
|
|
130
|
+
// roots: [
|
|
131
|
+
// "<rootDir>"
|
|
132
|
+
// ],
|
|
133
|
+
|
|
134
|
+
// Allows you to use a custom runner instead of Jest's default test runner
|
|
135
|
+
// runner: "jest-runner",
|
|
136
|
+
|
|
137
|
+
// The paths to modules that run some code to configure or set up the testing environment before each test
|
|
138
|
+
// setupFiles: [],
|
|
139
|
+
|
|
140
|
+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
|
141
|
+
// setupFilesAfterEnv: [],
|
|
142
|
+
|
|
143
|
+
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
|
144
|
+
// slowTestThreshold: 5,
|
|
145
|
+
|
|
146
|
+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
|
147
|
+
// snapshotSerializers: [],
|
|
148
|
+
|
|
149
|
+
// The test environment that will be used for testing
|
|
150
|
+
testEnvironment: "node",
|
|
151
|
+
|
|
152
|
+
// Options that will be passed to the testEnvironment
|
|
153
|
+
// testEnvironmentOptions: {},
|
|
154
|
+
|
|
155
|
+
// Adds a location field to test results
|
|
156
|
+
// testLocationInResults: false,
|
|
157
|
+
|
|
158
|
+
// The glob patterns Jest uses to detect test files
|
|
159
|
+
// testMatch: [
|
|
160
|
+
// "**/__tests__/**/*.?([mc])[jt]s?(x)",
|
|
161
|
+
// "**/?(*.)+(spec|test).?([mc])[jt]s?(x)"
|
|
162
|
+
// ],
|
|
163
|
+
|
|
164
|
+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
|
165
|
+
// testPathIgnorePatterns: [
|
|
166
|
+
// "\\\\node_modules\\\\"
|
|
167
|
+
// ],
|
|
168
|
+
|
|
169
|
+
// The regexp pattern or array of patterns that Jest uses to detect test files
|
|
170
|
+
// testRegex: [],
|
|
171
|
+
|
|
172
|
+
// This option allows the use of a custom results processor
|
|
173
|
+
// testResultsProcessor: undefined,
|
|
174
|
+
|
|
175
|
+
// This option allows use of a custom test runner
|
|
176
|
+
// testRunner: "jest-circus/runner",
|
|
177
|
+
|
|
178
|
+
// A map from regular expressions to paths to transformers
|
|
179
|
+
transform: {
|
|
180
|
+
"^.+\\.ts$": "ts-jest", // Transform TypeScript files with ts-jest
|
|
181
|
+
"^.+\\.js$": "ts-jest", // Transform JavaScript files too (for packages like @semantic-release/error)
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
|
185
|
+
transformIgnorePatterns: [
|
|
186
|
+
"/node_modules/(?!@semantic-release|other-modules-to-include)/", // Transform the required modules that use ES modules
|
|
187
|
+
],
|
|
188
|
+
|
|
189
|
+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
|
190
|
+
// unmockedModulePathPatterns: undefined,
|
|
191
|
+
|
|
192
|
+
// Indicates whether each individual test should be reported during the run
|
|
193
|
+
// verbose: undefined,
|
|
194
|
+
|
|
195
|
+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
|
196
|
+
// watchPathIgnorePatterns: [],
|
|
197
|
+
|
|
198
|
+
// Whether to use watchman for file crawling
|
|
199
|
+
// watchman: true,
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export default config;
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tymonmarek/wally",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A minimal plugin template for semantic-release.",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"homepage": "https://github.com/TymonMarek/wally",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/TymonMarek/wally.git"
|
|
10
|
+
},
|
|
11
|
+
"author": "Tymon Marek <tymon.marek@icloud.com>",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"email": "tymon.marek@icloud.com",
|
|
14
|
+
"url": "https://github.com/TymonMarek/wally/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
19
|
+
"lint": "eslint --fix -c eslint.config.mts .",
|
|
20
|
+
"format": "prettier --write .",
|
|
21
|
+
"test": "jest",
|
|
22
|
+
"prepare": "husky",
|
|
23
|
+
"pre-commit": "lint-staged",
|
|
24
|
+
"audit": "corepack npm audit signatures",
|
|
25
|
+
"prepublishOnly": "npm run build",
|
|
26
|
+
"release": "semantic-release"
|
|
27
|
+
},
|
|
28
|
+
"lint-staged": {
|
|
29
|
+
"!(*.d).ts": [
|
|
30
|
+
"eslint --fix --config eslint.config.mts",
|
|
31
|
+
"prettier --write --config prettier.config.ts"
|
|
32
|
+
],
|
|
33
|
+
"*.md": [
|
|
34
|
+
"npm run lint"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"release": {
|
|
38
|
+
"branches": [
|
|
39
|
+
"main",
|
|
40
|
+
{
|
|
41
|
+
"name": "beta",
|
|
42
|
+
"prerelease": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "alpha",
|
|
46
|
+
"prerelease": true
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"plugins": [
|
|
50
|
+
"@semantic-release/commit-analyzer",
|
|
51
|
+
"@semantic-release/release-notes-generator",
|
|
52
|
+
[
|
|
53
|
+
"@semantic-release/changelog",
|
|
54
|
+
{
|
|
55
|
+
"changelogFile": "docs/CHANGELOG.md"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"@semantic-release/git",
|
|
60
|
+
{
|
|
61
|
+
"assets": [
|
|
62
|
+
"CHANGELOG.md",
|
|
63
|
+
"package.json",
|
|
64
|
+
"package-lock.json"
|
|
65
|
+
],
|
|
66
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"@semantic-release/npm",
|
|
70
|
+
"@semantic-release/github"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@eslint/js": "^9.39.2",
|
|
75
|
+
"@eslint/json": "^1.0.0",
|
|
76
|
+
"@eslint/markdown": "^7.5.1",
|
|
77
|
+
"@jest/globals": "^30.2.0",
|
|
78
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
79
|
+
"@semantic-release/git": "^10.0.1",
|
|
80
|
+
"@tsconfig/node20": "^20.1.8",
|
|
81
|
+
"@types/jest": "^30.0.0",
|
|
82
|
+
"@types/node": "^25.2.0",
|
|
83
|
+
"@types/semantic-release__error": "^3.0.3",
|
|
84
|
+
"@types/signale": "^1.4.7",
|
|
85
|
+
"corepack": "^0.34.6",
|
|
86
|
+
"eslint": "^9.39.2",
|
|
87
|
+
"globals": "^17.3.0",
|
|
88
|
+
"husky": "^9.1.7",
|
|
89
|
+
"jest": "^30.2.0",
|
|
90
|
+
"jiti": "^2.6.1",
|
|
91
|
+
"lint-staged": "^16.2.7",
|
|
92
|
+
"prettier": "3.8.1",
|
|
93
|
+
"ts-jest": "^29.4.6",
|
|
94
|
+
"typescript": "^5.9.3",
|
|
95
|
+
"typescript-eslint": "^8.54.0"
|
|
96
|
+
},
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"semantic-release": "^25.0.3"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
File without changes
|
package/src/error.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import SemanticReleaseError from "@semantic-release/error";
|
|
2
|
+
|
|
3
|
+
import { homepage } from "../package.json";
|
|
4
|
+
|
|
5
|
+
export const link = (file: string) => `${homepage}/blob/main/${file}`;
|
|
6
|
+
|
|
7
|
+
export type ErrorDefinition = {
|
|
8
|
+
message: string;
|
|
9
|
+
details: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const enum ErrorCode {
|
|
13
|
+
WallyNotInstalled,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const ERROR_DEFINITIONS: Record<ErrorCode, ErrorDefinition> = {
|
|
17
|
+
[ErrorCode.WallyNotInstalled]: {
|
|
18
|
+
message: "Wally is not installed.",
|
|
19
|
+
details: `Wally must be installed to use this plugin. Please install Wally by following the instructions at ${link("README.md#installation")}.`,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function getError(errorCode: ErrorCode): SemanticReleaseError {
|
|
24
|
+
const definition = ERROR_DEFINITIONS[errorCode];
|
|
25
|
+
return new SemanticReleaseError(
|
|
26
|
+
definition.message,
|
|
27
|
+
errorCode.toString(),
|
|
28
|
+
definition.details,
|
|
29
|
+
);
|
|
30
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// import {
|
|
2
|
+
// AnalyzeCommitsContext,
|
|
3
|
+
// GenerateNotesContext,
|
|
4
|
+
// PublishContext,
|
|
5
|
+
// PrepareContext,
|
|
6
|
+
// VerifyConditionsContext,
|
|
7
|
+
// VerifyReleaseContext,
|
|
8
|
+
// SuccessContext,
|
|
9
|
+
// FailContext,
|
|
10
|
+
// GlobalConfig,
|
|
11
|
+
// } from "semantic-release";
|
|
12
|
+
|
|
13
|
+
// export async function verifyConditions(
|
|
14
|
+
// pluginConfig: GlobalConfig,
|
|
15
|
+
// context: VerifyConditionsContext,
|
|
16
|
+
// ) {}
|
|
17
|
+
|
|
18
|
+
// export async function analyzeCommits(
|
|
19
|
+
// pluginConfig: GlobalConfig,
|
|
20
|
+
// context: AnalyzeCommitsContext,
|
|
21
|
+
// ) {}
|
|
22
|
+
|
|
23
|
+
// export async function verifyRelease(
|
|
24
|
+
// pluginConfig: GlobalConfig,
|
|
25
|
+
// context: VerifyReleaseContext,
|
|
26
|
+
// ) {}
|
|
27
|
+
|
|
28
|
+
// export async function generateNotes(
|
|
29
|
+
// pluginConfig: GlobalConfig,
|
|
30
|
+
// context: GenerateNotesContext,
|
|
31
|
+
// ) {}
|
|
32
|
+
|
|
33
|
+
// export async function addChannel(
|
|
34
|
+
// pluginConfig: GlobalConfig,
|
|
35
|
+
// context: VerifyReleaseContext,
|
|
36
|
+
// ) {}
|
|
37
|
+
|
|
38
|
+
// export async function prepare(
|
|
39
|
+
// pluginConfig: GlobalConfig,
|
|
40
|
+
// context: PrepareContext,
|
|
41
|
+
// ) {}
|
|
42
|
+
|
|
43
|
+
// export async function publish(
|
|
44
|
+
// pluginConfig: GlobalConfig,
|
|
45
|
+
// context: PublishContext,
|
|
46
|
+
// ) {}
|
|
47
|
+
|
|
48
|
+
// export async function success(
|
|
49
|
+
// pluginConfig: GlobalConfig,
|
|
50
|
+
// context: SuccessContext,
|
|
51
|
+
// ) {}
|
|
52
|
+
|
|
53
|
+
// export async function fail(
|
|
54
|
+
// pluginConfig: GlobalConfig,
|
|
55
|
+
// context: FailContext,
|
|
56
|
+
// ) {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import SemanticReleaseError from "@semantic-release/error";
|
|
2
|
+
import { ERROR_DEFINITIONS, ErrorCode, getError, link } from "../src/error";
|
|
3
|
+
|
|
4
|
+
test("error definition generates error link correctly", () => {
|
|
5
|
+
expect(link("README.md#usage")).toBe(
|
|
6
|
+
"https://github.com/TymonMarek/wally/blob/main/README.md#usage",
|
|
7
|
+
);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test("error definition generates error link without fragment", () => {
|
|
11
|
+
expect(link("src/index.ts")).toBe(
|
|
12
|
+
"https://github.com/TymonMarek/wally/blob/main/src/index.ts",
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("error definition generates error link with empty input", () => {
|
|
17
|
+
expect(link("")).toBe("https://github.com/TymonMarek/wally/blob/main/");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("getError generates SemanticReleaseError with correct properties", () => {
|
|
21
|
+
const semanticError = getError(ErrorCode.WallyNotInstalled);
|
|
22
|
+
|
|
23
|
+
expect(semanticError).toBeInstanceOf(SemanticReleaseError);
|
|
24
|
+
expect(semanticError.message).toBe(
|
|
25
|
+
ERROR_DEFINITIONS[ErrorCode.WallyNotInstalled].message,
|
|
26
|
+
);
|
|
27
|
+
expect(semanticError.code).toBe(ErrorCode.WallyNotInstalled.toString());
|
|
28
|
+
expect(semanticError.details).toBe(
|
|
29
|
+
ERROR_DEFINITIONS[ErrorCode.WallyNotInstalled].details,
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"outDir": "./build"
|
|
10
|
+
},
|
|
11
|
+
"include": ["src/**/*.ts"],
|
|
12
|
+
"exclude": ["tests/**/*.ts"]
|
|
13
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"lib": ["ESNext"],
|
|
6
|
+
"module": "nodenext",
|
|
7
|
+
"moduleResolution": "nodenext",
|
|
8
|
+
|
|
9
|
+
"strict": true,
|
|
10
|
+
"alwaysStrict": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"strictFunctionTypes": true,
|
|
13
|
+
"strictBindCallApply": true,
|
|
14
|
+
|
|
15
|
+
"noImplicitAny": true,
|
|
16
|
+
"noUnusedLocals": true,
|
|
17
|
+
"noImplicitThis": true,
|
|
18
|
+
"noErrorTruncation": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"skipLibCheck": false,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"isolatedModules": true,
|
|
26
|
+
"removeComments": true
|
|
27
|
+
}
|
|
28
|
+
}
|