AFFiNE/packages/frontend/templates
renovate 7f9d321d9c
chore: bump up glob version to v11 (#7451)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [glob](https://togithub.com/isaacs/node-glob) | [`^10.3.12` -> `^11.0.0`](https://renovatebot.com/diffs/npm/glob/10.4.3/11.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/glob/11.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/glob/11.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/glob/10.4.3/11.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/glob/10.4.3/11.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>isaacs/node-glob (glob)</summary>

### [`v11.0.0`](https://togithub.com/isaacs/node-glob/compare/v10.4.4...561601d9d14935970ea78b0c1ca3a25addbf5379)

[Compare Source](https://togithub.com/isaacs/node-glob/compare/v10.4.5...v11.0.0)

### [`v10.4.5`](https://togithub.com/isaacs/node-glob/compare/v10.4.4...v10.4.5)

[Compare Source](https://togithub.com/isaacs/node-glob/compare/v10.4.4...v10.4.5)

### [`v10.4.4`](https://togithub.com/isaacs/node-glob/compare/v10.4.3...v10.4.4)

[Compare Source](https://togithub.com/isaacs/node-glob/compare/v10.4.3...v10.4.4)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
2024-07-16 08:24:01 +00:00
..
edgeless-snapshot fix: note added with template should be edgeless only (#6122) 2024-03-15 12:51:03 +08:00
onboarding feat(core): use zip snapshot for onboarding page (#6495) 2024-04-15 02:16:08 +00:00
stickers fix(templates): update stickers (#7320) 2024-06-25 03:46:24 +00:00
build-edgeless.mjs fix(core): template image assets missing (#7171) 2024-06-08 17:28:24 +00:00
build-stickers.mjs fix(templates): use url safe base64 in templates (#7354) 2024-06-27 03:44:14 +00:00
edgeless-templates.gen.ts feat: move templates into AFFiNE (#5750) 2024-02-21 06:26:01 +00:00
package.json chore: bump up glob version to v11 (#7451) 2024-07-16 08:24:01 +00:00
README.md refactor(core): onboarding using new transformer api (#5412) 2023-12-28 13:59:21 +00:00
stickers-templates.gen.ts fix(templates): use url safe base64 in templates (#7354) 2024-06-27 03:44:14 +00:00

@affine/templates

Manages template files for use in AFFiNE. For now we only support onboarding templates.

How to update

Before we offer a better solution, to update the onboarding templates:

  1. run AFFiNE core locally (dev mode)
  2. expose ZipTransformer to window. e.g., import {ZipTransformer} from '@blocksuite/blocks'; window.ZipTransformer = ZipTransformer;
  3. run the following script
    (async () => {
      // make sure ZipTransformer is imported and attached to window
      const { ZipTransformer } = window;
      await Promise.all([...currentWorkspace.blockSuiteWorkspace.pages.values()].map(p => p.load()));
      // wait for a few more seconds
      await new Promise(resolve => setTimeout(resolve, 5000));
      const zipblob = await ZipTransformer.exportPages(currentWorkspace.blockSuiteWorkspace, [...currentWorkspace.blockSuiteWorkspace.pages.values()]);
      const url = URL.createObjectURL(zipblob);
      const a = document.createElement('a');
      a.setAttribute('href', url);
      a.setAttribute('download', `${currentWorkspace.id}.affine.zip`);
      a.click();
      a.remove();
      URL.revokeObjectURL(url);
    })();
    
  4. unzip the file, replace the json files into onboarding folder (no need to include the assets)
  5. run yarn postinstall to update the templates.gen.ts file