Skip to content

Commit 010292e

Browse files
committed
chore: init repo
0 parents  commit 010292e

35 files changed

+12053
-0
lines changed

.github/CODEOWNERS

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
16+
17+
.github/ @googleworkspace/workspace-devrel-dpe

.github/blunderbuss.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
assign_issues:
16+
- jpoehnelt
17+
assign_prs:
18+
- jpoehnelt

.github/docs.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import fs from "node:fs";
2+
import prettier from "prettier";
3+
4+
const START = "<!-- START docs -->";
5+
const END = "<!-- END docs -->";
6+
7+
// read docs files
8+
const docs = ["docs/drive-picker.md", "docs/drive-picker-docs-view.md"]
9+
.map((file) => {
10+
const anchor = file.split("/").pop().replace(/\.md$/, "");
11+
return `<a name="${anchor}"></a>\n${fs.readFileSync(file, "utf-8")}`;
12+
})
13+
.join("\n")
14+
.replace(/^(#+)/gm, (_, p1) => `${p1}#`)
15+
.trim();
16+
17+
// insert into README.md
18+
const readme = fs.readFileSync("README.md", "utf-8");
19+
20+
const startIdx = readme.indexOf(START) + START.length;
21+
const endIdx = readme.indexOf(END);
22+
23+
const updated = await prettier.format(
24+
`${readme.substring(0, startIdx)}\n${docs}\n${readme.substring(endIdx)}`,
25+
{ parser: "markdown" },
26+
);
27+
28+
fs.writeFileSync("README.md", updated);

.github/sync-repo-settings.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# .github/sync-repo-settings.yaml
16+
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings for app options.
17+
rebaseMergeAllowed: true
18+
squashMergeAllowed: true
19+
mergeCommitAllowed: false
20+
deleteBranchOnMerge: true
21+
branchProtectionRules:
22+
- pattern: main
23+
isAdminEnforced: false
24+
requiresStrictStatusChecks: false
25+
requiredStatusCheckContexts:
26+
# .github/workflows/test.yml with a job called "test"
27+
- "test"
28+
# .github/workflows/lint.yml with a job called "lint"
29+
- "lint"
30+
# Google bots below
31+
- "cla/google"
32+
- "snippet-bot check"
33+
- "header-check"
34+
- "conventionalcommits.org"
35+
requiredApprovingReviewCount: 1
36+
requiresCodeOwnerReviews: true
37+
permissionRules:
38+
- team: workspace-devrel-dpe
39+
permission: admin
40+
- team: workspace-devrel
41+
permission: push

.github/workflows/automation.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
---
15+
name: Automation
16+
on: [ push, pull_request, workflow_dispatch ]
17+
jobs:
18+
dependabot:
19+
runs-on: ubuntu-latest
20+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{secrets.GOOGLEWORKSPACE_BOT_TOKEN}}
24+
steps:
25+
- name: approve
26+
run: gh pr review --approve "$PR_URL"
27+
- name: merge
28+
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
29+

.github/workflows/docs.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Docs
16+
on: [push, pull_request]
17+
jobs:
18+
docs:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v2
23+
- uses: actions/setup-node@v4
24+
with:
25+
cache: "pnpm"
26+
- run: pnpm install
27+
- run: pnpm build
28+
- run: |
29+
if [ -n "$(git status --porcelain README.md)" ]; then
30+
echo "README.md is out of date. Please run 'pnpm build' and commit the changes."
31+
exit 1
32+
fi

.github/workflows/lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Lint
16+
on: [push, pull_request]
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v2
23+
- uses: actions/setup-node@v4
24+
with:
25+
cache: "pnpm"
26+
- run: pnpm install
27+
- run: pnpm lint

.github/workflows/release.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Release
16+
on:
17+
push:
18+
branches:
19+
- main
20+
concurrency: release
21+
permissions: {}
22+
jobs:
23+
release:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
steps:
29+
- uses: googleapis/release-please-action@v4
30+
id: release
31+
with:
32+
token: ${{secrets.GOOGLEWORKSPACE_BOT_TOKEN}}
33+
release-type: node
34+
- uses: actions/checkout@v4
35+
- uses: pnpm/action-setup@v2
36+
- uses: actions/setup-node@v4
37+
with:
38+
cache: "pnpm"
39+
- run: pnpm install
40+
- run: pnpm build
41+
- run: git status
42+
- run: pnpm publish --no-git-checks
43+
env:
44+
NPM_TOKEN: ${{secrets.NPM_WOMBAT_TOKEN}}
45+
if: ${{ steps.release.outputs.release_created }}

.github/workflows/test.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Test
16+
on: [push, pull_request]
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v2
23+
- uses: actions/setup-node@v4
24+
with:
25+
cache: "pnpm"
26+
- run: pnpm install
27+
- run: pnpm build
28+
- run: pnpm check
29+
- run: pnpm test

.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
coverage
12+
.wireit
13+
dist
14+
dist-ssr
15+
*.local
16+
17+
# Editor directories and files
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
*.tgz
27+
*storybook.log
28+
29+
docs/**/*.md

.husky/pre-commit

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
pnpm exec lint-staged

.npmignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*
2+
!dist/*.d.ts
3+
!custom-elements.json
4+
!dist/**/*.js
5+
!dist/**/*.map
6+
!docs/**
7+
dist/**/*test*

.storybook/main.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import type { StorybookConfig } from "@storybook/web-components-vite";
18+
19+
const config: StorybookConfig = {
20+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
21+
addons: ["@storybook/addon-actions", "@storybook/addon-essentials"],
22+
framework: {
23+
name: "@storybook/web-components-vite",
24+
options: {},
25+
},
26+
};
27+
export default config;

.storybook/preview.ts

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import type { Preview } from "@storybook/web-components";
18+
// @ts-ignore
19+
import DocumentationTemplate from "./DocumentationTemplate.mdx";
20+
21+
const preview: Preview = {
22+
parameters: {
23+
controls: {
24+
matchers: {
25+
color: /(background|color)$/i,
26+
date: /Date$/i,
27+
},
28+
},
29+
docs: {
30+
stories: {
31+
inline: false,
32+
},
33+
page: DocumentationTemplate,
34+
},
35+
},
36+
};
37+
38+
export default preview;

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome", "esbenp.prettier-vscode"]
3+
}

.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"[markdown]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
}
6+
}

0 commit comments

Comments
 (0)