Skip to content

Commit b31c2a6

Browse files
authored
docs(readme): creating an initial readme (#226)
* docs(readme): creating an initial readme * docs(readme): adding back accidental commit removal * docs(readme): adding a baseline readme * docs(readme): updating formatting
1 parent 881e482 commit b31c2a6

File tree

3 files changed

+97
-1
lines changed

3 files changed

+97
-1
lines changed

Config/secrets.xcconfig.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
POCKET_API_CONSUMER_KEY=test-consumer-key

Pocket.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
16E4B16E27A3212900E01746 /* Response+factories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Response+factories.swift"; sourceTree = "<group>"; };
143143
16EE3F4F26CEC80900249AF4 /* PullToRefreshTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PullToRefreshTests.swift; sourceTree = "<group>"; };
144144
16FCADBE26CB04AC00906C03 /* ArchiveAnItemTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveAnItemTests.swift; sourceTree = "<group>"; };
145+
655C274E28B67ED20040AEAB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
145146
8A289CD52899BD820030E5E0 /* BannerViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerViewTests.swift; sourceTree = "<group>"; };
146147
8A3E3DBB2864DB0500483564 /* EmptyStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyStateTests.swift; sourceTree = "<group>"; };
147148
8A4ECEF8287775F90007DB67 /* SectionHeaderElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionHeaderElement.swift; sourceTree = "<group>"; };
@@ -203,6 +204,7 @@
203204
166A81A32637406B0015AA1D = {
204205
isa = PBXGroup;
205206
children = (
207+
655C274E28B67ED20040AEAB /* README.md */,
206208
166DF27827E9172800C03BF4 /* Pocket (iOS).entitlements */,
207209
1624B85A268508180099B6EF /* PocketKit */,
208210
16BA7D6226851513009A17C1 /* main.swift */,

README.md

+94-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,94 @@
1-
# Pocket iOS
1+
# Pocket iOS
2+
3+
Welcome to the Next iteration of the Pocket iOS client, currently in development.
4+
5+
# Getting Started
6+
7+
## Setup Pocket Secrets File
8+
9+
To develop Pocket for iOS, you need to first obtain a 1st party Pocket consumer key, which is available to internal Pocket & Mozilla Employees.
10+
11+
Once obtained you can run the following command from the root directory:
12+
13+
```
14+
cp Config/secrets.xcconfig.example Config/secrets.xcconfig
15+
```
16+
17+
Then replace values in `Config/secrets.xcconfig` with the values you have received.
18+
19+
## Pocket Graph (API) Schema
20+
21+
Pocket for iOS uses an autogenerated API.swift file that is created by the Apollo CodeGen target.
22+
23+
### Downloading Graph Schema
24+
25+
To download a new version of [`PocketKit/Sources/Sync/schema.graphqls`](./PocketKit/Sources/Sync/schema.graphqls) you can run the following commands:
26+
27+
```bash
28+
cd PocketKit/Sources/ApolloCodegen/
29+
swift run ApolloCodegen download-schema
30+
```
31+
32+
### Generating API.swift
33+
34+
To download a new version of [`PocketKit/Sources/Sync/API.swift`](./PocketKit/Sources/Sync/API.swift) you can run the following commands:
35+
36+
```bash
37+
cd PocketKit/Sources/ApolloCodegen/
38+
swift run ApolloCodegen generate
39+
```
40+
41+
### Future
42+
43+
We plan on implementing the following changes in the future:
44+
45+
- Ensure that the [`PocketKit/Sources/Sync/schema.graphqls`](./PocketKit/Sources/Sync/schema.graphqls) and [`PocketKit/Sources/Sync/API.swift`](./PocketKit/Sources/Sync/API.swift) are generated on demand at build time.
46+
- Blocked by needing [Swift Build Tool support in Apollo](https://github.com/apollographql/apollo-ios/pull/2464)
47+
48+
## Build Targets
49+
50+
### Apollo CodeGen
51+
52+
Apollo CodeGen is a build target setup to download and generate the GraphQL schemas provided by the [Pocket Graph](https://github.com/Pocket/client-api).
53+
54+
How to use it can be seen in [Generating API Schema](#Generating API Schema) above.
55+
56+
### Pocket Kit
57+
58+
Pocket Kit is the foundation of all of Pocket. Pocket is purposefully abstracted into a Kit so that we can define multiple targets in the Apple Ecosystem and still use the same code base. Here you can find the view controllers, app delegates and most entrypoints into the Pocket application.
59+
60+
### Sync
61+
62+
Sync is the main API & Core Data layer that Pocket is built on. This library provides the work needed to communicate with the Pocket API and our Offline storage layer, backed by CoreData.
63+
64+
### Textile
65+
66+
Textile provides the standard views and styles that can be re-used across all of the Pocket targets we create in the Apple Ecosystem.
67+
68+
### Analytics
69+
70+
Analytics provides Pocket's implementation of [Snowplow](https://github.com/snowplow/) which we use to provide a feedback loop to the Pocket product team into how our features are used.
71+
72+
### Save To Pocket Kit
73+
74+
Save to Pocket Kit is the code base needed to make the Pocket Share Extension function and is embeded in the SaveToPocket Extension that enables you to Save to Pocket from other applications.
75+
76+
### Shared Pocket Kit
77+
78+
Shared Pocket Kit contains the main bits for session management and keychain storage that is used across all apps in the Pocket App Group.
79+
80+
## Developing in Pocket
81+
82+
### Commit strategy
83+
84+
We prefer to keep out commit history linear (meaning avoiding noisy merge
85+
commits). To keep your branch up to date, follow these steps:
86+
87+
```bash
88+
# while on your PR branch
89+
git checkout develop
90+
git pull --rebase
91+
git checkout my-pr-branch
92+
git rebase develop
93+
git push origin my-pr-branch --force[-with-lease]
94+
```

0 commit comments

Comments
 (0)