@magmonium/one 0.4.19 → 0.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,296 @@
1
+ # Linking an mm App to GitHub
2
+
3
+ How an App's source gets into a GitHub repository, and how you and your
4
+ collaborators keep working on it from the editor. Releasing what is in that
5
+ repository is a separate step, covered in the release guide.
6
+
7
+ ## What the repository holds
8
+
9
+ Each App has one repository: its **AppRepo**. It holds two things:
10
+
11
+ | Path | What it is |
12
+ | --- | --- |
13
+ | `.magmonium/` | The design: Screens, Features, state, rules, nav and assets as you composed them. This is what the editor reads back. |
14
+ | `src/app/custom/`, `mag_assets/` and the shell | What you wrote by hand and what the editor cannot regenerate: your own components, the app's assets, `package.json`, `angular.json`, the CI workflows. |
15
+
16
+ The generated code — `src/app/features/`, `pages/`, `widgets/`, `shared/lib/`, `shared/type/` and the router and provide overlays — is **not** committed. `npm start`, `npm run build*` and `npm test` regenerate it from `.magmonium/` through `@magmonium/cli` (`npm run gen:code`), so a clone builds after `npm install`, without the editor. `.gitignore` excludes it.
17
+
18
+ The Store records which repository belongs to which App. The repository's own
19
+ files only carry the App's id, so moving the App to another repository leaves
20
+ nothing stale behind.
21
+
22
+ One repository serves one App. A repository already linked to another App is
23
+ refused.
24
+
25
+ ## Linking, step by step
26
+
27
+ Linking takes three steps. Steps 1 and 2 happen on GitHub, step 3 in
28
+ Magmonium. Do them in this order: Magmonium checks the repository at the
29
+ moment you link, so the GitHub side has to be ready first.
30
+
31
+ | Step | Where | Who |
32
+ | --- | --- | --- |
33
+ | 1. Create the repository | GitHub | anyone who can create repositories there |
34
+ | 2. Install the Magmonium GitHub App on it | GitHub | an admin of that repository |
35
+ | 3. Link it to the App | Store or editor | the App's Owner |
36
+
37
+ The person doing step 2 and the App's Owner are usually the same person, but
38
+ they do not have to be. Magmonium never asks for your GitHub password or a
39
+ GitHub token. The installation in step 2 is the only permission it uses.
40
+
41
+ ### Step 1 — Create the repository
42
+
43
+ On GitHub, choose **New repository** under your account or an organization.
44
+
45
+ - **Name it after the App.** Using the App link (for example `m-orders`)
46
+ keeps things easy to find, but any name works.
47
+ - **Private or public.** Either works.
48
+ - **Contents.** Leave it empty. Adding a `README.md`, `LICENSE` or
49
+ `.gitignore` is fine. Do not add a `package.json` or any app code: the first
50
+ Push writes the whole app for you.
51
+
52
+ You can also reuse a repository that already holds a Magmonium design, that
53
+ is, one with a `.magmonium/` folder on its default branch. Do this, for
54
+ example, when you move an App to a new repository or restore one.
55
+
56
+ A repository that holds anything else, such as a hand-written Angular app, is
57
+ refused. It has no design for the editor to read, and the first Push would
58
+ overwrite its files.
59
+
60
+ ### Step 2 — Install the Magmonium GitHub App
61
+
62
+ This step is what proves to Magmonium that the repository is yours to hand
63
+ over. GitHub only lets an admin of the repository install an app on it.
64
+
65
+ 1. Open the install page:
66
+ **[github.com/apps/magmonium/installations/new](https://github.com/apps/magmonium/installations/new)**.
67
+ The same link appears as **Install the Magmonium GitHub App** next to the
68
+ repository field when you link, and again if a link is refused.
69
+ 2. On GitHub, pick the **account or organization** that owns the repository.
70
+ 3. Choose **Only select repositories** and select the repository from step 1.
71
+ *All repositories* also works, but gives Magmonium access to more than it
72
+ needs.
73
+ 4. Press **Install**.
74
+
75
+ **If the GitHub App is already installed on that account**, GitHub shows
76
+ **Configure** instead of **Install**. Open it and add the new repository
77
+ under *Repository access*. Then press **Save**.
78
+
79
+ **For an organization repository**, an organization owner may need to install
80
+ the app or approve your request. If GitHub says *request sent*, the link only
81
+ works after an owner approves it.
82
+
83
+ Magmonium uses the installation only to read and write the files of the
84
+ repositories you selected, which is what Pull and Push need. Remove a
85
+ repository from the installation, or uninstall the app, and Magmonium can no
86
+ longer reach it.
87
+
88
+ ### Step 3 — Link it to the App
89
+
90
+ Only the App's **Owner** can link. Collaborators see *Only the App's Owner can
91
+ link its repository.*
92
+
93
+ Enter the repository in any of these forms:
94
+
95
+ ```text
96
+ https://github.com/acme/orders
97
+ https://github.com/acme/orders.git
98
+ git@github.com:acme/orders
99
+ acme/orders
100
+ ```
101
+
102
+ You can link from three places.
103
+
104
+ #### When you create an App in the Store
105
+
106
+ 1. In the Store, start **Create App**.
107
+ 2. In the **Info** step, fill in **App Link**, **App Type** and
108
+ **Repository URL**. All three are required.
109
+ 3. Continue. Magmonium creates the App and links the repository in one go.
110
+ - **Link accepted:** the wizard moves on to **Deploy Setup** and then
111
+ **How to Publish**.
112
+ - **Link refused:** the App is **not** created. The wizard stays on
113
+ **Info**, shows the reason, and offers **Install the Magmonium GitHub
114
+ App**. Fix the problem, then continue again.
115
+
116
+ While the App is still a draft, you can go back to **Info** and change the
117
+ **Repository URL**. A changed URL is checked again, exactly like the first
118
+ link.
119
+
120
+ #### From the editor, for an App you already have
121
+
122
+ 1. In the editor's page menu, choose **Open App**.
123
+ 2. Pick the App. If it has no repository yet, the editor shows **Link
124
+ repository** with the install link and a **GitHub repository** field.
125
+ 3. Enter the repository and press **Link repository**.
126
+ 4. **Link accepted:** the editor moves on to choosing a **Branch** to Pull
127
+ (`dev` by default). Pulling a fresh repository gives you an **empty**
128
+ workspace named after the App, ready to compose in. It replaces whatever
129
+ the workspace held before, so if you already composed something you want
130
+ to keep, use the next path instead.
131
+
132
+ #### From the editor, for a workspace with no App yet
133
+
134
+ If you composed first and have no App yet:
135
+
136
+ 1. Choose **Open App**, then **Create App**. The editor offers this when the
137
+ workspace has Screens but no App.
138
+ 2. Fill in the name, **App link**, type, description and **GitHub
139
+ repository**. The link is prefilled from the app's name.
140
+ 3. Press **Create App**.
141
+ - **Link accepted:** the editor keeps your workspace, links it to the new
142
+ App, and goes straight to **Push**.
143
+ - **Link refused:** unlike the Store wizard, the App **is** created. The
144
+ editor shows the reason on the **Link repository** step, so you can fix
145
+ it and link again without creating a second App.
146
+
147
+ ### Check that it worked
148
+
149
+ - In the Store, the App's deployment page shows the repository URL.
150
+ - In the editor, **Open App** for that App now goes straight to choosing a
151
+ **Branch** instead of asking for a repository.
152
+ - After your first Push, the repository on GitHub has a `dev` branch holding
153
+ `.magmonium/`, `mag_assets/` and the app shell, in a commit by `magmonium[bot]` that credits
154
+ you.
155
+
156
+ ### When linking is refused
157
+
158
+ | Message | What it means | Fix |
159
+ | --- | --- | --- |
160
+ | That is not a GitHub repository URL | The text is not one of the forms above. | Paste the URL from the repository's GitHub page. |
161
+ | The Magmonium GitHub App is not installed on that repository | Step 2 is missing, was installed on a different repository, or is still waiting for an organization owner's approval. | [Install it](https://github.com/apps/magmonium/installations/new) on this exact repository (or add the repository under **Configure**), then link again. |
162
+ | That repository is already linked to another App | Each repository serves one App, even after it is renamed or moved on GitHub. | Create a new repository for this App. |
163
+ | That repository holds an app without a design. Use an empty one. | The default branch has files other than `README.md`, `LICENSE`, `.gitignore`, and no `.magmonium/` folder. | Use an empty repository. |
164
+ | GitHub refused — the app may have been uninstalled or the repository deleted | GitHub would not answer for that repository. | Check that the repository exists and the GitHub App is still installed on it. |
165
+ | This server has no GitHub App configured | This Magmonium server is not set up for GitHub. | Contact the platform admin. |
166
+ | Only the App's Owner can link its repository. | You are a Collaborator. | Ask the Owner to link it. |
167
+
168
+ ### Moving to another repository
169
+
170
+ The Owner can link the App to a different repository at any time, under the
171
+ same three steps and the same rules. Nothing is copied: the old repository
172
+ keeps what it has, and the next Push writes the whole app into the new one
173
+ from scratch. Deploys are not affected. They use your deploy token, not the
174
+ repository.
175
+
176
+ Remember to set the release secrets again in the new repository (see the
177
+ release guide).
178
+
179
+ ### Reinstalled the GitHub App?
180
+
181
+ If you uninstalled and reinstalled the Magmonium GitHub App, Pull and Push
182
+ fail with *GitHub refused*. The Owner fixes this by linking the **same**
183
+ repository again. Linking an App to its own repository is always allowed.
184
+
185
+ ## Who can write
186
+
187
+ | Role | Link a repository | Pull | Push | Create a branch |
188
+ | --- | --- | --- | --- | --- |
189
+ | Owner | yes | yes | yes | yes |
190
+ | Collaborator | no | yes | yes | yes |
191
+ | Anyone else | no | no | no | no |
192
+
193
+ Collaborators do **not** need to be added on GitHub. Every write goes through
194
+ the Magmonium GitHub App and is allowed by the Store role alone, so removing
195
+ someone from the App also ends their access to the repository.
196
+
197
+ Commits are made by `magmonium[bot]` and credit the person who pushed with a
198
+ `Co-authored-by:` line.
199
+
200
+ ## Working from the editor
201
+
202
+ Open the editor and pick the App. You can also compose without one, using
203
+ **Continue unlinked**: Save, Download and Run all still work. Push appears once
204
+ you create an App for the workspace. Its link is prefilled from the app's name.
205
+
206
+ ### The everyday loop
207
+
208
+ | Gesture | Where it writes | When |
209
+ | --- | --- | --- |
210
+ | **Save** | your linked local folder | as often as you like |
211
+ | **Run** / **Sync** | the Run window | to see the app running |
212
+ | **Push** | a branch of the AppRepo | when a piece of work is done |
213
+
214
+ Push is the last step after local work, not something to press every few
215
+ minutes.
216
+
217
+ ### Pull
218
+
219
+ **Pull** replaces the workspace with the design from one branch (`dev` unless
220
+ you pick another). The editor rebuilds the code from the design. It never
221
+ reads the emitted code back.
222
+
223
+ If the workspace has edits you have not Pushed, Pull asks first and tells you
224
+ what it will drop. There is only one workspace.
225
+
226
+ A branch that does not exist yet is read from the repository's default branch.
227
+
228
+ ### Push
229
+
230
+ **Push** makes one commit holding the emitted app and the design.
231
+
232
+ - **Branch.** Pushes go to `dev` by default. `dev` is created from the default
233
+ branch on the first Push.
234
+ - **Never `main`.** `main` takes changes by pull request on GitHub.
235
+ - **Commit message.** The editor drafts it in the form
236
+ `type(feature): few words`, from what changed in the design since your last
237
+ Pull or Push. Your AI provider writes the draft if you have set one up. You
238
+ always see the message and can edit it before it goes.
239
+ - **What it deletes.** A Push removes files only inside the folders the editor
240
+ owns: `mag_assets/`, `src/app/features/`, `src/app/pages/`,
241
+ `src/app/widgets/` and `.magmonium/`. Hand-written code in
242
+ `src/app/custom/`, the shell, and anything else you added are never deleted.
243
+ - **Blocked.** Push refuses while the design has violations or a function body
244
+ that does not compile. The editor lists the reasons.
245
+
246
+ ### When the branch has moved
247
+
248
+ Push only goes through if the branch is still where you last Pulled or Pushed
249
+ it. If someone else pushed in the meantime, you see
250
+ *The branch has moved since you pulled*. Push is never forced. You have two
251
+ options:
252
+
253
+ - **Pull again.** You get their changes, but you lose your unpushed edits.
254
+ - **Push to a new branch.** Your work lands on its own branch, for example
255
+ `feature/my-change`. Merge it on GitHub with a pull request.
256
+
257
+ To avoid this when several people work on one App, give each person their own
258
+ branch: use **+ New branch** in the branch picker.
259
+
260
+ ## Branches
261
+
262
+ | Branch | Role |
263
+ | --- | --- |
264
+ | `main` | Releases. Changes arrive only by pull request on GitHub. CD runs here. |
265
+ | `dev` | The default Push target. Open pull requests from here into `main`. |
266
+ | `feature/...` | Optional. One per person or per piece of work. |
267
+
268
+ **Create Branch** makes a branch at the commit your workspace stands on, or at
269
+ the head of the default branch. Branch names may use letters, digits, `.`, `_`,
270
+ `-` and `/`. A branch can only be created once the repository has at least one
271
+ commit. Push first to start it.
272
+
273
+ ## From repository to Store
274
+
275
+ Linking and pushing never deploy anything. The path to users is:
276
+
277
+ 1. **Push** to `dev` from the editor.
278
+ 2. Open a **pull request** `dev → main` on GitHub. CI checks it.
279
+ 3. Bump `version:` in `mag_assets/remote/<app>.yml` and **merge**. CD builds
280
+ the bundle and deploys it to the App's beta tier.
281
+ 4. **Preview** beta from the Store. The Owner then **Publishes** it to users.
282
+
283
+ The release guide covers the repository secrets, the deploy token, and the
284
+ version gate that decides when CD deploys.
285
+
286
+ ## Troubleshooting
287
+
288
+ | Message | What happened | Fix |
289
+ | --- | --- | --- |
290
+ | This App has no linked repository | The App has no AppRepo yet. | The Owner links one. |
291
+ | The repository has no commits yet. Push first to start it | You tried to create a branch in an empty repository. | Push once, then create the branch. |
292
+ | main takes changes by pull request on GitHub | You tried to Push to, or create, `main`. | Push to `dev` or a feature branch. |
293
+ | This branch exists, pick it from the list | The new branch name is taken. | Pick that branch, or choose another name. |
294
+ | Nothing to Push. The workspace matches its last Pull or Push. | There are no design changes. | None needed. |
295
+ | The design in this branch could not be read | The `.magmonium/` folder on that branch is damaged or was edited by hand. | Restore it from history on GitHub, or Pull another branch. |
296
+ | GitHub refused — the app may have been uninstalled or the repository deleted | GitHub refused the request. | [Reinstall the GitHub App](https://github.com/apps/magmonium/installations/new), then have the Owner link the same repository again. |
@@ -593,6 +593,7 @@
593
593
  "pinned": "Pinned",
594
594
  "pitcairn-islands": "Pitcairn Islands",
595
595
  "please-select": "Please select",
596
+ "plugin-screen-not-found": "This app offers no plugin by that name",
596
597
  "poland": "Poland",
597
598
  "portfolio": "Portfolio",
598
599
  "portfolio-analysis": "Portfolio Analysis",