Skip to content

Commit 595c1b7

Browse files
Merge pull request #4 from GitbookIO/release-please--branches--main--changes--next--components--lightswitch-api
release: 0.1.0-alpha.1
2 parents 2696c9f + 55caa8d commit 595c1b7

Some content is hidden

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

94 files changed

+8737
-1565
lines changed

.devcontainer/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syntax=docker/dockerfile:1
2+
FROM debian:bookworm-slim AS stainless
3+
4+
RUN apt-get update && apt-get install -y \
5+
nodejs \
6+
npm \
7+
yarnpkg \
8+
&& apt-get clean autoclean
9+
10+
# Ensure UTF-8 encoding
11+
ENV LANG=C.UTF-8
12+
ENV LC_ALL=C.UTF-8
13+
14+
# Yarn
15+
RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn
16+
17+
WORKDIR /workspace
18+
19+
COPY package.json yarn.lock /workspace/
20+
21+
RUN yarn install
22+
23+
COPY . /workspace

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
}
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Configure tool-specific properties.
16+
// "customizations": {},
17+
18+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
19+
// "remoteUser": "root"
20+
}

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint', 'unused-imports', 'prettier'],
4+
rules: {
5+
'no-unused-vars': 'off',
6+
'prettier/prettier': 'error',
7+
'unused-imports/no-unused-imports': 'error',
8+
'no-restricted-imports': [
9+
'error',
10+
{
11+
patterns: [
12+
{
13+
group: ['lightswitch-api', 'lightswitch-api/*'],
14+
message: 'Use a relative import, not a package import.',
15+
},
16+
],
17+
},
18+
],
19+
},
20+
overrides: [
21+
{
22+
files: ['tests/**', 'examples/**'],
23+
rules: {
24+
'no-restricted-imports': 'off',
25+
},
26+
},
27+
],
28+
root: true,
29+
};

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
- next
10+
11+
jobs:
12+
lint:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18'
24+
25+
- name: Bootstrap
26+
run: ./scripts/bootstrap
27+
28+
- name: Check types
29+
run: ./scripts/lint
30+
31+
build:
32+
name: build
33+
runs-on: ubuntu-latest
34+
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '18'
43+
44+
- name: Bootstrap
45+
run: ./scripts/bootstrap
46+
47+
- name: Check build
48+
run: ./scripts/build
49+
test:
50+
name: test
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Set up Node
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '18'
60+
61+
- name: Bootstrap
62+
run: ./scripts/bootstrap
63+
64+
- name: Run tests
65+
run: ./scripts/test
66+

.github/workflows/publish-npm.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/GitbookIO/lightswitch/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
24+
- name: Install dependencies
25+
run: |
26+
yarn install
27+
28+
- name: Publish to NPM
29+
run: |
30+
bash ./bin/publish-npm
31+
env:
32+
NPM_TOKEN: ${{ secrets.LIGHTSWITCH_NPM_TOKEN || secrets.NPM_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'GitbookIO/lightswitch' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
NPM_TOKEN: ${{ secrets.LIGHTSWITCH_NPM_TOKEN || secrets.NPM_TOKEN }}
22+

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
node_modules/
2-
.env
1+
.prism.log
2+
node_modules
3+
yarn-error.log
4+
codegen.log
5+
Brewfile.lock.json
6+
dist
7+
dist-deno
8+
/*.tgz
9+
.idea/
10+

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG.md
2+
/ecosystem-tests/*/**
3+
/node_modules
4+
/deno
5+
6+
# don't format tsc output, will break source maps
7+
/dist

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "always",
3+
"experimentalTernaries": true,
4+
"printWidth": 110,
5+
"singleQuote": true,
6+
"trailingComma": "all"
7+
}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0-alpha.1"
3+
}

0 commit comments

Comments
 (0)