Skip to content

Commit

Permalink
Merge branch 'master' into feat/developer/13109-check-that-package-do…
Browse files Browse the repository at this point in the history
…es-not-contain-itself
  • Loading branch information
mcdurdin authored Feb 10, 2025
2 parents a00e446 + 2d5e3ee commit c1b9302
Show file tree
Hide file tree
Showing 62 changed files with 190 additions and 219 deletions.
29 changes: 29 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Keyman Version History

## 18.0.187 alpha 2025-02-07

* docs(web): relocate gesture docs to web/docs/internal (#13139)
* chore(mac): remove empty options tab from configuration (#13160)
* chore(linux): Update debian changelog (#13143)

## 18.0.186 alpha 2025-02-06

* feat(windows): check updates and automatic update merged (#13115)

## 18.0.185 alpha 2025-02-05

* fix(developer): make kmc log options consistent across all commands (#13075)
* feat(developer): add user interface for `kmc copy` to TIKE (#13076)
* chore(developer): add verbose logs for project copier (#13080)
* chore(mac, ios): build and run with xcode 16 (#13077)

## 18.0.184 alpha 2025-02-04

* fix(common): handle undefined input in `@keymanapp/langtags` lookups (#13117)
Expand Down Expand Up @@ -1283,6 +1300,18 @@
* chore(common): move to 18.0 alpha (#10713)
* chore: move to 18.0 alpha

## 17.0.335 alpha 2025-02-06

* fix(android): improve resource-update tool handling of host Activity's closure (#13057)
* fix(ios): prevent message-handler collision (#13058)
* chore(linux): improve compatibility with Gentoo Linux (#12889)
* chore(linux): Update debian changelog (#13062)
* fix(web): keyboard query error states should always provide informative Error objects, reports (#13079)
* chore: push the branch when creating PR in version history writer (#13085)
* fix(web): disabled correction state should prevent predictive corrections (#13074)
* change(ios): set host-app bundle identifier in embedded Web debug-report (#13112)
* chore(mac, ios): build and run with xcode 16 (#13121)

## 17.0.334 stable 2025-01-27

* chore(linux): update copyright year (#12919)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.0.185
18.0.188
1 change: 0 additions & 1 deletion common/windows/delphi/general/RegistryKeys.pas
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ interface
SRegValue_ActiveProject_Filename = 'project filename';
SRegValue_ActiveProject_SourcePath = 'source path';

SRegValue_AutomaticUpdates = 'automatic updates'; //CU
SRegValue_CheckForUpdates = 'check for updates'; // CU
SRegValue_LastUpdateCheckTime = 'last update check time'; // CU
SRegValue_ApplyNow = 'apply now'; // CU Start the install now even though it will require an restart
Expand Down
9 changes: 5 additions & 4 deletions common/windows/delphi/general/Upload_Settings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function MakeAPIURL(path: string): string;

function MakeKeymanURL(const path: string): string;

function URL_KmcMessage(id: string): string;
function URL_KmcMessage(const id: string): string;

implementation

Expand All @@ -110,7 +110,7 @@ implementation
S_UserAgent_Developer = 'Keyman Developer';
S_UserAgent_Diagnostics = 'Keyman for Windows Diagnostics';

S_HelpKeymanCom = 'https://help.keyman.com';
S_Host_KmnSh = 'https://kmn.sh';
S_KeymanCom = 'https://keyman.com';
S_APIProtocol = 'https';
S_APIServer = 'api.keyman.com';
Expand All @@ -123,6 +123,7 @@ implementation

const
URLPath_PackageDownload_Format = '/go/package/download/%0:s?platform=windows&tier=%1:s&bcp47=%2:s&update=%3:d';
URL_KeymanDeveloper_HelpKmcMessage_Format = S_Host_KmnSh+'/%0:s';

function API_UserAgent: string;
begin
Expand Down Expand Up @@ -181,9 +182,9 @@ function URLPath_PackageDownload(const PackageID, BCP47: string; IsUpdate: Boole
Result := Format(URLPath_PackageDownload_Format, [URLEncode(PackageID), URLEncode(CKeymanVersionInfo.Tier), URLEncode(BCP47), IsUpdateInt]);
end;

function URL_KmcMessage(id: string): string;
function URL_KmcMessage(const id: string): string;
begin
Result := S_HelpKeymanCom + '/developer/'+GetMajorMinorVersionString+'/reference/messages/'+id.ToLower;
Result := Format(URL_KeymanDeveloper_HelpKmcMessage_Format, [id.ToLower]);
end;

end.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ export class PackageCompilerMessages {
this.WARN_VisualKeyboardFileIsInvalid, `Visual keyboard file '${def(o.filename)}' is invalid.`
);

static ERROR_PackageMustNotContainItself = SevError | 0x0027;
static WARN_PackageVersionIsUnrecognizedFormat = SevWarn | 0x0027;
static Warn_PackageVersionIsUnrecognizedFormat = (o:{version: string}) => m(
this.WARN_PackageVersionIsUnrecognizedFormat, `Package version '${def(o.version)}' has an unrecognized format.`,
`The format for version numbers should be number[.number[.number]]. Each
number component should be an integer, without leading zeroes.`
);

static ERROR_PackageMustNotContainItself = SevError | 0x0028;
static Error_PackageMustNotContainItself = (o:{outputFilename: string}) => m(
this.ERROR_PackageMustNotContainItself, `The package may not include a .kmp file of the same name '${def(o.outputFilename)}'.`, `
While it is possible for a package file to contain other .kmp package files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export class PackageVersionValidator {
kmp.info.version = {description: kmp.keyboards[0].version};
}

if(result && !isValidVersionNumber(kmp.info.version.description)) {
this.callbacks.reportMessage(PackageCompilerMessages.Warn_PackageVersionIsUnrecognizedFormat({version: kmp.info.version.description}));
return false;
}

return result;
}

Expand All @@ -109,3 +114,11 @@ export class PackageVersionValidator {
return true;
}
}

function isValidVersionNumber(version: string) {
return /^(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0,2}$/.test(version);
}

export const unitTestEndpoints = {
isValidVersionNumber,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Package>
<System>
<KeymanDeveloperVersion>15.0.266.0</KeymanDeveloperVersion>
<FileVersion>7.0</FileVersion>
</System>
<Info>
<!-- blank name -->
<Name URL="">warn_package_version_is_unrecognized_format</Name>
<Copyright URL="">© 2019 National Research Council Canada</Copyright>
<Author URL="mailto:[email protected]">Eddie Antonio Santos</Author>
<Version>1.0-invalid</Version>
</Info>
<Files>
<File>
<Name>basic.kmx</Name>
<Description>Keyboard Basic</Description>
<CopyLocation>0</CopyLocation>
<FileType>.kmx</FileType>
</File>
</Files>
<Keyboards>
<Keyboard>
<Name>Basic</Name>
<ID>basic</ID>
<Version>1.0</Version>
<Languages>
<Language ID="km">Central Khmer (Khmer, Cambodia)</Language>
</Languages>
</Keyboard>
</Keyboards>
</Package>
5 changes: 5 additions & 0 deletions developer/src/kmc-package/test/messages.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,10 @@ describe('PackageCompilerMessages', function () {
PackageCompilerMessages.ERROR_PackageFileHasEmptyVersion);
});

it('should generate Warn_PackageVersionIsUnrecognizedFormat if package version field is not a valid format', async function() {
await testForMessage(this, ['invalid', 'warn_package_version_is_unrecognized_format.kps'],
PackageCompilerMessages.WARN_PackageVersionIsUnrecognizedFormat);
});

// ERROR_PackageMustNotContainItself test in package-compiler.tests.ts
});
35 changes: 33 additions & 2 deletions developer/src/kmc-package/test/versioning.tests.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'mocha';
import { assert } from 'chai';
import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers';
import { makePathToFixture } from './helpers/index.js';
import { KmpCompiler } from '../src/compiler/kmp-compiler.js';
import { KmpJsonFile } from '@keymanapp/common-types';
import { KmpCompiler } from '../src/compiler/kmp-compiler.js';
import { unitTestEndpoints } from '../src/compiler/package-version-validator.js';
import { makePathToFixture } from './helpers/index.js';

// This unit test was translated from a Delphi test
// Keyman.Test.System.CompilePackageVersioningTest, but note the difference in
Expand Down Expand Up @@ -41,4 +42,34 @@ describe('package versioning', function () {
assert.isTrue(kmpJson !== null);
});
}

it('should validate recognized version numbers', function() {
const goodVersions = [
'1.0',
'1',
'1.0.2',
'2.2.3',
'9',
'0',
], badVersions = [
'0001',
'0.1m',
'2.3.4.5',
'1.03.4',
'test',
'1.0-beta',
'',
null,
undefined,
'xxx',
];

for(const v of goodVersions) {
assert.isTrue(unitTestEndpoints.isValidVersionNumber(v), `'${v}' should be recognized as a valid version number`);
}

for(const v of badVersions) {
assert.isFalse(unitTestEndpoints.isValidVersionNumber(v), `'${v}' should be recognized as an invalid version number`);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface
UframeTextEditor,
UfrmMDIEditor,
UfrmTike,
UserMessages;
UserMessages, Keyman.Developer.UI.RichEdit41;

type
TLdmlDebugUIStatus = (
Expand Down Expand Up @@ -340,7 +340,7 @@ function TfrmLdmlKeyboardDebug.ProcessKeyEvent(var Message: TMessage): Boolean;
if not SetKeyEventContext then
Exit(False);

if km_core_process_event(FDebugCore.State, Message.WParam, modifier, 1, KM_CORE_EVENT_FLAG_DEFAULT) = KM_CORE_STATUS_OK then
if km_core_process_event(FDebugCore.State, VKToScanCodeToVK(Message.WParam, GetKeyboardLayout(0)), modifier, 1, KM_CORE_EVENT_FLAG_DEFAULT) = KM_CORE_STATUS_OK then
begin
// Process keystroke -- true = swallow keystroke
Result := True;
Expand Down
4 changes: 2 additions & 2 deletions developer/src/tike/child/UfrmDebug.pas
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface
UfrmDebugStatus,
UfrmMDIEditor,
UfrmTike,
UserMessages;
UserMessages, Keyman.Developer.UI.RichEdit41;

type
TDebugLineEvent = procedure(Sender: TObject; ALine: Integer) of object;
Expand Down Expand Up @@ -465,7 +465,7 @@ function TfrmDebug.ProcessKeyEvent(var Message: TMessage): Boolean;
if not SetKeyEventContext then
Exit(False);

if km_core_process_event(FDebugCore.State, Message.WParam, modifier, 1, KM_CORE_EVENT_FLAG_DEFAULT) = KM_CORE_STATUS_OK then
if km_core_process_event(FDebugCore.State, VKToScanCodeToVK(Message.WParam, GetKeyboardLayout(0)), modifier, 1, KM_CORE_EVENT_FLAG_DEFAULT) = KM_CORE_STATUS_OK then
begin
// Process keystroke -- true = swallow keystroke
Result := True;
Expand Down
6 changes: 6 additions & 0 deletions linux/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
keyman (17.0.335-1) unstable; urgency=medium

* New upstream release.

-- Eberhard Beilharz <[email protected]> Thu, 06 Feb 2025 10:33:00 +0100

keyman (17.0.334-1) unstable; urgency=medium

* New upstream release.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="22690"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="23504"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down Expand Up @@ -203,12 +203,6 @@
</subviews>
</view>
</tabViewItem>
<tabViewItem label="Options" identifier="2" id="frd-No-seV">
<view key="view" id="N1x-px-93m">
<rect key="frame" x="10" y="33" width="754" height="538"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
</tabViewItem>
<tabViewItem label="Support" identifier="3" id="93O-x6-RLF">
<view key="view" id="Mph-hO-2dk">
<rect key="frame" x="10" y="33" width="754" height="538"/>
Expand Down
5 changes: 0 additions & 5 deletions oem/firstvoices/windows/src/xml/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@
<!-- Introduced: 7.0.230.0 -->
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Show welcome screen</string>

<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 18.0.96.0 -->
<string name="koAutomaticUpdate" comment="Automatically download updates in the background, for installation later">Automatically download updates in the background, for installation later</string>

<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
Expand Down
5 changes: 1 addition & 4 deletions windows/src/desktop/kmshell/locale/am-ET/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,7 @@
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">የእንኳን ደህና መጡ ምስልን አሳይ</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">የተሻሻሉ መረጃዎችን ለማግኘት በየሳምንቱ keyman.com ይመልከቱ</string>

<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
Expand Down
4 changes: 0 additions & 4 deletions windows/src/desktop/kmshell/locale/az-AZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Xoş gəldiniz ekranını göstərin</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">Yeniləmələr üçün həftəlik keyman.com-u avtomatik olaraq yoxlamaq</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
<string name="koTestKeymanFunctioning" comment="Startup options - test for conflicting apps when Product starts">Keyman başlayanda ziddiyyətli tətbiqetmələr üçün test et</string>
<!-- Context: Configuration Dialog - Options tab -->
Expand Down
4 changes: 0 additions & 4 deletions windows/src/desktop/kmshell/locale/bwr-NG/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Cangtǝ lale ata screen ni</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">Pakǝ ka kǝrni akwa keyman.com kǝlara sati kamnyar wutǝ labar na bǝlin</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
<string name="koTestKeymanFunctioning" comment="Startup options - test for conflicting apps when Product starts">Ngkǝrha kamnyar sǝndǝr applicationyeri aɗi kǝɓa wa sakatǝ Keyman baɗita</string>
<!-- Context: Configuration Dialog - Options tab -->
Expand Down
4 changes: 0 additions & 4 deletions windows/src/desktop/kmshell/locale/ckl-NG/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Tsanti welcome screen</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">Chakǝnta keyman.com kǝlara sati akuya ka gǝ wulba updatyere</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
<string name="koTestKeymanFunctioning" comment="Startup options - test for conflicting apps when Product starts">Nkǝrti ka ngaba suyere kura kal kal akwa applicationyere ma Keyman badicini kǝthlǝr</string>
<!-- Context: Configuration Dialog - Options tab -->
Expand Down
4 changes: 0 additions & 4 deletions windows/src/desktop/kmshell/locale/cs-CZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Zobrazit úvodní obrazovku</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">Automaticky kontrolovat aktualizace na keyman.com každý týden</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
<string name="koTestKeymanFunctioning" comment="Startup options - test for conflicting apps when Product starts">Test pro protichůdné aplikace při spuštění klíče</string>
<!-- Context: Configuration Dialog - Options tab -->
Expand Down
4 changes: 0 additions & 4 deletions windows/src/desktop/kmshell/locale/de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Willkommensbildschirm anzeigen</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">keyman.com wöchentlich auf Updates überprüfen</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
<string name="koTestKeymanFunctioning" comment="Startup options - test for conflicting apps when Product starts">Beim Start von Keyman nach inkompatiblen Anwendungen suchen</string>
<!-- Context: Configuration Dialog - Options tab -->
Expand Down
4 changes: 0 additions & 4 deletions windows/src/desktop/kmshell/locale/el-polyton/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@
<string name="koShowWelcome" comment="Startup options - show/hide welcome screen">Προβάλετε τὴν ὀθόνης καλωσορίσματος</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.230.0 -->
<string name="koCheckForUpdates" comment="Startup options - check online weekly for updates">Νὰ ἐλέγχετε σὲ ἑβδομαδιαία βάση τὸ keyman.com γιὰ ἐνημερώσεις</string>
<!-- Context: Configuration Dialog - Options tab -->
<!-- String Type: FormatString -->
<!-- Introduced: 7.0.236.0 -->
<string name="koTestKeymanFunctioning" comment="Startup options - test for conflicting apps when Product starts">Κατὰ τὴν ἔναρξη τοῦ Keyman, νὰ ἐξετάζετε ἂν ὑπάρχουν μὴ συμβατὲς ἐφαρμογές</string>
<!-- Context: Configuration Dialog - Options tab -->
Expand Down
Loading

0 comments on commit c1b9302

Please sign in to comment.