Skip to content

Commit 6b762ba

Browse files
committed
chore: initialize project
1 parent be34633 commit 6b762ba

File tree

153 files changed

+17514
-0
lines changed

Some content is hidden

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

153 files changed

+17514
-0
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.editorconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[*]
2+
charset = utf-8
3+
end_of_line = lf
4+
indent_size = 4
5+
indent_style = tab
6+
insert_final_newline = true
7+
root = true
8+
tab_width = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.{cjs,js,mjs}]
12+
indent_size = 2
13+
indent_style = space
14+
15+
[*.{cts,mts,ts}]
16+
indent_size = 2
17+
indent_style = space
18+
19+
[*.json]
20+
indent_size = 2
21+
indent_style = space
22+
23+
[*.md]
24+
indent_size = 2
25+
indent_style = space
26+
27+
[*.{yml,yaml}]
28+
indent_size = 2
29+
indent_style = space

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.yarn/** linguist-vendored
2+
/.yarn/releases/* binary
3+
/.yarn/plugins/**/* binary
4+
coverage/** linguist-generated
5+
dist/** linguist-generated
6+
yarn.lock linguist-vendored
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: Setup CI
2+
description: Setup CI environment
3+
4+
inputs:
5+
cache-build:
6+
description: 'Should cache the build'
7+
required: false
8+
default: 'true'
9+
cache-key-build:
10+
description: 'Cache key for the build'
11+
required: false
12+
default: ''
13+
cache-node-modules:
14+
description: 'Should cache node_modules'
15+
required: false
16+
default: 'true'
17+
cache-e2e-node-modules:
18+
description: 'Should cache node_modules for E2E'
19+
required: false
20+
default: 'true'
21+
cache-key-for-node-modules:
22+
description: 'Cache key for node_modules'
23+
required: false
24+
default: ''
25+
cache-key-for-e2e-node-modules:
26+
description: 'Cache key for E2E node_modules'
27+
required: false
28+
default: ''
29+
restore-build-cache:
30+
description: 'Should restore the build cache'
31+
required: false
32+
default: 'true'
33+
restore-node-modules-cache:
34+
description: 'Should restore the node_modules cache'
35+
required: false
36+
default: 'true'
37+
restore-e2e-node-modules-cache:
38+
description: 'Should restore the node_modules cache for E2E'
39+
required: false
40+
default: 'true'
41+
42+
outputs:
43+
final-cache-key-build:
44+
description: 'The final build cache key'
45+
value: ${{ steps.determine-cache-key-build.outputs.final-cache-key-build }}
46+
47+
runs:
48+
using: composite
49+
steps:
50+
- name: Determine build cache key
51+
id: determine-cache-key-build
52+
shell: bash
53+
env:
54+
FINAL_BUILD_CACHE_KEY: ${{ inputs.cache-key-build || format('build-cache-{0}-{1}', runner.os, hashFiles('yarn.lock', 'src/**/*', 'babel.config.cjs.cjs', 'babel.config.esm.cjs', 'package.json', 'tsconfig.output.types.json', 'tsconfig.partial.base.json', 'tsconfig.scope.src.json')) }}
55+
run: echo "final-cache-key-build=$(echo "$FINAL_BUILD_CACHE_KEY")" >> $GITHUB_OUTPUT
56+
57+
- name: Determine node_modules cache key
58+
id: determine-cache-key-for-node-modules
59+
shell: bash
60+
env:
61+
FINAL_NODE_MODULES_CACHE_KEY: ${{ inputs.cache-key-for-node-modules || format('node-modules-cache-{0}-{1}', runner.os, hashFiles('yarn.lock')) }}
62+
run: echo "final-cache-key-for-node-modules=$(echo "$FINAL_NODE_MODULES_CACHE_KEY")" >> $GITHUB_OUTPUT
63+
64+
- name: Determine node_modules cache key for E2E
65+
id: determine-cache-key-for-e2e-node-modules
66+
shell: bash
67+
env:
68+
FINAL_E2E_NODE_MODULES_CACHE_KEY: ${{ inputs.cache-key-for-e2e-node-modules || format('e2e-node-modules-cache-{0}-{1}', runner.os, hashFiles('e2e/yarn.lock')) }}
69+
run: echo "final-cache-key-for-e2e-node-modules=$(echo "$FINAL_E2E_NODE_MODULES_CACHE_KEY")" >> $GITHUB_OUTPUT
70+
71+
- name: Setup Node.js LTS
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: lts/*
75+
registry-url: 'https://registry.npmjs.org'
76+
77+
- name: Enable Corepack
78+
shell: bash
79+
run: corepack enable
80+
81+
- name: Restore build cache
82+
id: restore-build-cache
83+
if: ${{ inputs.restore-build-cache == 'true' }}
84+
uses: actions/cache/restore@v4
85+
with:
86+
path: dist
87+
key: ${{ steps.determine-cache-key-build.outputs.final-cache-key-build }}
88+
89+
- name: Restore node_modules cache
90+
id: restore-node-modules-cache
91+
if: ${{ inputs.restore-node-modules-cache == 'true' }}
92+
uses: actions/cache/restore@v4
93+
with:
94+
path: node_modules
95+
key: ${{ steps.determine-cache-key-for-node-modules.outputs.final-cache-key-for-node-modules }}
96+
97+
- name: Restore node_modules cache for E2E
98+
id: restore-e2e-node-modules-cache
99+
if: ${{ inputs.restore-e2e-node-modules-cache == 'true' }}
100+
uses: actions/cache/restore@v4
101+
with:
102+
path: e2e/node_modules
103+
key: ${{ steps.determine-cache-key-for-e2e-node-modules.outputs.final-cache-key-for-e2e-node-modules }}
104+
105+
- name: Install dependencies
106+
id: install-dependencies
107+
if: ${{ steps.restore-node-modules-cache.outputs.cache-hit != 'true' }}
108+
shell: bash
109+
run: yarn install --immutable
110+
111+
- name: Install E2E dependencies
112+
id: install-e2e-dependencies
113+
if: ${{ steps.restore-e2e-node-modules-cache.outputs.cache-hit != 'true' }}
114+
shell: bash
115+
run: yarn e2e:yarn install --immutable
116+
117+
- name: Cache node_modules
118+
id: cache-node-modules
119+
if: ${{ inputs.cache-node-modules == 'true' && steps.restore-node-modules-cache.outputs.cache-hit != 'true' && steps.install-dependencies.conclusion == 'success' }}
120+
uses: actions/cache/save@v4
121+
with:
122+
path: node_modules
123+
key: ${{ steps.determine-cache-key-for-node-modules.outputs.final-cache-key-for-node-modules }}
124+
125+
- name: Cache node_modules for E2E
126+
id: cache-e2e-node-modules
127+
if: ${{ inputs.cache-e2e-node-modules == 'true' && steps.restore-e2e-node-modules-cache.outputs.cache-hit != 'true' && steps.install-e2e-dependencies.conclusion == 'success' }}
128+
uses: actions/cache/save@v4
129+
with:
130+
path: e2e/node_modules
131+
key: ${{ steps.determine-cache-key-for-e2e-node-modules.outputs.final-cache-key-for-e2e-node-modules }}
132+
133+
- name: Prepare
134+
if: ${{ steps.restore-build-cache.outputs.cache-hit != 'true' }}
135+
shell: bash
136+
run: yarn prepare
137+
138+
- name: Prepare E2E
139+
if: ${{ steps.restore-e2e-node-modules-cache.outputs.cache-hit != 'true' }}
140+
shell: bash
141+
run: yarn e2e:yarn prepare
142+
143+
- name: Build types
144+
id: build-types
145+
if: steps.restore-build-cache.outputs.cache-hit != 'true'
146+
shell: bash
147+
run: yarn build::types
148+
149+
- name: Build CJS
150+
id: build-cjs
151+
if: steps.restore-build-cache.outputs.cache-hit != 'true'
152+
shell: bash
153+
run: yarn build::cjs
154+
155+
- name: Build ESM
156+
id: build-esm
157+
if: steps.restore-build-cache.outputs.cache-hit != 'true'
158+
shell: bash
159+
run: yarn build::esm
160+
161+
- name: Update package exports
162+
id: update-package-exports
163+
if: steps.restore-build-cache.outputs.cache-hit != 'true'
164+
shell: bash
165+
run: yarn exports:update
166+
167+
- name: Cache build
168+
id: cache-build
169+
if: ${{ inputs.cache-build == 'true' && steps.restore-build-cache.outputs.cache-hit != 'true' && steps.build-cjs.conclusion == 'success' && steps.build-esm.conclusion == 'success' && steps.build-types.conclusion == 'success' && steps.update-package-exports.conclusion == 'success' }}
170+
uses: actions/cache/save@v4
171+
with:
172+
path: dist
173+
key: ${{ steps.determine-cache-key-build.outputs.final-cache-key-build }}

.github/dependabot.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "10:00"
8+
timezone: "Europe/Istanbul"
9+
groups:
10+
babel:
11+
patterns:
12+
- "@babel/*"
13+
- "@types/babel__*"
14+
- "babel-*"
15+
exclude-patterns:
16+
- "babel-jest"
17+
changesets:
18+
patterns:
19+
- "@changesets/*"
20+
commitlint:
21+
patterns:
22+
- "@commitlint/*"
23+
eslint:
24+
patterns:
25+
- "@cspell/*"
26+
- "@eslint/*"
27+
- "@types/node"
28+
- "eslint"
29+
- "eslint-*"
30+
- "*-eslint"
31+
- "*/eslint-*"
32+
- "globals"
33+
jest:
34+
patterns:
35+
- "jest"
36+
- "babel-jest"

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
env:
18+
CI: true
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Setup
27+
uses: ./.github/actions/ci-setup
28+
29+
test:
30+
if: ${{ needs.build.result == 'success' }}
31+
runs-on: ubuntu-latest
32+
needs: [build]
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Setup
37+
uses: ./.github/actions/ci-setup
38+
- name: Test
39+
run: yarn test
40+
41+
lint:
42+
if: ${{ needs.test.result == 'success' }}
43+
runs-on: ubuntu-latest
44+
needs: [test]
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
- name: Setup
49+
uses: ./.github/actions/ci-setup
50+
- name: Lint
51+
run: yarn lint

0 commit comments

Comments
 (0)