Skip to content

Commit 49bcac1

Browse files
authored
Merge branch 'main' into refactor-added-missing-private-declaration
2 parents c2d550a + 59a9e18 commit 49bcac1

File tree

95 files changed

+4034
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+4034
-374
lines changed

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
time: "01:00"
9+
timezone: "Europe/Berlin"
10+
pull-request-branch-name:
11+
separator: "-"
12+
13+
# Daily: Check minor and patch updates
14+
- package-ecosystem: "npm"
15+
directory: "/"
16+
open-pull-requests-limit: 10
17+
schedule:
18+
interval: "daily"
19+
time: "01:00"
20+
timezone: "Europe/Berlin"
21+
pull-request-branch-name:
22+
separator: "-"
23+
versioning-strategy: increase

.github/workflows/00-init.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Init Workflow
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
init:
8+
name: Init
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: ⏬ Checkout repo
12+
uses: actions/checkout@v4
13+
14+
- name: 🔄 Init Cache Default
15+
uses: ./.github/actions/npm-cache
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: "NPM Cache Action"
3+
description: "Initialize NPM Cache"
4+
inputs:
5+
nodeModulesPath:
6+
description: "Path for node_modules"
7+
required: false
8+
default: "**/node_modules"
9+
packageLockPath:
10+
description: "Path for package-lock.json"
11+
required: false
12+
default: "**/package-lock.json"
13+
nodeVersion:
14+
description: "Node version"
15+
required: false
16+
default: "20"
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: 🆙 Setup node
21+
# pick the Node version to use and install it
22+
# https://github.com/actions/setup-node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ inputs.nodeVersion }}
26+
27+
- name: Display node and npm version
28+
shell: bash
29+
run: |
30+
node --version
31+
npm --version
32+
33+
- name: 🆒 Init Cache
34+
uses: actions/cache@v4
35+
id: "cache"
36+
with:
37+
path: ${{ inputs.nodeModulesPath }}
38+
key: ${{ runner.os }}-node-${{ inputs.nodeVersion }}-${{ hashFiles(inputs.packageLockPath) }}
39+
restore-keys: |
40+
${{ runner.os }}-node-${{ inputs.nodeVersion }}
41+
42+
- name: 🎄🎸🥊 Log Cache Hit
43+
shell: bash
44+
env:
45+
HIT: ${{ steps.cache.outputs.cache-hit }}
46+
run: echo $HIT
47+
48+
- name: ⏬ NPM ci
49+
shell: bash
50+
if: steps.cache.outputs.cache-hit != 'true'
51+
run: |
52+
npm ci

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Upload Figma Plugin/Widget to release page
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
init:
10+
uses: ./.github/workflows/00-init.yml
11+
12+
publish:
13+
name: Upload Figma Plugin/Widget to release page
14+
runs-on: ubuntu-latest
15+
needs: [init]
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
package: [handover]
20+
permissions:
21+
id-token: write
22+
contents: write
23+
steps:
24+
- name: ⏬ Checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: 🔄 Init Cache
28+
uses: ./.github/actions/npm-cache
29+
30+
- name: 🔨 Build Packages
31+
run: npm run build:${{ matrix.package }}
32+
33+
- name: ⏫ Upload Release Assets
34+
id: upload-release-asset
35+
uses: actions/github-script@v7
36+
env:
37+
ICON_RELEASE_ID: ${{ vars.ICON_RELEASE_ID }}
38+
with:
39+
result-encoding: json
40+
script: |
41+
const { default: release } = await import('${{ github.workspace }}/.github/scripts/release/index.js');
42+
const workspace = '${{ github.workspace }}';
43+
const zipName = '${{ matrix.package }}';
44+
const srcDir = 'packages/${{ matrix.package }}';
45+
return await release({github, context, workspace, zipName, srcDir})
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Handles full release process for all assets
3+
*/
4+
5+
import uploadAsset from "./upload-asset.js";
6+
import zipFolder from "./zip-folder.js";
7+
8+
const release = async ({ github, context, workspace, zipName, srcDir }) => {
9+
const { id: release_id } = context.payload.release;
10+
11+
// 3. Upload latest icon assets
12+
const destPath = `${workspace}/${srcDir}`;
13+
const assetPath = `${destPath}/${zipName}.zip`;
14+
await zipFolder(destPath, assetPath);
15+
16+
// 3.1 Upload to current release
17+
await uploadAsset({
18+
github,
19+
context,
20+
release_id,
21+
assetName: zipName,
22+
assetPath,
23+
});
24+
};
25+
26+
export default release;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Uploads a file to a release
3+
*/
4+
import FS from 'node:fs';
5+
6+
const uploadAsset = async ({
7+
github,
8+
context,
9+
release_id,
10+
assetName,
11+
assetPath
12+
}) => {
13+
const { repo, owner } = context.repo;
14+
15+
const uploadRelease = await github.rest.repos.getRelease({
16+
owner,
17+
repo,
18+
release_id
19+
});
20+
21+
const { assets = [] } = uploadRelease.data;
22+
23+
const foundAsset = assets?.find((asset) => asset.name === assetName);
24+
25+
if (foundAsset) {
26+
await github.rest.repos.deleteReleaseAsset({
27+
owner,
28+
repo,
29+
asset_id: foundAsset.id
30+
});
31+
}
32+
33+
return await github.rest.repos.uploadReleaseAsset({
34+
owner,
35+
repo,
36+
release_id,
37+
name: assetName,
38+
data: FS.readFileSync(assetPath)
39+
});
40+
};
41+
42+
export default uploadAsset;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Zips a complete folder */
2+
3+
import AdmZip from "adm-zip";
4+
5+
const zipFolder = async (destPath, assetPath) => {
6+
const zip = new AdmZip();
7+
zip.addLocalFolder(`${destPath}/dist`);
8+
zip.addLocalFile(`${destPath}/manifest.json`);
9+
return zip.writeZipPromise(assetPath);
10+
};
11+
12+
export default zipFolder;

CODE-OF-CONDUCT.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official email address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Global Repository owners
2+
# see https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners for details of syntax
3+

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contributing
2+
3+
Thanks for your interest in our project. Contributions are welcome. Feel free to [open an issue](https://github.com/db-ui/figma-hub/issues/new) with questions or reporting ideas and bugs, or [open pull requests](https://github.com/db-ui/figma-hub/compare) to contribute code.
4+
5+
We are committed to fostering a welcoming, respectful, and harassment-free environment. Be kind!
6+
7+
## Before you commit
8+
9+
Please make sure that husky is installed correctly to validate your changes.
10+
11+
Moreover, you need to duplicate `.env.template` as `.env` and type your own email address. This ensures that you have the correct email set for this project.
12+
13+
### Conventions
14+
15+
Please be aware that we have some [code and git commit (message and branch naming) conventions](docs/conventions.md), that we ensure with some linting tools.

0 commit comments

Comments
 (0)