Skip to content

Commit 26ef87e

Browse files
committed
feat: created project skeleton
1 parent eb61723 commit 26ef87e

11 files changed

+194
-5
lines changed

.github/workflows/php-package.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PHP Package
2+
on:
3+
push:
4+
pull_request:
5+
workflow_call:
6+
jobs:
7+
format-check:
8+
name: Check PSR12 Standarts
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: 8.2
16+
tools: composer:v2
17+
- run: composer install
18+
shell: bash
19+
- run: composer format:check
20+
shell: bash
21+
tests:
22+
name: Run Tests
23+
runs-on: ubuntu-24.04
24+
strategy:
25+
matrix:
26+
php-version:
27+
- 8.2
28+
- 8.3
29+
io-driver:
30+
- eio
31+
- uv
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: ${{ matrix.php-version }}
38+
extensions: ${{ matrix.io-driver }}
39+
tools: composer:v2
40+
coverage: xdebug3
41+
- run: composer install
42+
shell: bash
43+
- run: composer test
44+
shell: bash

.github/workflows/release-please.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: Create Release
11+
12+
jobs:
13+
verify-release:
14+
uses: ./.github/workflows/php-package.yml
15+
release-please:
16+
needs: verify-release
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
with:
21+
release-type: php

.gitignore

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
composer.phar
21
/vendor/
3-
4-
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
5-
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
6-
# composer.lock
2+
/composer.lock
3+
/.idea
4+
/.phpunit.cache

.release-please-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.0"
3+
}

bin/mysql2jsonl

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!env php
2+
<?php
3+
4+
require_once __DIR__ . '/../vendor/autoload.php';

composer.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "ecomdev/mysql-to-jsonl",
3+
"description": "Export/Import JSONL files as data for MySQL tables",
4+
"type": "library",
5+
"require": {
6+
"php": "~8.2",
7+
"amphp/file": "~3.2",
8+
"amphp/mysql": "~3.0",
9+
"amphp/amp": "~3.0",
10+
"revolt/event-loop": "~1.0",
11+
"symfony/console": "~7.2"
12+
},
13+
"require-dev": {
14+
"squizlabs/php_codesniffer": "^3.0",
15+
"phpunit/phpunit": "^11.5",
16+
"brianium/paratest": "^7.7",
17+
"ecomdev/testcontainers-magento-data":"~1.1"
18+
},
19+
"license": [
20+
"MIT"
21+
],
22+
"keywords": [
23+
"mysql", "jsonl", "backup"
24+
],
25+
"autoload": {
26+
"psr-4": {
27+
"EcomDev\\MySQL2JSONL\\": "src"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"EcomDev\\MySQL2JSONL\\": "tests"
33+
}
34+
},
35+
"scripts": {
36+
"test": "XDEBUG_MODE=coverage paratest --coverage-text",
37+
"format:check": "phpcs",
38+
"format:write": "phpcbf"
39+
},
40+
"bin": [
41+
"bin/mysql2jsonl"
42+
],
43+
"$schema": "https://getcomposer.org/schema.json"
44+
}

phpcs.xml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="EcomDev">
3+
<description>The coding standard for EcomDev packages.</description>
4+
5+
<file>src</file>
6+
<file>tests</file>
7+
<exclude-pattern>tests/fixtures.php</exclude-pattern>
8+
9+
<arg value="np"/>
10+
<arg name="colors"/>
11+
12+
<!-- Include some additional sniffs from the Generic standard -->
13+
<rule ref="Generic.Commenting.DocComment"/>
14+
15+
<!-- Use Unix newlines -->
16+
<rule ref="Generic.Files.LineEndings">
17+
<properties>
18+
<property name="eolChar" value="\n"/>
19+
</properties>
20+
</rule>
21+
22+
<rule ref="PSR2"/>
23+
<rule ref="PSR12"/>
24+
</ruleset>

phpunit.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" colors="true" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="default">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<source>
9+
<include>
10+
<directory>src</directory>
11+
</include>
12+
</source>
13+
<coverage ignoreDeprecatedCodeUnits="true">
14+
</coverage>
15+
</phpunit>

release-please-config.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"packages": {
3+
".": {
4+
"changelog-path": "CHANGELOG.md",
5+
"release-type": "php",
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": false,
8+
"draft": false,
9+
"include-v-in-tag": false,
10+
"prerelease": false
11+
}
12+
},
13+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
14+
}

src/ExportTableFactory.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace EcomDev\MySQL2JSONL;
4+
5+
class ExportTableFactory
6+
{
7+
}

tests/ExportTableTest.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace EcomDev\MySQL2JSONL;
4+
5+
use PHPUnit\Framework\Attributes\Test;
6+
use PHPUnit\Framework\TestCase;
7+
8+
class ExportTableTest extends TestCase
9+
{
10+
#[Test]
11+
public function itworks()
12+
{
13+
$this->assertTrue(true);
14+
}
15+
}

0 commit comments

Comments
 (0)