Skip to content
Open
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
40 changes: 40 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[default]
# Ignore patterns that match commit hashes and Git-related identifiers
extend-ignore-re = [
# Git commit hashes in parentheses: (7553ede), (88d0ded), etc.
"\\([a-f0-9]{7,40}\\)",
# Git commit hashes in square brackets: [7553ede], [88d0ded], etc.
"\\[[a-f0-9]{7,40}\\]",
# Full GitHub commit URLs
"github\\.com/[^/]+/[^/]+/commit/[a-f0-9]{7,40}",
# Commit hash at end of markdown links: ...commit/abcd123)
"commit/[a-f0-9]{7,40}\\)",
]

[files]
extend-exclude = [
# Exclude lock files
"package-lock.json",
"yarn.lock",
"pnpm-lock.yaml",
# Exclude build artifacts
"dist/",
"build/",
"*.min.js",
# Exclude node_modules
"node_modules/",
# Exclude Xcode project files that contain hex identifiers - these files have
# automatically generated hex IDs that look like typos but must not be changed
"**/project.pbxproj",
"**/*.xcscheme",
"**/*.storyboard",
# Exclude all CHANGELOG files - they contain commit hashes and historical text
# that should not be modified by typo fixes
"CHANGELOG.md",
"*/CHANGELOG.md",
]

[default.extend-words]
# Add any custom words that should not be corrected
# Format: incorrectword = "incorrectword"
thn = "thn"
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ public void handleDestroy() {

@Deprecated
@Override
public void sendJavascript(String statememt) {
nativeToJsMessageQueue.addJavaScript(statememt);
public void sendJavascript(String statement) {
nativeToJsMessageQueue.addJavaScript(statement);
}

public void eval(final String js, final ValueCallback<String> callback) {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/android/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ export async function installGradlePlugins(

const settingsPath = config.android.platformDirAbs;
const dependencyPath = config.android.appDirAbs;
const relativeCapcitorAndroidPath = convertToUnixPath(relative(settingsPath, capacitorAndroidPath));
const relativeCapacitorAndroidPath = convertToUnixPath(relative(settingsPath, capacitorAndroidPath));
const settingsLines = `// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('${relativeCapcitorAndroidPath}')
project(':capacitor-android').projectDir = new File('${relativeCapacitorAndroidPath}')
${capacitorPlugins
.map((p) => {
if (!p.android) {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export interface CapacitorConfig {
* Configure the local scheme on Android.
*
* Custom schemes on Android are unable to change the URL path as of Webview 117. Changing this value from anything other than `http` or `https` can result in your
* application unable to resolve routing. If you must change this for some reason, consider using a hash-based url strategy, but there are no guarentees that this
* application unable to resolve routing. If you must change this for some reason, consider using a hash-based url strategy, but there are no guarantees that this
* will continue to work long term as allowing non-standard schemes to modify query parameters and url fragments is only allowed for compatibility reasons.
* https://ionic.io/blog/capacitor-android-customscheme-issue-with-chrome-117
*
Expand Down
2 changes: 1 addition & 1 deletion cli/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export interface FrameworkConfig {
/**
* Specific UI libraries (Ionic) and higher-level frameworks (NextJs/Gatsby)
* should be prioritorized over a more generic framework like React/Angular/Vue.
* Lower the priorty number the more important it is (1 has more priority over 2).
* Lower the priority number the more important it is (1 has more priority over 2).
* This helps to make sure a specific framework like "NextJs" is chosen before
* the more generic "React".
*/
Expand Down
2 changes: 1 addition & 1 deletion cli/src/ios/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function doctorIOS(config: Config): Promise<void> {
// check plugins versions
// check native project deps are up-to-date === npm install
// check if npm install was updated
// check online datebase of common errors
// check online database of common errors
// check if www folder is empty (index.html does not exist)
try {
await check([() => checkBundler(config) || checkCocoaPods(config), () => checkWebDir(config), checkXcode]);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/sysconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface SystemConfig {
readonly telemetry?: boolean;

/**
* Wheter the user choose to signup or not.
* Whether the user choose to signup or not.
*
* If undefined, the prompt has not been shown.
*/
Expand Down
8 changes: 4 additions & 4 deletions cli/src/tasks/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ async function getAndroidVariablesAndClasspaths(config: Config) {
}
deleteFolderRecursive(tempAndroidTemplateFolder);

const firstIndxOfCATBGV = buildGradleFile.indexOf(`classpath 'com.android.tools.build:gradle:`) + 42;
const firstIndxOfCGGGS = buildGradleFile.indexOf(`com.google.gms:google-services:`) + 31;
const firstIndexOfCATBGV = buildGradleFile.indexOf(`classpath 'com.android.tools.build:gradle:`) + 42;
const firstIndexOfCGGGS = buildGradleFile.indexOf(`com.google.gms:google-services:`) + 31;
const comAndroidToolsBuildGradleVersion =
'' + buildGradleFile.substring(firstIndxOfCATBGV, buildGradleFile.indexOf("'", firstIndxOfCATBGV));
'' + buildGradleFile.substring(firstIndexOfCATBGV, buildGradleFile.indexOf("'", firstIndexOfCATBGV));
const comGoogleGmsGoogleServices =
'' + buildGradleFile.substring(firstIndxOfCGGGS, buildGradleFile.indexOf("'", firstIndxOfCGGGS));
'' + buildGradleFile.substring(firstIndexOfCGGGS, buildGradleFile.indexOf("'", firstIndexOfCGGGS));

const variablesGradleAsJSON = JSON.parse(
variablesGradleFile
Expand Down
2 changes: 1 addition & 1 deletion cli/src/util/emoji.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Emoji falback, right now just uses fallback on windows,
// Emoji fallback, right now just uses fallback on windows,
// but could expand to be more sophisticated to allow emoji
// on Hyper term on windows, for example.
export const emoji = (x: string, fallback: string): string => {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/util/spm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function checkPluginsForPackageSwift(config: Config, plugins: Plugi
logger.debug(`Found ${plugins.length} iOS plugins, ${packageSwiftPluginList.length} have a Package.swift file`);
logger.info('All plugins have a Package.swift file and will be included in Package.swift');
} else {
logger.warn('Some installed packages are not compatable with SPM');
logger.warn('Some installed packages are not compatible with SPM');
}

return packageSwiftPluginList;
Expand Down
2 changes: 1 addition & 1 deletion core/cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@
}

capacitorExec.nativeFetchMessages = function () {
// Stop listing for window detatch once native side confirms poke.
// Stop listing for window detach once native side confirms poke.
if (failSafeTimerId) {
clearTimeout(failSafeTimerId);
failSafeTimerId = 0;
Expand Down
2 changes: 1 addition & 1 deletion core/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Make a Http DELETE Request to a server using native libraries.
| **`data`** | <code>any</code> | Additional data received with the Http response. |
| **`status`** | <code>number</code> | The status code received from the Http response. |
| **`headers`** | <code><a href="#httpheaders">HttpHeaders</a></code> | The headers received from the Http response. |
| **`url`** | <code>string</code> | The response URL recieved from the Http response. |
| **`url`** | <code>string</code> | The response URL received from the Http response. |


#### HttpHeaders
Expand Down
2 changes: 1 addition & 1 deletion core/src/core-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export interface HttpResponse {
*/
headers: HttpHeaders;
/**
* The response URL recieved from the Http response.
* The response URL received from the Http response.
*/
url: string;
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPBridgeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ extension CAPBridgeViewController {
aWebView.scrollView.contentInsetAdjustmentBehavior = configuration.contentInsetAdjustmentBehavior
aWebView.allowsLinkPreview = configuration.allowLinkPreviews
aWebView.scrollView.isScrollEnabled = configuration.scrollingEnabled
if let overrideUserAgent = configuration.overridenUserAgentString {
if let overrideUserAgent = configuration.overriddenUserAgentString {
aWebView.customUserAgent = overrideUserAgent
}
if let backgroundColor = configuration.backgroundColor {
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPInstanceConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
NS_SWIFT_NAME(InstanceConfiguration)
@interface CAPInstanceConfiguration: NSObject
@property (nonatomic, readonly, nullable) NSString *appendedUserAgentString;
@property (nonatomic, readonly, nullable) NSString *overridenUserAgentString;
@property (nonatomic, readonly, nullable) NSString *overriddenUserAgentString;
@property (nonatomic, readonly, nullable) UIColor *backgroundColor;
@property (nonatomic, readonly, nonnull) NSArray<NSString*> *allowedNavigationHostnames;
@property (nonatomic, readonly, nonnull) NSURL *localURL;
Expand Down
4 changes: 2 additions & 2 deletions ios/Capacitor/Capacitor/CAPInstanceConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ - (instancetype)initWithDescriptor:(CAPInstanceDescriptor *)descriptor isDebug:(
[descriptor normalize];
// now copy the simple properties
_appendedUserAgentString = descriptor.appendedUserAgentString;
_overridenUserAgentString = descriptor.overridenUserAgentString;
_overriddenUserAgentString = descriptor.overriddenUserAgentString;
_backgroundColor = descriptor.backgroundColor;
_allowedNavigationHostnames = descriptor.allowedNavigationHostnames;
switch (descriptor.loggingBehavior) {
Expand Down Expand Up @@ -59,7 +59,7 @@ - (instancetype)initWithDescriptor:(CAPInstanceDescriptor *)descriptor isDebug:(
- (instancetype)initWithConfiguration:(CAPInstanceConfiguration*)configuration andLocation:(NSURL*)location {
if (self = [super init]) {
_appendedUserAgentString = [[configuration appendedUserAgentString] copy];
_overridenUserAgentString = [[configuration overridenUserAgentString] copy];
_overriddenUserAgentString = [[configuration overriddenUserAgentString] copy];
_backgroundColor = configuration.backgroundColor;
_allowedNavigationHostnames = [[configuration allowedNavigationHostnames] copy];
_localURL = [[configuration localURL] copy];
Expand Down
8 changes: 4 additions & 4 deletions ios/Capacitor/Capacitor/CAPInstanceDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ extern NSString * _Nonnull const CAPInstanceDescriptorDefaultHostname NS_SWIFT_U
NS_SWIFT_NAME(InstanceDescriptor)
@interface CAPInstanceDescriptor : NSObject
/**
@brief A value to append to the @c User-Agent string. Ignored if @c overridenUserAgentString is set.
@brief A value to append to the @c User-Agent string. Ignored if @c overriddenUserAgentString is set.
@discussion Set by @c appendUserAgent in the configuration file.
*/
@property (nonatomic, copy, nullable) NSString *appendedUserAgentString;
/**
@brief A value that will completely replace the @c User-Agent string. Overrides @c appendedUserAgentString.
@discussion Set by @c overrideUserAgent in the configuration file.
*/
@property (nonatomic, copy, nullable) NSString *overridenUserAgentString;
@property (nonatomic, copy, nullable) NSString *overriddenUserAgentString;
/**
@brief The background color to set on the web view where content is not visible.
@discussion Set by @c backgroundColor in the configuration file.
Expand Down Expand Up @@ -120,7 +120,7 @@ NS_SWIFT_NAME(InstanceDescriptor)
*/
@property (nonatomic, copy, nonnull) NSURL *appLocation;
/**
@brief The path (relative to @c appLocation) which Capacitor will use for the inital URL at launch.
@brief The path (relative to @c appLocation) which Capacitor will use for the initial URL at launch.
@discussion Defaults to nil, in which case Capacitor will attempt to load @c index.html.
*/
@property (nonatomic, copy, nullable) NSString *appStartPath;
Expand All @@ -135,7 +135,7 @@ NS_SWIFT_NAME(InstanceDescriptor)
*/
@property (nonatomic, copy, nullable) NSString *preferredContentMode;
/**
@brief The parser used to load the cofiguration for Cordova plugins.
@brief The parser used to load the configuration for Cordova plugins.
*/
@property (nonatomic, copy, nonnull) CDVConfigParser *cordovaConfiguration;
/**
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPInstanceDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ internal extension InstanceDescriptor {
appendedUserAgentString = agentString
}
if let agentString = (config[keyPath: "ios.overrideUserAgent"] as? String) ?? (config[keyPath: "overrideUserAgent"] as? String) {
overridenUserAgentString = agentString
overriddenUserAgentString = agentString
}
if let colorString = (config[keyPath: "ios.backgroundColor"] as? String) ?? (config[keyPath: "backgroundColor"] as? String),
let color = UIColor.capacitor.color(fromHex: colorString) {
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPNotifications.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Notificaton types for NotificationCenter and NSNotificationCenter
Notification types for NotificationCenter and NSNotificationCenter

We want to include `capacitor` in the name(s) to uniquely identify these even though it can make the names long
and the deprecated notifications are only here for backwards compatibility.
Expand Down
4 changes: 2 additions & 2 deletions ios/Capacitor/Capacitor/Codable/JSValueDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public final class JSValueDecoder: TopLevelDecoder {
/// The strategies available for decoding raw data.
public typealias DataDecodingStrategy = JSONDecoder.DataDecodingStrategy

/// The strategies availble for decoding NaN, Infinity, and -Infinity
/// The strategies available for decoding NaN, Infinity, and -Infinity
public enum NonConformingFloatDecodingStrategy {
/// Decodes directly into the floating point type as .infinity, -.infinity, or .nan
case deferred
Expand Down Expand Up @@ -127,7 +127,7 @@ extension _JSValueDecoder: Decoder {
SingleValueContainer(data: data, codingPath: codingPath, userInfo: userInfo, options: options)
}

// force casting is fine becasue we've already determined that T is the type in the case
// force casting is fine because we've already determined that T is the type in the case
// the swift standard library also force casts in their similar functions
// https://github.com/swiftlang/swift-foundation/blob/da80d51fa3e77f3e7ed57c4300a870689e755713/Sources/FoundationEssentials/JSON/JSONEncoder.swift#L1140
// swiftlint:disable force_cast
Expand Down
6 changes: 3 additions & 3 deletions ios/Capacitor/Capacitor/Codable/JSValueEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ public final class JSValueEncoder: TopLevelEncoder {
/// - Parameter optionalEncodingStrategy: The strategy to use when encoding `nil` values. Defaults to ``OptionalEncodingStrategy-swift.enum/undefined``
/// - Parameter dateEncodingStrategy: Defaults to `DateEncodingStrategy.deferredToDate`
/// - Parameter dataEncodingStrategy: Defaults to `DataEncodingStrategy.deferredToData`
/// - Parameter nonConformingFloatEncodingStategy: Defaults to ``NonConformingFloatEncodingStrategy-swift.enum/deferred``
/// - Parameter nonConformingFloatEncodingStrategy: Defaults to ``NonConformingFloatEncodingStrategy-swift.enum/deferred``
public init(
optionalEncodingStrategy: OptionalEncodingStrategy = .undefined,
dateEncodingStrategy: DateEncodingStrategy = .deferredToDate,
dataEncodingStrategy: DataEncodingStrategy = .deferredToData,
nonConformingFloatEncodingStategy: NonConformingFloatEncodingStrategy = .deferred
nonConformingFloatEncodingStrategy: NonConformingFloatEncodingStrategy = .deferred
) {
self.options = .init(
optionalStrategy: optionalEncodingStrategy,
dateStrategy: dateEncodingStrategy,
dataStrategy: dataEncodingStrategy,
nonConformingFloatStrategy: nonConformingFloatEncodingStategy
nonConformingFloatStrategy: nonConformingFloatEncodingStrategy
)
}

Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/Plugins/HttpRequestHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ open class HttpRequestHandler {
.openConnection()
.build()

if let userAgentString = config?.overridenUserAgentString, headers["User-Agent"] == nil, headers["user-agent"] == nil {
if let userAgentString = config?.overriddenUserAgentString, headers["User-Agent"] == nil, headers["user-agent"] == nil {
headers["User-Agent"] = userAgentString
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ + (void)load {
dispatch_once(&onceToken, ^{
Class class = [self class];
SEL originalSelector = NSSelectorFromString(@"handleTapAction:");
SEL swizzledSelector = @selector(nofity_handleTapAction:);
SEL swizzledSelector = @selector(notify_handleTapAction:);

Method originalMethod = class_getInstanceMethod(class, originalSelector);
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
Expand All @@ -29,9 +29,9 @@ + (void)load {
});
}

-(void)nofity_handleTapAction:(id)arg1 {
-(void)notify_handleTapAction:(id)arg1 {
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:NSNotification.capacitorStatusBarTapped object:nil]];
[self nofity_handleTapAction:arg1];
[self notify_handleTapAction:arg1];
}

@end
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/WebViewDelegationHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ open class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDelegat
}

open func willLoadWebview(_ webView: WKWebView?) {
// Set the webview to be not opaque on the inital load. This prevents
// Set the webview to be not opaque on the initial load. This prevents
// the webview from showing a white background, which is its default
// loading display, as that can appear as a screen flash. The opacity
// might have been set by something else, like a plugin, so we want
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/CapacitorTests/BridgedTypesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class BridgedTypesTests: XCTestCase {
override class func setUp() {
let formatter = ISO8601DateFormatter()
// an ISO 8601 string does not necessarily include subsecond precision, so we can't just capture the current date
// or else we won't be able to compare the objects since they could differ by milliseconds or nanoseonds. so instead
// or else we won't be able to compare the objects since they could differ by milliseconds or nanoseconds. so instead
// we use a fixed timestamp at a whole hour.
let date = NSDate(timeIntervalSinceReferenceDate: 632854800)
let subDictionary: [AnyHashable: Any] = ["testIntArray": [0, 1, 2], "testStringArray": ["1", "2", "3"], "testDictionary":["foo":"bar"]]
Expand Down
4 changes: 2 additions & 2 deletions ios/Capacitor/CapacitorTests/ConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ConfigurationTests: XCTestCase {
let url = Bundle.main.url(forResource: "configurations", withExtension: "")!
let descriptor = InstanceDescriptor.init(at: url, configuration: ConfigurationTests.files[.flat], cordovaConfiguration: nil)
XCTAssertEqual(descriptor.backgroundColor, UIColor(red: 1, green: 1, blue: 1, alpha: 1))
XCTAssertEqual(descriptor.overridenUserAgentString, "level 1 override")
XCTAssertEqual(descriptor.overriddenUserAgentString, "level 1 override")
XCTAssertEqual(descriptor.appendedUserAgentString, "level 1 append")
XCTAssertEqual(descriptor.loggingBehavior, .debug)
}
Expand All @@ -90,7 +90,7 @@ class ConfigurationTests: XCTestCase {
let url = Bundle.main.url(forResource: "configurations", withExtension: "")!
let descriptor = InstanceDescriptor.init(at: url, configuration: ConfigurationTests.files[.nested], cordovaConfiguration: nil)
XCTAssertEqual(descriptor.backgroundColor, UIColor(red: 0, green: 0, blue: 0, alpha: 1))
XCTAssertEqual(descriptor.overridenUserAgentString, "level 2 override")
XCTAssertEqual(descriptor.overriddenUserAgentString, "level 2 override")
XCTAssertEqual(descriptor.appendedUserAgentString, "level 2 append")
XCTAssertEqual(descriptor.loggingBehavior, .none)
XCTAssertFalse(descriptor.scrollingEnabled)
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/CapacitorTests/RouterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RouterTests: XCTestCase {
checkRouter(path: "", expected: "/index.html")
}

func testRouterReturnsIndexWhenProviedPathWithoutExtension() {
func testRouterReturnsIndexWhenProvidedPathWithoutExtension() {
checkRouter(path: "/a/valid/path/no/ext", expected: "/index.html")
}

Expand Down
Loading