Skip to content

Commit

Permalink
Added initial blueprint structure
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <tom@inflatablecookie.com>
  • Loading branch information
betterthanclay committed Jul 23, 2024
1 parent b9bb989 commit 316d406
Show file tree
Hide file tree
Showing 32 changed files with 1,685 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# https://EditorConfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
block_comment_start = /*
block_comment = *
block_comment_end = */

[*.yml]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.editorconfig export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
CHANGELOG.md export-ignore
ecs.php export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
docs/ export-ignore
tests/ export-ignore
130 changes: 130 additions & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: "Integrate"

on:
push:
branches:
- "develop"
pull_request: null

env:
PHP_EXTENSIONS: "intl"

jobs:
file_consistency:
name: "1️⃣ File consistency"
runs-on: "ubuntu-latest"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "post_max_size=256M"

- name: "Checkout code"
uses: "actions/checkout@v4"

- name: Install Effigy
run: |
composer global config --no-plugins allow-plugins.phpstan/extension-installer true
composer global require decodelabs/effigy
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

- name: "Check file permissions"
run: |
composer global exec effigy check-executable-permissions
- name: "Check exported files"
run: |
composer global exec effigy check-git-exports
- name: "Find non-printable ASCII characters"
run: |
composer global exec effigy check-non-ascii
- name: "Check source code for syntax errors"
run: |
composer global exec effigy lint
static_analysis:
name: "3️⃣ Static Analysis"
needs:
- "file_consistency"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "post_max_size=256M"

- name: "Checkout code"
uses: "actions/checkout@v4"

- name: Install Effigy
run: |
composer global config --no-plugins allow-plugins.phpstan/extension-installer true
composer global require decodelabs/effigy
- name: "Validate Composer configuration"
run: "composer validate --strict"

- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

- name: "Execute static analysis"
run: |
composer global exec effigy analyze -- --headless
coding_standards:
name: "4️⃣ Coding Standards"
needs:
- "file_consistency"
runs-on: "ubuntu-latest"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "post_max_size=256M"

- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Check EditorConfig configuration"
run: "test -f .editorconfig"

- name: "Check adherence to EditorConfig"
uses: "greut/eclint-action@v0"

- name: Install Effigy
run: |
composer global config --no-plugins allow-plugins.phpstan/extension-installer true
composer global require decodelabs/effigy
- name: "Install dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

- name: "Check coding style"
run: |
composer global exec effigy format -- --headless
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/vendor
composer.phar
composer.lock
.DS_Store
Thumbs.db
/phpunit.xml
/.idea
/.env
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## v0.1.0 (2024-07-22)
* Built initial implementation
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Chronos

[![PHP from Packagist](https://img.shields.io/packagist/php-v/decodelabs/chronos?style=flat)](https://packagist.org/packages/decodelabs/chronos)
[![Latest Version](https://img.shields.io/packagist/v/decodelabs/chronos.svg?style=flat)](https://packagist.org/packages/decodelabs/chronos)
[![Total Downloads](https://img.shields.io/packagist/dt/decodelabs/chronos.svg?style=flat)](https://packagist.org/packages/decodelabs/chronos)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/decodelabs/chronos/integrate.yml?branch=develop)](https://github.com/decodelabs/chronos/actions/workflows/integrate.yml)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true&style=flat)](https://github.com/phpstan/phpstan)
[![License](https://img.shields.io/packagist/l/decodelabs/chronos?style=flat)](https://packagist.org/packages/decodelabs/chronos)

### Powerful schedule management system

Chronos provides an extensible format and operating structures for defining complex event programs.

_Get news and updates on the [DecodeLabs blog](https://blog.decodelabs.com)._

---

## Installation

Install via Composer:

```bash
composer require decodelabs/chronos
```

## Usage

Coming soon...

## Licensing

Chronos is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.
35 changes: 35 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "decodelabs/chronos",
"description": "Powerful schedule management system",
"type": "library",
"keywords": [ ],
"license": "MIT",
"authors": [ {
"name": "Tom Wright",
"email": "tom@inflatablecookie.com"
} ],
"require": {
"php": "^8.1",

"decodelabs/dictum": "^0.6.3",
"decodelabs/enumerable": "^0.1.2",
"decodelabs/exceptional": "^0.4.5",
"decodelabs/guidance": "^0.1.11",
"decodelabs/slingshot": "^0.1.9",

"nesbot/carbon": "^3.7"
},
"require-dev": {
"decodelabs/phpstan-decodelabs": "^0.6.8"
},
"autoload": {
"psr-4": {
"DecodeLabs\\Chronos\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-develop": "0.1.x-dev"
}
}
}
14 changes: 14 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

// ecs.php

declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
->withPaths([__DIR__.'/src'])
->withPreparedSets(
cleanCode: true,
psr12: true
);
47 changes: 47 additions & 0 deletions examples/artist-profile-setup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"id": "artist-profile-setup",
"name": "Artist Profile Setup",
"description": "Get your artist profile in check - get your biography written, photos uploaded and best foot forward.",
"categories": [ "profile", "setup" ],
"duration": "1 week",
"priority": "high",
"steps": [ {
"id": "select-profile",
"priority": "critical",
"actions": {
"Profile.Select:$profile": { }
}
}, {
"id": "choose-name",
"priority": "medium",
"duration": "2 hours",
"actions": {
"Profile.GenerateName": { }
}
}, {
"id": "upload-avatar",
"priority": "high",
"duration": "1 hour",
"actions": {
"Profile.UploadAvatar": { }
}
}, {
"id": "write-biography",
"priority": "medium",
"duration": "1 day",
"actions": {
"Profile.GenerateBiography": { }
}
}, {
"id": "upload-photos",
"await": {
"select-profile": "5 days",
"upload-avatar": null
},
"priority": "low",
"duration": "1 hour",
"actions": {
"Profile.UploadPhotos": { }
}
} ]
}
68 changes: 68 additions & 0 deletions examples/campaign.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"initial": "6mo-album-release",
"programs": [ {
"id": "6mo-album-release",
"name": "6 Month Album Release",
"description": "A 6 month campaign to promote the release of a new album",
"duration": "6 months",
"priority": "high",
"steps": [ {
"id": "select-release",
"priority": "critical",
"actions": {
"Release.Select:$release": {
"unreleased": true
}
}
}, {
"id": "schedule-tracks",
"depends": [ "select-release" ],
"priority": "high",
"actions": {
"Release.ListTracks:tracks": {
"release": "{{release}}"
},
"Stagger:track,date": {
"list": "{{tracks}}",
"start": "now",
"duration": "{{duration}}",
"interval": "1 week",
"actions": {
"Program.Initiate": {
"start": "{{date}}",
"program": "album-track-promo",
"parameters": {
"track": "{{track}}"
}
}
}
}
}
} ]
}, {
"id": "track-promo",
"name": "Track Promo",
"description": "A campaign to promote a single track for release",
"duration": "2 weeks",
"priority": "high",
"steps": [ {
"id": "select-track",
"priority": "critical",
"actions": {
"Track.Select:$track": {
"release": "{{release}}"
}
}
}, {
"id": "create-clips",
"depends": [ "select-track" ],
"priority": "high",
"task": {
"name": "Prepare track clip video for {{track}}",
"description": "Create a short preview clip video that can be used on social media, around 30 seconds long. Either use visuals from the final music video if available, or use an audio visualiser or images as an alternative. Include the track title and artist name in the visuals.",
"duration": "1 day",
"help": "content/video/track-clips"
}
} ]
} ]
}
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
paths:
- src
level: max
16 changes: 16 additions & 0 deletions src/Blueprint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* @package Chronos
* @license http://opensource.org/licenses/MIT
*/

declare(strict_types=1);

namespace DecodeLabs\Chronos;

use JsonSerializable;

interface Blueprint extends JsonSerializable
{
}
Loading

0 comments on commit 316d406

Please sign in to comment.