Change slogan and refactor project info naming

The project's slagon has been updated back to "Privacy is sexy" from
"Now you have the choice" for enhanced brand clarity and memorability.

This change also reflects the community's preference and aligns with the
project's established identity.

This commit also refactors naming and structure of project information
(metadata) struct to enhance clarity and maintainability in relation to
changing the slogan.

Key changes include:

- Update UI components to display the revised slogan.
- Remove period from project slogan in code area for consistency with a
  explanatory comment for future maintainability.
- Refactor header container and class names for clarity.
- Standardize project metadata usage in `TheCodeArea.vue` to ensure
  consistency.
- Improve code clarity by renaming `IProjectInformation` to
  `ProjectDetails` and `ProjectInformation` to `GitHubProjectDetails`.
- Organize `ProjectDetails` under a dedicated `Project` directory within
  the domain layer for better structure.

These changes are expected to improve the project's appeal and
streamline future maintenance and development efforts.
This commit is contained in:
undergroundwires
2024-02-10 18:50:56 +01:00
parent b9c89b701f
commit a54e16488c
38 changed files with 273 additions and 256 deletions

View File

@@ -1,11 +1,11 @@
import type { CollectionData } from '@/application/collections/';
import { IApplication } from '@/domain/IApplication';
import { IProjectInformation } from '@/domain/IProjectInformation';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import { ICategoryCollection } from '@/domain/ICategoryCollection';
import WindowsData from '@/application/collections/windows.yaml';
import MacOsData from '@/application/collections/macos.yaml';
import LinuxData from '@/application/collections/linux.yaml';
import { parseProjectInformation } from '@/application/Parser/ProjectInformationParser';
import { parseProjectDetails } from '@/application/Parser/ProjectDetailsParser';
import { Application } from '@/domain/Application';
import { IAppMetadata } from '@/infrastructure/EnvironmentVariables/IAppMetadata';
import { EnvironmentVariablesFactory } from '@/infrastructure/EnvironmentVariables/EnvironmentVariablesFactory';
@@ -13,19 +13,21 @@ import { parseCategoryCollection } from './CategoryCollectionParser';
export function parseApplication(
categoryParser = parseCategoryCollection,
informationParser = parseProjectInformation,
projectDetailsParser = parseProjectDetails,
metadata: IAppMetadata = EnvironmentVariablesFactory.Current.instance,
collectionsData = PreParsedCollections,
): IApplication {
validateCollectionsData(collectionsData);
const information = informationParser(metadata);
const collections = collectionsData.map((collection) => categoryParser(collection, information));
const app = new Application(information, collections);
const projectDetails = projectDetailsParser(metadata);
const collections = collectionsData.map(
(collection) => categoryParser(collection, projectDetails),
);
const app = new Application(projectDetails, collections);
return app;
}
export type CategoryCollectionParserType
= (file: CollectionData, info: IProjectInformation) => ICategoryCollection;
= (file: CollectionData, projectDetails: ProjectDetails) => ICategoryCollection;
const PreParsedCollections: readonly CollectionData [] = [
WindowsData, MacOsData, LinuxData,

View File

@@ -2,7 +2,7 @@ import type { CollectionData } from '@/application/collections/';
import { OperatingSystem } from '@/domain/OperatingSystem';
import { ICategoryCollection } from '@/domain/ICategoryCollection';
import { CategoryCollection } from '@/domain/CategoryCollection';
import { IProjectInformation } from '@/domain/IProjectInformation';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import { createEnumParser } from '../Common/Enum';
import { parseCategory } from './CategoryParser';
import { CategoryCollectionParseContext } from './Script/CategoryCollectionParseContext';
@@ -10,12 +10,12 @@ import { ScriptingDefinitionParser } from './ScriptingDefinition/ScriptingDefini
export function parseCategoryCollection(
content: CollectionData,
info: IProjectInformation,
projectDetails: ProjectDetails,
osParser = createEnumParser(OperatingSystem),
): ICategoryCollection {
validate(content);
const scripting = new ScriptingDefinitionParser()
.parse(content.scripting, info);
.parse(content.scripting, projectDetails);
const context = new CategoryCollectionParseContext(content.functions, scripting);
const categories = content.actions.map((action) => parseCategory(action, context));
const os = osParser.parseEnum(content.os, 'os');

View File

@@ -1,21 +1,21 @@
import { IProjectInformation } from '@/domain/IProjectInformation';
import { ProjectInformation } from '@/domain/ProjectInformation';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import { GitHubProjectDetails } from '@/domain/Project/GitHubProjectDetails';
import { IAppMetadata } from '@/infrastructure/EnvironmentVariables/IAppMetadata';
import { Version } from '@/domain/Version';
import { EnvironmentVariablesFactory } from '@/infrastructure/EnvironmentVariables/EnvironmentVariablesFactory';
import { ConstructorArguments } from '@/TypeHelpers';
export function
parseProjectInformation(
parseProjectDetails(
metadata: IAppMetadata = EnvironmentVariablesFactory.Current.instance,
createProjectInformation: ProjectInformationFactory = (
createProjectDetails: ProjectDetailsFactory = (
...args
) => new ProjectInformation(...args),
): IProjectInformation {
) => new GitHubProjectDetails(...args),
): ProjectDetails {
const version = new Version(
metadata.version,
);
return createProjectInformation(
return createProjectDetails(
metadata.name,
version,
metadata.slogan,
@@ -24,6 +24,6 @@ parseProjectInformation(
);
}
export type ProjectInformationFactory = (
...args: ConstructorArguments<typeof ProjectInformation>
) => IProjectInformation;
export type ProjectDetailsFactory = (
...args: ConstructorArguments<typeof GitHubProjectDetails>
) => ProjectDetails;

View File

@@ -2,7 +2,7 @@ import { IExpressionsCompiler } from '@/application/Parser/Script/Compiler/Expre
import { ParameterSubstitutionParser } from '@/application/Parser/Script/Compiler/Expressions/SyntaxParsers/ParameterSubstitutionParser';
import { CompositeExpressionParser } from '@/application/Parser/Script/Compiler/Expressions/Parser/CompositeExpressionParser';
import { ExpressionsCompiler } from '@/application/Parser/Script/Compiler/Expressions/ExpressionsCompiler';
import { IProjectInformation } from '@/domain/IProjectInformation';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import { FunctionCallArgumentCollection } from '@/application/Parser/Script/Compiler/Function/Call/Argument/FunctionCallArgumentCollection';
import { FunctionCallArgument } from '@/application/Parser/Script/Compiler/Function/Call/Argument/FunctionCallArgument';
import { ICodeSubstituter } from './ICodeSubstituter';
@@ -15,13 +15,13 @@ export class CodeSubstituter implements ICodeSubstituter {
}
public substitute(code: string, info: IProjectInformation): string {
public substitute(code: string, projectDetails: ProjectDetails): string {
if (!code) { throw new Error('missing code'); }
const args = new FunctionCallArgumentCollection();
const substitute = (name: string, value: string) => args
.addArgument(new FunctionCallArgument(name, value));
substitute('homepage', info.homepage);
substitute('version', info.version.toString());
substitute('homepage', projectDetails.homepage);
substitute('version', projectDetails.version.toString());
substitute('date', this.date.toUTCString());
const compiledCode = this.compiler.compileExpressions(code, args);
return compiledCode;

View File

@@ -1,5 +1,5 @@
import { IProjectInformation } from '@/domain/IProjectInformation';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
export interface ICodeSubstituter {
substitute(code: string, info: IProjectInformation): string;
substitute(code: string, projectDetails: ProjectDetails): string;
}

View File

@@ -2,7 +2,7 @@ import type { ScriptingDefinitionData } from '@/application/collections/';
import { IScriptingDefinition } from '@/domain/IScriptingDefinition';
import { ScriptingDefinition } from '@/domain/ScriptingDefinition';
import { ScriptingLanguage } from '@/domain/ScriptingLanguage';
import { IProjectInformation } from '@/domain/IProjectInformation';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import { createEnumParser } from '../../Common/Enum';
import { ICodeSubstituter } from './ICodeSubstituter';
import { CodeSubstituter } from './CodeSubstituter';
@@ -16,11 +16,11 @@ export class ScriptingDefinitionParser {
public parse(
definition: ScriptingDefinitionData,
info: IProjectInformation,
projectDetails: ProjectDetails,
): IScriptingDefinition {
const language = this.languageParser.parseEnum(definition.language, 'language');
const startCode = this.codeSubstituter.substitute(definition.startCode, info);
const endCode = this.codeSubstituter.substitute(definition.endCode, info);
const startCode = this.codeSubstituter.substitute(definition.startCode, projectDetails);
const endCode = this.codeSubstituter.substitute(definition.endCode, projectDetails);
return new ScriptingDefinition(
language,
startCode,

View File

@@ -1,11 +1,11 @@
import { IApplication } from './IApplication';
import { ICategoryCollection } from './ICategoryCollection';
import { IProjectInformation } from './IProjectInformation';
import { ProjectDetails } from './Project/ProjectDetails';
import { OperatingSystem } from './OperatingSystem';
export class Application implements IApplication {
constructor(
public info: IProjectInformation,
public projectDetails: ProjectDetails,
public collections: readonly ICategoryCollection[],
) {
validateCollections(collections);

View File

@@ -1,9 +1,9 @@
import { ICategoryCollection } from './ICategoryCollection';
import { IProjectInformation } from './IProjectInformation';
import { ProjectDetails } from './Project/ProjectDetails';
import { OperatingSystem } from './OperatingSystem';
export interface IApplication {
readonly info: IProjectInformation;
readonly projectDetails: ProjectDetails;
readonly collections: readonly ICategoryCollection[];
getSupportedOsList(): OperatingSystem[];

View File

@@ -1,9 +1,9 @@
import { assertInRange } from '@/application/Common/Enum';
import { IProjectInformation } from './IProjectInformation';
import { OperatingSystem } from './OperatingSystem';
import { Version } from './Version';
import { OperatingSystem } from '../OperatingSystem';
import { Version } from '../Version';
import type { ProjectDetails } from './ProjectDetails';
export class ProjectInformation implements IProjectInformation {
export class GitHubProjectDetails implements ProjectDetails {
public readonly repositoryWebUrl: string;
constructor(

View File

@@ -1,7 +1,7 @@
import { OperatingSystem } from '@/domain/OperatingSystem';
import { Version } from '@/domain/Version';
export interface IProjectInformation {
export interface ProjectDetails {
readonly name: string;
readonly version: Version;

View File

@@ -44,14 +44,14 @@ export default defineComponent({
setup() {
const { currentState } = injectKey((keys) => keys.useCollectionState);
const { info } = injectKey((keys) => keys.useApplication);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const operatingSystem = computed<OperatingSystem>(() => currentState.value.os);
const appName = computed<string>(() => info.name);
const appName = computed<string>(() => projectDetails.name);
const downloadUrl = computed<string>(
() => info.getDownloadUrl(operatingSystem.value),
() => projectDetails.getDownloadUrl(operatingSystem.value),
);
const osName = computed<string>(

View File

@@ -24,6 +24,7 @@ import { IReadOnlyCategoryCollectionState } from '@/application/Context/State/IC
import { CodeBuilderFactory } from '@/application/Context/State/Code/Generation/CodeBuilderFactory';
import SizeObserver from '@/presentation/components/Shared/SizeObserver.vue';
import { NonCollapsing } from '@/presentation/components/Scripts/View/Cards/NonCollapsingDirective';
import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import ace from './ace-importer';
export default defineComponent({
@@ -41,6 +42,7 @@ export default defineComponent({
},
setup(props) {
const { onStateChange, currentState } = injectKey((keys) => keys.useCollectionState);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const { events } = injectKey((keys) => keys.useAutoUnsubscribedEvents);
const editorId = 'codeEditor';
@@ -74,7 +76,7 @@ export default defineComponent({
}
function updateCode(code: string, language: ScriptingLanguage) {
const innerCode = code || getDefaultCode(language);
const innerCode = code || getDefaultCode(language, projectDetails);
editor?.setValue(innerCode, 1);
}
@@ -171,10 +173,14 @@ function getLanguage(language: ScriptingLanguage) {
}
}
function getDefaultCode(language: ScriptingLanguage): string {
function getDefaultCode(language: ScriptingLanguage, project: ProjectDetails): string {
return new CodeBuilderFactory()
.create(language)
.appendCommentLine('privacy.sexy — Now you have the choice.')
.appendCommentLine(`${project.name}${project.slogan}`)
/*
Keep the slogan without a period for impact and continuity.
Slogans should be punchy and memorable, not punctuated like full sentences.
*/
.appendCommentLine(' 🔐 Enforce privacy & security best-practices on Windows, macOS and Linux.')
.appendLine()
.appendCommentLine('-- 🤔 How to use')
@@ -183,7 +189,7 @@ function getDefaultCode(language: ScriptingLanguage): string {
.appendCommentLine(' 📙 After you choose any tweak, you can download or copy to execute your script.')
.appendCommentLine(' 📙 Come back regularly to apply latest version for stronger privacy and security.')
.appendLine()
.appendCommentLine('-- 🧐 Why privacy.sexy')
.appendCommentLine(`-- 🧐 Why ${project.name}`)
.appendCommentLine(' ✔️ Rich tweak pool to harden security & privacy of the OS and other software on it.')
.appendCommentLine(' ✔️ No need to run any compiled software on your system, just run the generated scripts.')
.appendCommentLine(' ✔️ Have full visibility into what the tweaks do as you enable them.')

View File

@@ -62,9 +62,9 @@ export default defineComponent({
setup() {
const { modifyCurrentState, onStateChange } = injectKey((keys) => keys.useCollectionState);
const { events } = injectKey((keys) => keys.useAutoUnsubscribedEvents);
const { info } = injectKey((keys) => keys.useApplication);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const repositoryUrl = computed<string>(() => info.repositoryWebUrl);
const repositoryUrl = computed<string>(() => projectDetails.repositoryWebUrl);
const searchQuery = ref<string | undefined>();
const isSearching = computed(() => Boolean(searchQuery.value));
const searchHasMatches = ref(false);

View File

@@ -3,6 +3,6 @@ import { IApplication } from '@/domain/IApplication';
export function useApplication(application: IApplication) {
return {
application,
info: application.info,
projectDetails: application.projectDetails,
};
}

View File

@@ -26,7 +26,7 @@ export default defineComponent({
},
},
setup(props) {
const { info } = injectKey((keys) => keys.useApplication);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const { os: currentOs } = injectKey((keys) => keys.useRuntimeEnvironment);
const isCurrentOs = computed<boolean>(() => {
@@ -42,7 +42,7 @@ export default defineComponent({
});
const downloadUrl = computed<string>(() => {
return info.getDownloadUrl(props.operatingSystem);
return projectDetails.getDownloadUrl(props.operatingSystem);
});
return {

View File

@@ -59,11 +59,11 @@ import { injectKey } from '@/presentation/injectionSymbols';
export default defineComponent({
setup() {
const { info } = injectKey((keys) => keys.useApplication);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const { isRunningAsDesktopApplication } = injectKey((keys) => keys.useRuntimeEnvironment);
const repositoryUrl = computed<string>(() => info.repositoryUrl);
const feedbackUrl = computed<string>(() => info.feedbackUrl);
const repositoryUrl = computed<string>(() => projectDetails.repositoryUrl);
const feedbackUrl = computed<string>(() => projectDetails.feedbackUrl);
return {
repositoryUrl,

View File

@@ -67,20 +67,20 @@ export default defineComponent({
FlatButton,
},
setup() {
const { info } = injectKey((keys) => keys.useApplication);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const { isRunningAsDesktopApplication } = injectKey((keys) => keys.useRuntimeEnvironment);
const isPrivacyDialogVisible = ref(false);
const version = computed<string>(() => info.version.toString());
const version = computed<string>(() => projectDetails.version.toString());
const homepageUrl = computed<string>(() => info.homepage);
const homepageUrl = computed<string>(() => projectDetails.homepage);
const repositoryUrl = computed<string>(() => info.repositoryWebUrl);
const repositoryUrl = computed<string>(() => projectDetails.repositoryWebUrl);
const releaseUrl = computed<string>(() => info.releaseUrl);
const releaseUrl = computed<string>(() => projectDetails.releaseUrl);
const feedbackUrl = computed<string>(() => info.feedbackUrl);
const feedbackUrl = computed<string>(() => projectDetails.feedbackUrl);
function showPrivacyDialog() {
isPrivacyDialogVisible.value = true;

View File

@@ -1,9 +1,13 @@
<template>
<div id="container">
<h1 class="child title">
<div class="container">
<h1 class="child brand">
{{ title }}
</h1>
<h2 class="child subtitle">
<h2 class="child slogan">
<!--
Keep the slogan without a period for impact and continuity.
Slogans should be punchy and memorable, not punctuated like full sentences.
-->
{{ subtitle }}
</h2>
</div>
@@ -15,10 +19,10 @@ import { injectKey } from '@/presentation/injectionSymbols';
export default defineComponent({
setup() {
const { info } = injectKey((keys) => keys.useApplication);
const { projectDetails } = injectKey((keys) => keys.useApplication);
const title = computed(() => info.name);
const subtitle = computed(() => info.slogan);
const title = computed(() => projectDetails.name);
const subtitle = computed(() => projectDetails.slogan);
return {
title,
@@ -32,7 +36,7 @@ export default defineComponent({
<style scoped lang="scss">
@use "@/presentation/assets/styles/main" as *;
#container {
.container {
display: flex;
align-items: center;
flex-direction: column;
@@ -42,13 +46,13 @@ export default defineComponent({
text-align: center;
}
.title {
.brand {
margin: 0;
text-transform: uppercase;
font-family: $font-main;
font-size: $font-size-absolute-xx-large;
}
.subtitle {
.slogan {
margin: 0;
font-size: $font-size-absolute-x-large;
color: $color-primary;

View File

@@ -1,9 +1,9 @@
import { shell } from 'electron';
import { UpdateInfo } from 'electron-updater';
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
import { ProjectInformation } from '@/domain/ProjectInformation';
import { GitHubProjectDetails } from '@/domain/Project/GitHubProjectDetails';
import { Version } from '@/domain/Version';
import { parseProjectInformation } from '@/application/Parser/ProjectInformationParser';
import { parseProjectDetails } from '@/application/Parser/ProjectDetailsParser';
import { OperatingSystem } from '@/domain/OperatingSystem';
import { UpdateProgressBar } from '../UpdateProgressBar';
import {
@@ -139,8 +139,8 @@ interface UpdateUrls {
}
function getRemoteUpdateUrls(targetVersion: string): UpdateUrls {
const existingProject = parseProjectInformation();
const targetProject = new ProjectInformation(
const existingProject = parseProjectDetails();
const targetProject = new GitHubProjectDetails(
existingProject.name,
new Version(targetVersion),
existingProject.slogan,