generated from ergebnis/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Implement ConvertCommand
- Loading branch information
1 parent
51cb875
commit ffe0783
Showing
141 changed files
with
6,059 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ jobs: | |
- name: "Collect code coverage with Xdebug and phpunit/phpunit" | ||
env: | ||
XDEBUG_MODE: "coverage" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/Unit/phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml" | ||
|
||
- name: "Send code coverage report to codecov.io" | ||
uses: "codecov/[email protected]" | ||
|
@@ -319,4 +319,7 @@ jobs: | |
dependencies: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run unit tests with phpunit/phpunit" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/Unit/phpunit.xml" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/phpunit.xml vendor/bin/phpunit -testsuite=unit" | ||
|
||
- name: "Run unit tests with phpunit/phpunit" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/phpunit.xml vendor/bin/phpunit -testsuite=integration" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/.build/ | ||
/.notes/ | ||
/demo/obsidian/ | ||
!/demo/obsidian/.gitkeep | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2022 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/ergebnis/day-one-to-obsidian-converter | ||
*/ | ||
|
||
use Ergebnis\DayOneToObsidianConverter\Outside; | ||
use Ergebnis\Json\SchemaValidator; | ||
use Symfony\Component\Console; | ||
use Symfony\Component\Filesystem; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$schemaValidator = new SchemaValidator\SchemaValidator(); | ||
$schema = SchemaValidator\Json::fromFile(__DIR__ . '/../resource/day-one/schema.json'); | ||
|
||
$convertCommand = new Outside\Adapter\Primary\Console\ConvertCommand( | ||
new Outside\Adapter\Secondary\DayOne\JournalFinder(new Outside\Adapter\Secondary\DayOne\JournalReader( | ||
$schemaValidator, | ||
$schema, | ||
new Outside\Infrastructure\DataNormalizer(), | ||
)), | ||
new Outside\Adapter\Secondary\Obsidian\NoteWriter(), | ||
new Filesystem\Filesystem(), | ||
); | ||
|
||
$application = new Console\Application(); | ||
|
||
$application->add($convertCommand); | ||
$application->setDefaultCommand( | ||
$convertCommand->getName(), | ||
true, | ||
); | ||
|
||
$application->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# README | ||
|
||
The files in [`json-export-example/`](json-export-example/) are taken from https://bloom-documentation.s3.amazonaws.com/JSON+Export+example.zip (shared on https://dayoneapp.com/guides/settings/importing-data-to-day-one/). | ||
|
||
Run | ||
|
||
```sh | ||
php bin/day-one-to-obsidian-converter demo/day-one/ demo/obsidian | ||
``` | ||
|
||
to see the converter in action. |
Oops, something went wrong.