Skip to content

Commit

Permalink
Merge pull request #35 from k-kohey/fix/module_name
Browse files Browse the repository at this point in the history
Fix module name
  • Loading branch information
k-kohey authored Jun 3, 2023
2 parents e0c7d04 + 08d56a7 commit 5d888b0
Show file tree
Hide file tree
Showing 36 changed files with 68 additions and 67 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ name: docc

on:
push:
branches: [ "main" ]
branches: ["main"]

jobs:
deploy:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: make directory docs/
- name: make directory docs/
run: |
mkdir -p docs/ParchmentCore
mkdir -p docs/Parchment
mkdir -p docs/ParchmentDefault
- name: run generate-documentation for ParchmentCore
run: swift package --allow-writing-to-directory docs/ParchmentCore
generate-documentation --target ParchmentCore
--disable-indexing
--transform-for-static-hosting
--hosting-base-path Parchment-swift/ParchmentCore
--output-path docs/ParchmentCore
- name: run generate-documentation for Parchment
run: swift package --allow-writing-to-directory docs/Parchment
generate-documentation --target Parchment
--disable-indexing
--transform-for-static-hosting
--hosting-base-path Parchment-swift/Parchment
--output-path docs/Parchment
- name: run generate-documentation for ParchmentDefault
run: swift package --allow-writing-to-directory docs/ParchmentDefault
generate-documentation --target ParchmentDefault
--disable-indexing
--transform-for-static-hosting
--hosting-base-path Parchment-swift/ParchmentDefault
--output-path docs/ParchmentDefault
- name: deploy to github pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
14 changes: 14 additions & 0 deletions Demo.swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "sqlite.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stephencelis/SQLite.swift.git",
"state" : {
"revision" : "7a2e3cd27de56f6d396e84f63beefd0267b55ccb",
"version" : "0.14.1"
}
}
],
"version" : 2
}
1 change: 0 additions & 1 deletion Demo.swiftpm/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ let package = Package(
name: "AppModule",
dependencies: [
.product(name: "Parchment", package: "Parchment"),
.product(name: "ParchmentDefault", package: "Parchment"),
]
)
]
Expand Down
1 change: 0 additions & 1 deletion Demo.swiftpm/Sources/AppModule/Demo.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import SwiftUI
import Parchment
import ParchmentDefault

extension LoggerComponentID {
static let my: Self = .init("My")
Expand Down
2 changes: 1 addition & 1 deletion EventGen/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
name: "EventGenKit",
dependencies: [
.product(name: "Markdown", package: "swift-markdown"),
.product(name: "Parchment", package: "Parchment"),
.product(name: "ParchmentCore", package: "Parchment"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax")
]
),
Expand Down
4 changes: 2 additions & 2 deletions EventGen/Sources/EventGenKit/SwiftGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import Parchment
import ParchmentCore
import SwiftSyntax
import SwiftSyntaxBuilder

Expand Down Expand Up @@ -55,7 +55,7 @@ public struct SwiftGenerator {

private func generate(with definisions: [EventDefinision]) -> String {
SourceFileSyntax {
ImportDeclSyntax(path: [.init(name: "Parchment")])
ImportDeclSyntax(path: [.init(name: "ParchmentCore")])
generatedEventStructDecl
extensionDecl(with: definisions)
}.formatted().description
Expand Down
2 changes: 1 addition & 1 deletion EventGen/Tests/EventGenKitTests/SwiftGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class SwiftGeneratorTests: XCTestCase {
let result = try generator.run(with: def)

let expected = """
import Parchment
import ParchmentCore
struct GeneratedEvent: Loggable {
let eventName: String
let parameters: [String: Sendable]
Expand Down
24 changes: 12 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ let package = Package(
platforms: [.iOS(.v14), .macOS(.v11)],
products: [
.library(
name: "Parchment",
targets: ["Parchment"]
name: "ParchmentCore",
targets: ["ParchmentCore"]
),
.library(
name: "ParchmentDefault",
targets: ["ParchmentDefault"]
name: "Parchment",
targets: ["Parchment"]
),
],
dependencies: [
Expand All @@ -22,17 +22,17 @@ let package = Package(
],
targets: [
.target(
name: "Parchment",
name: "ParchmentCore",
swiftSettings: [
.unsafeFlags([
"-strict-concurrency=complete"
])
]
),
.target(
name: "ParchmentDefault",
name: "Parchment",
dependencies: [
.target(name: "Parchment"),
.target(name: "ParchmentCore"),
.product(name: "SQLite", package: "SQLite.swift")
],
swiftSettings: [
Expand All @@ -42,16 +42,16 @@ let package = Package(
]
),
.testTarget(
name: "ParchmentTests",
dependencies: ["Parchment", "TestSupport"]
name: "ParchmentCoreTests",
dependencies: ["ParchmentCore", "TestSupport"]
),
.testTarget(
name: "ParchmentDefaultTests",
dependencies: ["ParchmentDefault", "TestSupport"]
name: "ParchmentTests",
dependencies: ["Parchment", "TestSupport"]
),
.target(
name: "TestSupport",
dependencies: ["Parchment"]
dependencies: ["ParchmentCore"]
),
]
)
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ If you are using the Swift Package Project, you can add a dependency for this Pa

```swift
dependencies: [
.product(name: "Parchment", package: "Parchment"),
.product(name: "ParchmentCore", package: "Parchment"),
// The following statements are optional
.product(name: "ParchmentDefault", package: "Parchment"),
.product(name: "Parchment", package: "Parchment"),
]
```

## Project Overview

### Parchment
### ParchmentCore

It contains the main logic and definitions for logging processing and event logging definitions.

### ParchmentDefault
### Parchment

Provides a stander implementation compliant with the Protocol provided by Parchment. If you implement your own buffer and scheduler, you do not need to add any dependencies.
Provides a stander implementation compliant with the Protocol provided by ParchmentCore. If you implement your own buffer and scheduler, you do not need to add any dependencies.

See the [Customization](#customization) section for more details.

Expand Down Expand Up @@ -142,8 +142,8 @@ await logger.send([\.eventName: "tapButton", \.parameters: ["ButtonID": 1]])

Please see the API documentation below(WIP).

- https://k-kohey.github.io/Parchment-swift/Parchment/documentation/parchment/
- https://k-kohey.github.io/Parchment-swift/ParchmentDefault/documentation/parchmentdefault/
- https://k-kohey.github.io/Parchment-swift/ParchmentCore/documentation/parchmentcore/
- https://k-kohey.github.io/Parchment-swift/Parchment/documentation/Parchment/

## Customization

Expand All @@ -159,7 +159,7 @@ To create the type and set it to logger, write as follows.

```swift

// An implementation similar to this can be found in ParchmentDefault
// An implementation similar to this can be found in Parchment

struct DeviceDataMutation: Mutation {
private let deviceParams = [
Expand Down Expand Up @@ -207,7 +207,7 @@ To create the type and set it to logger, write as follows.

```swift

// An implementation similar to this can be found in ParchmentDefault
// An implementation similar to this can be found in Parchment
final class RegularlyPollingScheduler: BufferedEventFlushScheduler {
public static let `default` = RegularlyPollingScheduler(timeInterval: 60)

Expand Down Expand Up @@ -270,6 +270,6 @@ let logger = LoggerBundler(

TrackingEventBuffer is a buffer that saves the log.

ParchmentDefault defines a class SQLiteBuffer that uses SQLite to store logs.
Parchment defines a class SQLiteBuffer that uses SQLite to store logs.

This implementation can be replaced by a class that is compatible with TrackingEventBuffer.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import Foundation
import Parchment

public final class DefaultBufferFlowController: BufferFlowController, Sendable {
let pollingInterval: UInt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#if canImport(UIKit)

import Parchment
import UIKit

public struct DeviceDataMutation: Mutation {
Expand Down
8 changes: 8 additions & 0 deletions Sources/Parchment/Export.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Export.swift
//
//
// Created by Kohei Kawaguchi on 2023/06/03.
//

@_exported import ParchmentCore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by k-kohey on 2021/12/29.
//

import Parchment

private let standardInstance = LoggerBundler.make(components: [])

public extension LoggerBundler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by k-kohey on 2021/10/27.
//

@_spi(Parchment) import Parchment
@_spi(ParchmentCore) import ParchmentCore
import SQLite
import Foundation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Kohei Kawaguchi on 2023/05/17.
//

import Parchment

/// Logs changes to a value.
///
/// Mark the properties for which you wish to log changes as follows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import Parchment

public struct ImpletionEvent: Loggable {
public var eventName = "ImpletionEvent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public struct AnyLoggable: Loggable {
/// Recursively searches for the instance `base` used to initialize this type and checks
/// for the existence of an instance of the type passed as an argument.
///
/// This is useful for checking for lost type information, since type information is lost in conversions using `Parchment.Mutation`.
/// This is useful for checking for lost type information, since type information is lost in conversions using `ParchmentCore.Mutation`.
@AnyLoggableActor
public func isBased<T: Loggable>(_ type: T.Type) -> Bool {
if findCache[id]?["\(T.self)"] == true {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
import Foundation

@_spi(Parchment) public let osLogger = Logger(subsystem: "com.k-kohey.parchment", category: "parchment")
@_spi(ParchmentCore) public let osLogger = Logger(subsystem: "com.k-kohey.parchment", category: "parchment")

public extension LoggerComponentID {
static var debug: LoggerComponentID {
Expand Down
8 changes: 0 additions & 8 deletions Sources/ParchmentDefault/osLogger.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Sources/TestSupport/Stub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kohei Kawaguchi on 2023/05/17.
//

import Parchment
import ParchmentCore

private extension LoggerComponentID {
static let a = LoggerComponentID("A")
Expand Down Expand Up @@ -39,7 +39,7 @@ public final class EventQueueMock: LogBuffer, @unchecked Sendable {
records += e
}

public func dequeue(limit: Int?) async throws -> [Parchment.Payload] {
public func dequeue(limit: Int?) async throws -> [ParchmentCore.Payload] {
let count: Int
if let limit {
count = limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kohei Kawaguchi on 2023/05/23.
//

@testable import Parchment
@testable import ParchmentCore
import XCTest

private struct HogeEvent: Loggable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import XCTest
@testable import Parchment
@testable import ParchmentCore

class BufferRecordTests: XCTestCase {
func testEcode() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by k-kohey on 2021/11/22.
//

@testable import Parchment
@testable import ParchmentCore
@testable import TestSupport
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kohei Kawaguchi on 2023/05/18.
//

@testable import Parchment
@testable import ParchmentCore
import XCTest

private struct MutationMock: Mutation, @unchecked Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import Foundation
@testable import Parchment
@testable import ParchmentDefault
import XCTest

final class EventQueueMock: LogBuffer, @unchecked Sendable {
Expand All @@ -17,7 +16,7 @@ final class EventQueueMock: LogBuffer, @unchecked Sendable {
records += e
}

func dequeue(limit: Int?) async throws -> [Parchment.Payload] {
func dequeue(limit: Int?) async throws -> [Payload] {
let count: Int
if let limit {
count = limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

@testable import Parchment
@testable import ParchmentDefault
import XCTest

private enum Event: Loggable {
Expand Down
Loading

0 comments on commit 5d888b0

Please sign in to comment.