Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Tests

on:
- push
- workflow_dispatch
- pull_request

jobs:
build:
name: Typecheck and build
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up Node
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Typecheck
run: npm run typecheck

- name: Build (fails on broken links)
run: npm run build

cypress:
name: Cypress smoke tests
runs-on: 'ubuntu-latest'
needs: build
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up Node
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Build site
run: npm run build

- name: Run Cypress smoke tests
run: npm run test:e2e
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/build
/node_modules
/.docusaurus
/cypress/videos
/cypress/screenshots
/cypress/downloads
8 changes: 8 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {defineConfig} from 'cypress';

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
supportFile: false,
},
});
56 changes: 56 additions & 0 deletions cypress/e2e/smoke.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
describe('homepage', () => {
it('loads and renders the navbar, hero and footer', () => {
cy.visit('/');

cy.get('h1').should('contain.text', 'Violinist documentation');

cy.get('nav.navbar').should('be.visible');
cy.get('nav.navbar').contains('a', 'GitHub').should('have.attr', 'href', 'https://github.com/violinist-dev/docs');

cy.get('footer.footer').should('be.visible');
cy.get('footer.footer').contains('a', 'Documentation').should('have.attr', 'href', '/');
});

it('toggles between light and dark mode', () => {
cy.visit('/');

cy.get('[aria-label^="Switch between dark and light mode"]')
.as('colorModeToggle')
.click();

cy.get('html').should('have.attr', 'data-theme');
});
});

describe('docs navigation', () => {
it('opens a doc page from the sidebar', () => {
cy.visit('/');

cy.get('.theme-doc-sidebar-container')
.find('button[aria-label="Expand sidebar category \'Self hosting\'"]')
.click();
cy.get('.theme-doc-sidebar-container').contains('a', 'Getting started').click();

cy.location('pathname').should('eq', '/self-hosting/getting-started');
cy.get('article').contains('h1', 'Getting started').should('be.visible');
});

it('follows next/previous pagination links', () => {
cy.visit('/self-hosting/getting-started');

cy.get('article').should('be.visible');
cy.get('nav.pagination-nav').should('exist');
});
});

describe('search', () => {
it('opens the search modal from the navbar', () => {
cy.visit('/');

cy.get('.DocSearch-Button').click();
cy.get('.DocSearch-Modal').should('be.visible');

cy.get('body').type('{esc}');
cy.get('.DocSearch-Modal').should('not.exist');
});
});
4 changes: 2 additions & 2 deletions docs/configuration/allow_list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ weight:

An array of packages to explicitly allow when updating packages with violinist. Defaults to nothing, which means all available updates will be attempted. This means that putting one package on the allow list will block all other updates from being attempted, while having zero packages on the allow list will not filter any of the updates.

> Note! When using in combination with [blocklist](#blocklisting-projects), the updates will first be filtered through the allow list, and then it will apply block list rules. This means you can explicitly allow `symfony/*` while still adding `symfony/yaml` to the block list.
> Note! When using in combination with [blocklist](/configuration/blocklist), the updates will first be filtered through the allow list, and then it will apply block list rules. This means you can explicitly allow `symfony/*` while still adding `symfony/yaml` to the block list.

> Note! This option has no effect if used in combination with [always_update_all](#updating-all).
> Note! This option has no effect if used in combination with [always_update_all](/configuration/always_update_all).

## Explanation

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/allow_update_indirect_with_direct.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ This way, `composer update vendor/package --with-dependencies` will run, regardl

Say you are trying out violinist and are duty fully merging all updates that comes in for a couple of weeks. And one day you decide to run `composer update` manually. Surprisingly you find out that there are several updates applied. How can that be? You have been using violinist and have merged all available updates?

The reason is violinist only updates direct dependencies (unless you set [check_only_direct_dependencies](#check-only-direct) to 0). So if one of your dependencies is in it's final version, and no more versions will be released, that final version can still depend on packages that receive weekly updates. Some people would therefore prefer to run the command `composer update vendor/package --with-dependencies` even if `vendor/package` has no updates, but the transitive dependencies from that package has updates.
The reason is violinist only updates direct dependencies (unless you set [check_only_direct_dependencies](/configuration/check_only_direct_dependencies) to 0). So if one of your dependencies is in it's final version, and no more versions will be released, that final version can still depend on packages that receive weekly updates. Some people would therefore prefer to run the command `composer update vendor/package --with-dependencies` even if `vendor/package` has no updates, but the transitive dependencies from that package has updates.

This is different than [check_only_direct_dependencies](#check-only-direct) set to 0, since `check_only_direct_dependencies` set to 0 would produce one merge request per direct or indirect dependency. While this option (`allow_update_indirect_with_direct`) will only have merge requests for direct dependencies, some with actual updates to the direct dependency, and some only to one or more of the dependencies of a direct dependency.
This is different than [check_only_direct_dependencies](/configuration/check_only_direct_dependencies) set to 0, since `check_only_direct_dependencies` set to 0 would produce one merge request per direct or indirect dependency. While this option (`allow_update_indirect_with_direct`) will only have merge requests for direct dependencies, some with actual updates to the direct dependency, and some only to one or more of the dependencies of a direct dependency.

If this sounds like the configuration you want, you would change your `composer.json` like so:

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/blacklist.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ anchor: "blacklisting-projects"
weight:
---

> Deprecated! Use [blocklist](#blocklisting-projects) instead
> Deprecated! Use [blocklist](/configuration/blocklist) instead
2 changes: 1 addition & 1 deletion docs/configuration/blocklist.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ weight:

An array of packages to always ignore while running updates with Violinist. Defaults to nothing.

> Note! This option has no effect if used in combination with [always_update_all](#updating-all).
> Note! This option has no effect if used in combination with [always_update_all](/configuration/always_update_all).

## Explanation

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/bundled_packages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ weight:

An array of packages to bundle with other packages, keyed by the main package.

>Quite often you probably want to also avoid getting pull requests for the packages you are bundling. To do this, you probably want to use a [block list](#blocklisting-projects) the packages in question.
>Quite often you probably want to also avoid getting pull requests for the packages you are bundling. To do this, you probably want to use a [block list](/configuration/blocklist) the packages in question.

## Explanation

Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/check_only_direct_dependencies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ weight:

Indicate whether you want violinist to check only direct dependencies, or all dependencies.

> Note! If you are looking for a way to get dependency updates of your direct dependencies, even if the direct dependency does not have a new version, then you probably want the option [allow_update_indirect_with_direct](#allow_update_direct_with_only_dependencies). The difference being, with the option `allow_update_indirect_with_direct` you get one pull request per direct dependency. But with this option (`check_only_direct_dependencies` set to 0) you get one pull request per package you have installed in your project, regardless of the package being directly required or not.
> Note! If you are looking for a way to get dependency updates of your direct dependencies, even if the direct dependency does not have a new version, then you probably want the option [allow_update_indirect_with_direct](/configuration/allow_update_indirect_with_direct). The difference being, with the option `allow_update_indirect_with_direct` you get one pull request per direct dependency. But with this option (`check_only_direct_dependencies` set to 0) you get one pull request per package you have installed in your project, regardless of the package being directly required or not.

## Explanation

By default, violinist will only try to update packages you are directly dependent on. This means that if you are dependent on the package `asm89/stack-cors`, your project will be _indirectly_ dependent on for example `symfony/http-foundation`. What that also means though, is that by default only pull requests to update the package `asm89/stack-cors` will be created. For many projects, this is what is desired. However, the frequency of releases to these packages can vary a lot. For example, between 2 versions of `asm89/stack-cors` there could theoretically be 10 versions of `symfony/http-foundation`. Some then find it surprising that even if they are merging all of the pull requests from violinist, running `composer update` still updates some packages for them. This is the reason.

> Note! This option will update all dependencies in your lock file. This can potentially mean _A LOT_ of pull requests. Therefore this option is best combined with either a [block list](#blocklisting-projects) or an [allow list](#allow-list)
> Note! This option will update all dependencies in your lock file. This can potentially mean _A LOT_ of pull requests. Therefore this option is best combined with either a [block list](/configuration/blocklist) or an [allow list](/configuration/allow_list)

> Note! This option has no effect if you have set `always_update_all` to 1.

Expand Down Expand Up @@ -59,4 +59,4 @@ Maybe you have a project that depend on a "meta-package" for your company, that

This way, there will be pull requests created for all of the packages, direct or indirect. And dependencies will therefore be kept up to date, regardless of the meta-package `company/package-with-symfony-dependencies-declared` getting a new version or not.

> Note! Again, this will potentially create _A LOT_ of pull requests. You probably want to combine this option with either a [block list](#blocklisting-projects) or an [allow list](#allow-list). Or maybe with [security_updates_only](#security-updates-only). Or maybe you might be looking for the option [allow_update_indirect_with_direct](#allow_update_direct_with_only_dependencies)
> Note! Again, this will potentially create _A LOT_ of pull requests. You probably want to combine this option with either a [block list](/configuration/blocklist) or an [allow list](/configuration/allow_list). Or maybe with [security_updates_only](/configuration/security_updates_only). Or maybe you might be looking for the option [allow_update_indirect_with_direct](/configuration/allow_update_indirect_with_direct)
2 changes: 1 addition & 1 deletion docs/configuration/timeframe_disallowed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Indicate what timeframe the updater are allowed and disallowed to run.

By default, violinist will try to run updates all of the time. When a new package is released, or when it is time to rebase the existing pull requests. If you are actively working on a project during work hours, this can be either annoying or impractical. For example, it could clog up the CI pipeline if you have many projects monitored. So maybe you want to restrict the updater to run in a certain timeframe, so these pull requests and rebased branches can run when they are not getting in your way? If that is the case, you probably want the option __timeframe_disallowed__.

If you want to combine this with your local time, you want to use the option [timezone](#timezone)
If you want to combine this with your local time, you want to use the option [timezone](/configuration/timezone)

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/branches.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The branch name is named after the name of the package being updated, and the ve

For example, if violinist finds out it wants to update your dependency psr/log from version 1.0.0 to 1.1.4 it would create the branch `psrlog100114`.

If you want your branches to be named differently, you might be interested in [specifying a branch prefix](#branch-prefix).
If you want your branches to be named differently, you might be interested in [specifying a branch prefix](/configuration/branch_prefix).

## Keeping the branch up to date

Expand Down
4 changes: 2 additions & 2 deletions docs/introduction/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The two options mean as follows:

There are still several ways this can be manipulated. See the config options for details. For example:

- If you set the option [check_only_direct_dependencies](#check-only-direct) to `0` the `--direct` flag will not be used.
- If you set the option [check_only_direct_dependencies](/configuration/check_only_direct_dependencies) to `0` the `--direct` flag will not be used.
- You can control the update level (major, minor, or patch) using the [composer_outdated_flag](/configuration/composer_outdated_flag) option.

## Updating packages
Expand All @@ -36,6 +36,6 @@ The default command for updating packages with violinist are the following:
composer update vendor/package --with-dependencies
```

If you do not want violinist to update with dependencies, you can use the configuration option [update_with_dependencies](#update-with-deps) and set this to `0`.
If you do not want violinist to update with dependencies, you can use the configuration option [update_with_dependencies](/configuration/update_with_dependencies) and set this to `0`.

If you want to update a package bundled with another package, you probably want to have a look at the option [bundled_packages](/configuration/bundled_packages).
8 changes: 7 additions & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ const config: Config = {
projectName: 'docs',

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
onBrokenAnchors: 'throw',

markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
Expand Down
Loading