Skip to content

Commit

Permalink
Add Version Info (#5)
Browse files Browse the repository at this point in the history
Add versioning information and bump version to 0.1.0 - this is dynamically populated from the `package.json` file.
  • Loading branch information
GCHQDeveloper81 authored Jul 18, 2024
1 parent 64b69ed commit 60e30b0
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 2 deletions.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ If you found a bug or you'd like a new feature or change, you can [file an issue

Before making a new one, please search the existing issues to check if your change has already been requested. Comment on an issue to let us know you're interested.

## Versioning

LD Explorer intends to follow [Semantic Versioning 2.0](https://semver.org/), which can be summarised roughly as follows:

- MAJOR version for incompatible or breaking changes, deprecated features or anytihng that prevents the user doing what they could previously do.
- MINOR version for any new functionality, or when marking existing functionality as deprecated.
- PATCH for backward compatible bug fixes or changes that the user isn't necessarily aware of. This includes upgrading dependencies and refactoring code.

Note that LD Explorer is currently in **Initial Development** and currently has a version number `0.x.x`. As per the Semantic Versioning specification, this means that anything MAY change at any time and the public API SHOULD NOT be considered stable. We will consider moving to `1.0.0` once we have observed that the software has proved its value and has a community of users.

## Contributing code

Prior to us accepting any work, you must sign the [GCHQ CLA Agreement](https://cla-assistant.io/gchq/ld-explorer). We follow a branching strategy for handling contributions:
Expand All @@ -20,6 +30,10 @@ You can contribute code for any issue by raising a pull request from your own fo

Please engage with us before undertaking any significant amount of work and before starting work on any new features.

### Code Quality

Despite this being prototype software, we have still tried to keep the code to a high standard. Code quality is currently automated through various built-time checks (eslint, typescript...) which need to pass before pull requests will be accepted. Code quality will also be assured manually by trusted maintainers on any pull request.

### Tests

Before opening a pull request, please ensure that the tests pass. See [Readme.md](./README.md) for details.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ld-explorer",
"version": "0.0.0",
"version": "0.1.0",
"private": true,
"license": "Apache-2.0",
"bugs": {
Expand Down
3 changes: 3 additions & 0 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces

declare global {
declare const PUBLIC_VERSION: string;

namespace App {
// interface Error {}
// interface Locals {}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/layout/nav/SideNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import { page } from '$app/stores';
import { shouldHighlightSideNav } from '$lib/util/nav.utils';
import { sources } from '$stores/sources/sources.store';
import { version } from '$lib/constants';
type SideNavItemDetail = {
[key in SideNavId]: {
Expand Down Expand Up @@ -91,7 +92,7 @@

<ic-side-navigation
app-title="LD-Explorer"
version="v0.0.0"
version={`v${version}`}
data-testid="main-nav"
status="Prototype"
collapsed-icon-labels
Expand Down
4 changes: 4 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* (c) Crown Copyright GCHQ */

// PUBLIC_VERSION will be set to the version number from package.json
export const version = PUBLIC_VERSION;
Binary file modified static/ld-explorer-acr.docx
Binary file not shown.
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { configDefaults, defineConfig } from 'vitest/config';
import { fileURLToPath } from 'url';
import { readFileSync } from 'fs';
import { sveltekit } from '@sveltejs/kit/vite';

const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const pkg = JSON.parse(json);

export default defineConfig({
plugins: [sveltekit()],
define: {
PUBLIC_VERSION: JSON.stringify(pkg.version)
},
test: {
environment: 'jsdom', // we're making a web app, so we want a web-like environment
globals: true, // avoid having to import things like "describe" and "expect"
Expand Down

0 comments on commit 60e30b0

Please sign in to comment.