Cleanup existing specs
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Release workflow triggers on version tags
|
||||
The release workflow SHALL trigger when a git tag matching the pattern `v*` is pushed to the repository.
|
||||
|
||||
#### Scenario: Tag push triggers workflow
|
||||
- **WHEN** a developer pushes a tag named `v0.1.0` to the repository
|
||||
- **THEN** the GitHub Actions release workflow SHALL start execution within 1 minute
|
||||
|
||||
### Requirement: Release workflow builds the plugin
|
||||
The release workflow SHALL build the plugin by running the production build command.
|
||||
|
||||
#### Scenario: Successful build
|
||||
- **WHEN** the release workflow executes
|
||||
- **THEN** it SHALL run `bun run build` successfully
|
||||
- **AND** the files `main.js` and `styles.css` SHALL be generated in the repository root
|
||||
|
||||
#### Scenario: Build failure prevents release
|
||||
- **WHEN** the build command fails
|
||||
- **THEN** the workflow SHALL fail without creating a GitHub release
|
||||
- **AND** an error notification SHALL be visible in the Actions tab
|
||||
|
||||
### Requirement: Release workflow creates GitHub release
|
||||
The release workflow SHALL create a GitHub release with the tag name as the release name.
|
||||
|
||||
#### Scenario: Release creation
|
||||
- **WHEN** the build succeeds
|
||||
- **THEN** a GitHub release SHALL be created with name matching the git tag (e.g., "0.1.0" for tag "v0.1.0")
|
||||
- **AND** the release SHALL be marked as a pre-release
|
||||
- **AND** the release SHALL include the three required assets: `manifest.json`, `main.js`, `styles.css`
|
||||
|
||||
### Requirement: Manifest version matches release version
|
||||
The manifest.json uploaded to the release SHALL have its `version` field matching the release tag version.
|
||||
|
||||
#### Scenario: Version synchronization
|
||||
- **GIVEN** the git tag is `v0.2.0`
|
||||
- **AND** the package.json version is "0.2.0"
|
||||
- **WHEN** the release workflow runs
|
||||
- **THEN** the released manifest.json SHALL contain `"version": "0.2.0"`
|
||||
|
||||
#### Scenario: Version extraction from tag
|
||||
- **GIVEN** the git tag is `v1.0.0-beta.1`
|
||||
- **WHEN** the release workflow processes the tag
|
||||
- **THEN** it SHALL extract version "1.0.0-beta.1"
|
||||
- **AND** update manifest.json accordingly
|
||||
@@ -0,0 +1,41 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Manifest version is synchronized with package version
|
||||
When the package version is bumped, the `version` field in `manifest.json` SHALL be updated to match the new package.json version before the version commit is created.
|
||||
|
||||
#### Scenario: Synchronized version bump
|
||||
- **GIVEN** package.json contains `"version": "0.1.0"`
|
||||
- **AND** manifest.json contains `"version": "0.1.0"`
|
||||
- **WHEN** a developer runs `bun run version:minor`
|
||||
- **THEN** package.json SHALL be updated to `"version": "0.2.0"`
|
||||
- **AND** manifest.json SHALL be updated to `"version": "0.2.0"`
|
||||
- **AND** both files SHALL be included in the same git commit
|
||||
|
||||
### Requirement: Version sync happens via lifecycle script
|
||||
The version synchronization SHALL be triggered by Bun's "version" lifecycle script, which runs after package.json is updated but before the version commit is created.
|
||||
|
||||
#### Scenario: Lifecycle script execution
|
||||
- **GIVEN** the "version" script is defined in package.json
|
||||
- **WHEN** `bun pm version` is executed
|
||||
- **THEN** the "version" script SHALL run after package.json is updated
|
||||
- **AND** the script SHALL update manifest.json
|
||||
- **AND** the script SHALL stage manifest.json with `git add`
|
||||
- **AND** the version commit SHALL include both updated files
|
||||
|
||||
### Requirement: Manifest structure is preserved
|
||||
When updating the manifest version, all other fields in manifest.json SHALL be preserved.
|
||||
|
||||
#### Scenario: Manifest fields preserved
|
||||
- **GIVEN** manifest.json contains fields: id, name, version, minAppVersion, description, author, isDesktopOnly
|
||||
- **WHEN** the version is updated during version bump
|
||||
- **THEN** all fields except `version` SHALL remain unchanged
|
||||
- **AND** the JSON structure and formatting SHALL be preserved
|
||||
|
||||
### Requirement: Package and manifest versions are compatible
|
||||
The version strings in package.json and manifest.json SHALL follow semantic versioning and be compatible.
|
||||
|
||||
#### Scenario: Semantic version compatibility
|
||||
- **GIVEN** package.json has version "1.2.3-beta.2"
|
||||
- **WHEN** the manifest is synchronized
|
||||
- **THEN** manifest.json SHALL have version "1.2.3-beta.2"
|
||||
- **AND** the version SHALL be a valid semver string
|
||||
@@ -0,0 +1,46 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Version patch command
|
||||
The system SHALL provide a command to bump the patch version, synchronize manifest.json, create a commit, and push a git tag.
|
||||
|
||||
#### Scenario: Patch version bump
|
||||
- **GIVEN** the current version is "0.1.0"
|
||||
- **WHEN** a developer runs `bun run version:patch`
|
||||
- **THEN** the package.json version SHALL be updated to "0.1.1"
|
||||
- **AND** the manifest.json version SHALL be updated to "0.1.1"
|
||||
- **AND** a git commit SHALL be created with message "0.1.1" containing both files
|
||||
- **AND** a git tag "v0.1.1" SHALL be created
|
||||
- **AND** the commit and tag SHALL be pushed to origin
|
||||
|
||||
### Requirement: Version minor command
|
||||
The system SHALL provide a command to bump the minor version, synchronize manifest.json, create a commit, and push a git tag.
|
||||
|
||||
#### Scenario: Minor version bump
|
||||
- **GIVEN** the current version is "0.1.5"
|
||||
- **WHEN** a developer runs `bun run version:minor`
|
||||
- **THEN** the package.json version SHALL be updated to "0.2.0"
|
||||
- **AND** the manifest.json version SHALL be updated to "0.2.0"
|
||||
- **AND** a git commit SHALL be created with message "0.2.0" containing both files
|
||||
- **AND** a git tag "v0.2.0" SHALL be created
|
||||
- **AND** the commit and tag SHALL be pushed to origin
|
||||
|
||||
### Requirement: Version major command
|
||||
The system SHALL provide a command to bump the major version, synchronize manifest.json, create a commit, and push a git tag.
|
||||
|
||||
#### Scenario: Major version bump
|
||||
- **GIVEN** the current version is "0.5.2"
|
||||
- **WHEN** a developer runs `bun run version:major`
|
||||
- **THEN** the package.json version SHALL be updated to "1.0.0"
|
||||
- **AND** the manifest.json version SHALL be updated to "1.0.0"
|
||||
- **AND** a git commit SHALL be created with message "1.0.0" containing both files
|
||||
- **AND** a git tag "v1.0.0" SHALL be created
|
||||
- **AND** the commit and tag SHALL be pushed to origin
|
||||
|
||||
### Requirement: Version commands require clean working directory
|
||||
The version commands SHALL fail if the git working directory is not clean.
|
||||
|
||||
#### Scenario: Uncommitted changes prevent version bump
|
||||
- **GIVEN** there are uncommitted changes in the working directory
|
||||
- **WHEN** a developer runs any version command
|
||||
- **THEN** the command SHALL fail with an error message
|
||||
- **AND** no version bump, commit, or tag SHALL be created
|
||||
Reference in New Issue
Block a user