Commit graph

1657 commits

Author SHA1 Message Date
Marc Durdin
6bebefda10 feat(developer): move kmc-kmn to KeymanCompiler interface
Part of #9473.

KmnCompiler now implements KeymanCompiler, including the returned
artifacts. Also establishes the common types for the compiler interfaces
and consolidates and renames various API surfaces for kmc-kmn.
2023-12-07 11:05:31 +07:00
Marc Durdin
4c7b7992da
Merge pull request #10137 from keymanapp/fix/developer/10003-opening-multiple-kpj
fix(developer): prevent opening .kpj in multiple processes 🦕
2023-12-06 12:00:32 +11:00
Marc Durdin
56d5f379df
Merge pull request #10114 from keymanapp/feat/developer/multi-process-file-loading
feat(developer): Multi-process model for projects 🦕
2023-12-06 10:50:47 +11:00
Marc Durdin
4641684501 fix(developer): prevent opening .kpj in multiple processes
Fixes #10003.

Multiple small fixes required here:
* Add .kpj as an editable file type
* Ensure that when OpenFile returns nil (which it always will for a
  .kpj), that we don't crash
* Ensure that projects open in a new process rather than replacing the
  current project session

Adds a TODO for New Project -- this should be opened in a new process if
we already have a project open in the current process. Will push this
into a separate PR.
2023-12-05 15:08:05 +07:00
Marc Durdin
ff5a366c45 feat(developer): Open files in per-project instances
Refactor the file-opening code so it can be used by Keyman Developer UI
as well as command-line, and then add support for opening files in
per-project instances from File|Open and friends.

Also moves the initialization code out of tike.dpr into
Keyman.Developer.System.Main.pas, which makes it easier to maintain and
read.
2023-12-04 08:47:36 +07:00
Marc Durdin
4f9f71da3c chore(developer): add build.sh dep 2023-12-02 06:25:01 +07:00
Marc Durdin
c520918646 chore(developer): support publish and pack in build.sh 2023-12-02 05:49:16 +07:00
Marc Durdin
662ed0e50c fix(common): publish @keymanapp/developer-utils as npm module
Fixes #10111.
2023-12-01 14:05:51 +07:00
Marc Durdin
0bc426cf1a
Merge pull request #10092 from keymanapp/fix/developer/project-internal-paths
chore(developer): require project file to exist 🦕
2023-12-01 16:31:40 +11:00
Marc Durdin
915510b845 chore(developer): remove obsolete files 2023-12-01 12:00:56 +07:00
Marc Durdin
39b7c882a3 feat(developer): Multi-process model for projects 🦕
This is a bit of an omnibus commit, apologies for that. This commit
moves Keyman Developer to a proper multi-process model, where editing
files from multiple projects is handled much more cleanly, with each
project loaded in a separate process.

Files that are edited outside of a project structure are loaded into a
'temporary project' in a single process, which provides a pathway for
existing users who may have legacy files outside the normal Keyman
Developer project model.

There are several components to this:

1. Inter-process communication (Multiprocess, CopyDataHelper units and
   multiprocess test project). These modules establish a method of
   enumerating running Keyman Developer instances (with EnumWindow),
   recording relevant metadata for each instance (by thread id) in the
   registry (registry used because it manages contention without
   additional effort from us), and communicating between processes with
   WM_COPYDATA.
2. Command-line parsing (TikeCommandLine). Determines project ownership
   (ProjectOwningFile) for each filename passed on the command-line, and
   passes these over to existing instances of Keyman Developer that have
   that project loaded, or starts new instances as needed.
3. Temporary project management. Mostly in ProjectUI.

Also, moved GlobalProjectStateWnd management out of ProjectFile.pas and
into Project.pas, alongside other global project variables.

A follow-up will add functionality to determine if a file opened within
the Keyman Developer UI should open in the same instance or in a
separate instance (see TfrmKeymanDeveloper.OpenFileInProject). This will
use the same methodology as TikeCommandLine does now, so may involve
further refactoring.

This commit establishes the idea of 'keyman.kpj' as a future default
filename for Keyman Developer projects, but does not enable it, in
ProjectOwningFile. It is planned to introduce this fixed filename in
version 18.0 (see #10113).
2023-12-01 11:48:09 +07:00
Marc Durdin
3ef4dc7f84
Merge pull request #10016 from keymanapp/fix/developer/project-internal-paths
fix(developer): projects 2.0 internal path enumeration 🦕
2023-11-29 16:50:25 +11:00
Marc Durdin
458385f6b8
Merge pull request #10064 from keymanapp/fix/developer/10027-path-separator-for-kmc-package
fix(developer): path separator for kmc-package
2023-11-29 16:01:51 +11:00
Steven R. Loomis
02c8db9fdd
Merge branch 'master' into feat/developer-9446-bad-unicode-epic-ldml 2023-11-25 14:08:41 -06:00
Steven R. Loomis
bb63ba8a66
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-11-25 13:51:53 -06:00
Marc Durdin
11ae17c7c0 chore(developer): require project file to exist
Reverts some of the version 2.0 project functionality, as there are a
number of challenges around populating files for folders that don't have
project definitions, particularly if user attempts to load a folder that
is not a project folder after all but happens, e.g. to have a source
folder in it.
2023-11-25 16:14:22 +10:00
Marc Durdin
e5da0aacc2 chore(developer): fixup test fixture 2023-11-25 05:16:03 +10:00
Marc Durdin
b3b2825168 fix(developer): path separator for kmc-package
Fixes #10027.
2023-11-23 16:45:12 +10:00
Marc Durdin
e983818bda feat(developer): warn on usage of virtual keys in rule output
Fixes #10059.

Use of the unsupported and undocumented virtual key output, that doesn't
work in recent Keyman versions, at all, now results in a build warning.

Only a warning, because it did kinda work in old versions of Keyman.
2023-11-23 15:13:56 +10:00
Marc Durdin
94a9e91e61 fix(developer): generate version 2.0 keyboard project 2023-11-22 09:33:55 +10:00
Steven R. Loomis
c42615420d feat(developer): err/hint on illegal/pua 🙀
- also found that kmc's validate() should have been async but wasn't, a little bit of churn because of this
- unassigned not implemented yet, but tests in place for it.
- change SectionCompiler.postValidate to only be called during the validate() run of compilation. This way messages will only show once.

For: #9446
2023-11-17 22:41:58 +00:00
Steven R. Loomis
fffac6716e fix(developer): vis kbd callbacks instead of throw 🙀
- fix API and call sites

For: #9438
2023-11-17 12:42:48 -06:00
Steven R. Loomis
eebb88699d feat(developer): refactor a little bit to give a postValidate() phase
- postValidate() is called after all other compilation happens
- also make SectionCompiler actually abstract
- test fixes to support this

For: #9446
2023-11-17 18:08:07 +00:00
Steven R. Loomis
b802d14af1 feat(developer): ldml fix call to LdmlKeyboardVisualKeyboardCompiler() 🙀
- fix a call site

For: #9438
2023-11-17 08:55:42 -06:00
Steven R. Loomis
361c7d8ec6 fix(developer): vis kbd callbacks instead of throw 🙀
- fix API and call sites

For: #9438
2023-11-16 14:40:39 -06:00
Marc Durdin
38f9b29cc9 fix(developer): show relative path in Distribution tab
For the Project view, the Distribution tab now shows file relative
paths, which helps with organization. Have opted _not_ to show the
relative paths in the other tabs, because that information is visible
when the file details are expanded, and because those files should
always be in SourcePath anyway.
2023-11-16 11:50:54 +07:00
Marc Durdin
55c0c6fd08 fix(developer): projects 2.0 internal path enumeration
Restricts enumeration of files for the project to the project folder and
the SourcePath folder. This prevents problems where a project may be in
a folder with many subfolders which would take a long time to enumerate,
and avoids confusion where there are source-type files in other folders.

At the same time, sorts out forward slash vs backslash in paths. While
forward slash works in many scenarios, there are several filename
manipulation functions, such as ExpandFileName, which would build valid
but non-optimal paths when forward slashes were encountered, which
cascaded into files appearing to be different and presentation issues.
2023-11-16 11:47:35 +07:00
Darcy Wong
284ec099ee
Merge pull request #9993 from keymanapp/chore/common/keymanweb-osk-ttf
chore(web,developer): Move keymanweb-osk.ttf to common/resources
2023-11-15 19:10:27 +07:00
Marc Durdin
a355721e1b
Merge pull request #9996 from keymanapp/chore/developer/9948-handle-project-version-cleanly-in-kmc
chore(developer): handle project version checks cleanly in kmc 🦕
2023-11-15 13:48:44 +11:00
Marc Durdin
e2b7c69f61
Merge pull request #9995 from keymanapp/chore/developer/9948-only-source-path-files-in-project-views
chore(developer): show only source path files in project views 🦕
2023-11-15 13:48:37 +11:00
Marc Durdin
dce6de57c9
Merge pull request #9989 from keymanapp/feat/developer/9948-handle-errors-loading-projects
feat(developer): handle errors loading projects 🦕
2023-11-15 13:48:29 +11:00
Marc Durdin
4ac71cca19
Merge pull request #9986 from keymanapp/chore/developer/9948-manage-sourcepath-in-upgrade-project
chore(developer): manage SourcePath in project upgrade 🦕
2023-11-15 13:48:19 +11:00
Marc Durdin
16bea3442e
Merge pull request #9985 from keymanapp/chore/developer/9948-only-build-source-files
chore(developer): only build source files 🦕
2023-11-15 13:48:09 +11:00
Marc Durdin
8895775d12
Merge pull request #9984 from keymanapp/feat/developer/9948-project-settings-20-form
feat(developer): Project Settings Form for 17.0+ projects 🦕
2023-11-15 13:47:44 +11:00
Marc Durdin
e77472c658
Merge pull request #9969 from keymanapp/fix/developer/9948-show-project-upgrade-messages-in-messages-panel
fix(developer): Project upgrade messages now show in Messages panel 🦕
2023-11-15 13:47:35 +11:00
Marc Durdin
7d204d5b06
Merge pull request #9966 from keymanapp/fix/developer/kmc-build-ldml-create-outdir
fix(developer): kmc build ldml keyboard should create output folder 🦕
2023-11-15 13:47:26 +11:00
Marc Durdin
ad2f6b33c9
Merge pull request #9964 from keymanapp/feat/developer/9948-show-ldml-xml-keyboards-in-project
feat(developer): show .xml LDML keyboards in project 🦕
2023-11-15 13:47:16 +11:00
Marc Durdin
b8dcc1b43d
Merge branch 'master' into feat/developer/9948-load-xml-ldml-files 2023-11-15 13:46:52 +11:00
Marc Durdin
26900f7b2c
Merge pull request #9956 from keymanapp/chore/developer/9948-hide-remove-project
chore(developer): hide 'Remove From Project' for v2.0 projects 🦕
2023-11-15 13:46:26 +11:00
Marc Durdin
c060666c0a
Merge pull request #9950 from keymanapp/feat/developer/9869-new-project-description-and-tweaks
feat(developer): New Project - Description field and tweaks 🦕
2023-11-15 13:46:16 +11:00
Marc Durdin
a937f3c7de
Merge pull request #9949 from keymanapp/feat/developer/tike-2.0-projects
feat(developer): Support v2.0 projects in TIKE 🦕
2023-11-15 13:46:07 +11:00
Darcy Wong
9af4ce3f53 fix(developer): Attempt 2 to copy font 2023-11-15 09:07:04 +07:00
Darcy Wong
71ea3c3fd1 fix(developer): Update Makefile to copy keymanweb-osk.ttf 2023-11-15 06:41:13 +07:00
Marc Durdin
65b7b20dc8 chore(developer): handle project version checks cleanly in kmc
Relates to #9948.

While the schema validation does check the version already, it gives a
fairly obtuse message, and we can do better.

Found a secondary issue with a iterator type guard needed in
kpj-file-reader when preparing unit test, which was probably masked in
other tests by not verifying all messages generated, so updated all
infrastructure message tests to verify the full set of messages
generated.
2023-11-14 06:24:28 +07:00
Marc Durdin
4fe5df1e69 chore(developer): show only source path files in project views
Relates to #9948.

For v2.0 projects, only show .kmn, .kps, .model.ts, .tsv, and .xml files
if they are source files within Options.SourcePath.
2023-11-14 06:02:04 +07:00
Darcy Wong
799a84579a chore(developer): Add configure step to copy font 2023-11-13 20:31:14 +07:00
Darcy Wong
6ff0cd202d chore(common): Move keymanweb-osk.ttf to common/ 2023-11-13 15:44:46 +07:00
Marc Durdin
53b57939e4 feat(developer): handle errors loading projects
Relates to #9948.

Prevents loading of projects other than v1.0, v2.0, and also handles
error cases when attempting to load projects.
2023-11-13 13:41:58 +07:00
Marc Durdin
c488460c71 chore(developer): manage SourcePath in project upgrade
Relates to #9948.

When upgrading a project to v2.0, it is important that all source files
are in the same folder. This change makes the upgrade process verify
that this is the case and blocks the upgrade if there are source files
in multiple folders.

Source files are .kmn, .xml (ldml keyboard), .kps, and .model.ts.
2023-11-13 12:12:11 +07:00
Marc Durdin
d39af4edc5 chore(developer): only build source files
For batch builds (e.g. project/compile all) of v2.0 projects, we only
want to build files that are listed in the project's $SOURCEPATH, so
that the project can contain extra folders with source file types that
won't break a project-level build.

Any source file types in extra folders can still be built one-by-one,
which is helpful for investigation and test for keyboard authors, but
will not be built if project build is selected.

This commit also formalizes the source/ SourcePath for upgraded projects
which contain a source/ folder. If the project to be upgraded does not
contain the source/ folder, then no SourcePath is assigned, and any
source file in any folder will be built.
2023-11-12 06:43:39 +07:00