Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Package to CodeEditSourceEditor #223

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ body:
description: >-
click on the version number on the welcome screen
value: |
CodeEditTextView: [e.g. 0.x.y]
CodeEditSourceEditor: [e.g. 0.x.y]
macOS: [e.g. 13.2.1]
Xcode: [e.g. 14.2]

Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/build-docc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export LC_CTYPE=en_US.UTF-8

set -o pipefail && xcodebuild clean docbuild -scheme CodeEditTextView \
set -o pipefail && xcodebuild clean docbuild -scheme CodeEditSourceEditor \
-destination generic/platform=macos \
-skipPackagePluginValidation \
OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path CodeEditTextView --output-path ./docs" | xcpretty
OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path CodeEditSourceEditor --output-path ./docs" | xcpretty
2 changes: 1 addition & 1 deletion .github/scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "Building with arch: ${ARCH}"
export LC_CTYPE=en_US.UTF-8

set -o pipefail && arch -"${ARCH}" xcodebuild \
-scheme CodeEditTextView \
-scheme CodeEditSourceEditor \
-derivedDataPath ".build" \
-destination "platform=macos,arch=${ARCH}" \
-skipPackagePluginValidation \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
uses: ./.github/workflows/swiftlint.yml
secrets: inherit
test:
name: Testing CodeEditTextView
name: Testing CodeEditSourceEditor
needs: swiftlint
uses: ./.github/workflows/tests.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/CI-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
uses: ./.github/workflows/swiftlint.yml
secrets: inherit
test:
name: Testing CodeEditTextView
name: Testing CodeEditSourceEditor
needs: swiftlint
uses: ./.github/workflows/tests.yml
secrets: inherit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
jobs:
code-edit-text-view-tests:
name: Testing CodeEditTextView
name: Testing CodeEditSourceEditor
runs-on: [self-hosted, macOS]
steps:
- name: Checkout repository
Expand Down
13 changes: 11 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
"version" : "0.1.17"
}
},
{
"identity" : "codeedittextview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/CodeEditApp/CodeEditTextView.git",
"state" : {
"revision" : "c867fed329b2b4ce91a13742e20626f50cf233bb",
"version" : "0.7.0"
}
},
{
"identity" : "mainoffender",
"kind" : "remoteSourceControl",
Expand All @@ -32,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version" : "1.0.4"
"revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307",
"version" : "1.0.5"
}
},
{
Expand Down
58 changes: 12 additions & 46 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
import PackageDescription

let package = Package(
name: "CodeEditTextView",
name: "CodeEditSourceEditor",
platforms: [.macOS(.v13)],
products: [
// A source editor with useful features for code editing.
.library(
name: "CodeEditTextView",
targets: ["CodeEditTextView"]
),
// A Fast, Efficient text view for code.
.library(
name: "CodeEditInputView",
targets: ["CodeEditInputView"]
name: "CodeEditSourceEditor",
targets: ["CodeEditSourceEditor"]
)
],
dependencies: [
// A fast, efficient, text view for code.
.package(
url: "https://github.com/CodeEditApp/CodeEditTextView.git",
from: "0.7.0"
),
// tree-sitter languages
.package(
url: "https://github.com/CodeEditApp/CodeEditLanguages.git",
Expand All @@ -29,28 +29,18 @@ let package = Package(
url: "https://github.com/lukepistrol/SwiftLintPlugin",
from: "0.2.2"
),
// Text mutation, storage helpers
.package(
url: "https://github.com/ChimeHQ/TextStory",
from: "0.8.0"
),
// Rules for indentation, pair completion, whitespace
.package(
url: "https://github.com/ChimeHQ/TextFormation",
from: "0.8.1"
),
// Useful data structures
.package(
url: "https://github.com/apple/swift-collections.git",
.upToNextMajor(from: "1.0.0")
)
],
targets: [
// A source editor with useful features for code editing.
.target(
name: "CodeEditTextView",
name: "CodeEditSourceEditor",
dependencies: [
"CodeEditInputView",
"CodeEditTextView",
"CodeEditLanguages",
"TextFormation",
],
Expand All @@ -59,40 +49,16 @@ let package = Package(
]
),

// The underlying text rendering view for CodeEditTextView
.target(
name: "CodeEditInputView",
dependencies: [
"TextStory",
"TextFormation",
.product(name: "Collections", package: "swift-collections")
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin")
]
),

// Tests for the source editor
.testTarget(
name: "CodeEditTextViewTests",
name: "CodeEditSourceEditorTests",
dependencies: [
"CodeEditTextView",
"CodeEditSourceEditor",
"CodeEditLanguages",
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin")
]
),

// Tests for the input view
.testTarget(
name: "CodeEditInputViewTests",
dependencies: [
"CodeEditInputView",
],
plugins: [
.plugin(name: "SwiftLint", package: "SwiftLintPlugin")
]
),
]
)
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<p align="center">
<img src="https://github.com/CodeEditApp/CodeEditTextView/assets/806104/b304b004-3bfc-413b-9db6-76d2af122acc" height="128">
<h1 align="center">CodeEditTextView</h1>
<img src="https://github.com/CodeEditApp/CodeEditTextView/blob/main/.github/CodeEditSourceEditor-Icon-128@2x.png?raw=true" height="128">
<h1 align="center">CodeEditSourceEditor</h1>
</p>


<p align="center">
<a aria-label="Follow CodeEdit on Twitter" href="https://twitter.com/CodeEditApp" target="_blank">
<img alt="" src="https://img.shields.io/badge/Follow%20@CodeEditApp-black.svg?style=for-the-badge&logo=Twitter">
</a>
<a aria-label="Join the community on Discord" href="https://discord.gg/vChUXVf9Em" target="_blank">
<img alt="" src="https://img.shields.io/badge/Join%20the%20community-black.svg?style=for-the-badge&logo=Discord">
</a>
<a aria-label="Read the Documentation" href="https://codeeditapp.github.io/CodeEditTextView/documentation/codeedittextview/" target="_blank">
<a aria-label="Read the Documentation" href="https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor/" target="_blank">
<img alt="" src="https://img.shields.io/badge/Documentation-black.svg?style=for-the-badge&logo=readthedocs&logoColor=blue">
</a>
</p>
Expand All @@ -19,24 +20,24 @@ An Xcode-inspired code editor view written in Swift powered by tree-sitter for [

<img width="1012" alt="social-cover-textview" src="https://user-images.githubusercontent.com/806104/194083584-91555dce-ad4c-4066-922e-1eab889134be.png">

![GitHub release](https://img.shields.io/github/v/release/CodeEditApp/CodeEditTextView?color=orange&label=latest%20release&sort=semver&style=flat-square)
![Github Tests](https://img.shields.io/github/actions/workflow/status/CodeEditApp/CodeEditTextView/tests.yml?branch=main&label=tests&style=flat-square)
![Documentation](https://img.shields.io/github/actions/workflow/status/CodeEditApp/CodeEditTextView/build-documentation.yml?branch=main&label=docs&style=flat-square)
![GitHub Repo stars](https://img.shields.io/github/stars/CodeEditApp/CodeEditTextView?style=flat-square)
![GitHub forks](https://img.shields.io/github/forks/CodeEditApp/CodeEditTextView?style=flat-square)
![GitHub release](https://img.shields.io/github/v/release/CodeEditApp/CodeEditSourceEditor?color=orange&label=latest%20release&sort=semver&style=flat-square)
![Github Tests](https://img.shields.io/github/actions/workflow/status/CodeEditApp/CodeEditSourceEditor/tests.yml?branch=main&label=tests&style=flat-square)
![Documentation](https://img.shields.io/github/actions/workflow/status/CodeEditApp/CodeEditSourceEditor/build-documentation.yml?branch=main&label=docs&style=flat-square)
![GitHub Repo stars](https://img.shields.io/github/stars/CodeEditApp/CodeEditSourceEditor?style=flat-square)
![GitHub forks](https://img.shields.io/github/forks/CodeEditApp/CodeEditSourceEditor?style=flat-square)
[![Discord Badge](https://img.shields.io/discord/951544472238444645?color=5865F2&label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/vChUXVf9Em)

| :warning: | **CodeEditTextView is currently in development and it is not ready for production use.** <br> Please check back later for updates on this project. Contributors are welcome as we build out the features mentioned above! |
| :warning: | **CodeEditSourceEditor is currently in development and it is not ready for production use.** <br> Please check back later for updates on this project. Contributors are welcome as we build out the features mentioned above! |
| - |:-|

## Documentation

This package is fully documented [here](https://codeeditapp.github.io/CodeEditTextView/documentation/codeedittextview/).
This package is fully documented [here](https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor/).

## Usage

```swift
import CodeEditTextView
import CodeEditSourceEditor

struct ContentView: View {

Expand All @@ -48,7 +49,7 @@ struct ContentView: View {
@State var editorOverscroll = 0.3

var body: some View {
CodeEditTextView(
CodeEditSourceEditor(
$text,
language: .swift,
theme: $theme,
Expand Down Expand Up @@ -87,6 +88,12 @@ Licensed under the [MIT license](https://github.com/CodeEditApp/CodeEdit/blob/ma
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CodeEdit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
</a>
</td>
<td align="center">
<a href="https://github.com/CodeEditApp/CodeEditTextView">
<img src="https://github.com/CodeEditApp/CodeEditTextView/blob/main/.github/CodeEditTextView-Icon-128@2x.png?raw=true" height="128">
</a>
<p><a href="https://github.com/CodeEditApp/CodeEditTextView">CodeEditTextView</a></p>
</td>
<td align="center">
<a href="https://github.com/CodeEditApp/CodeEditKit">
<img src="https://user-images.githubusercontent.com/806104/193877051-c60d255d-0b6a-408c-bb21-6fabc5e0e60c.png" height="128">
Expand All @@ -107,4 +114,3 @@ Licensed under the [MIT license](https://github.com/CodeEditApp/CodeEdit/blob/ma
</td>
</tr>
</table>

37 changes: 0 additions & 37 deletions Sources/CodeEditInputView/Documentation.docc/Documentation.md

This file was deleted.

14 changes: 0 additions & 14 deletions Sources/CodeEditInputView/Extensions/NSRange+isEmpty.swift

This file was deleted.

28 changes: 0 additions & 28 deletions Sources/CodeEditInputView/Extensions/NSTextStorage+getLine.swift

This file was deleted.

22 changes: 0 additions & 22 deletions Sources/CodeEditInputView/Extensions/PixelAligned.swift

This file was deleted.

Loading