Skip to content

Commit

Permalink
chore: Rename linearlite example to linearlite-read-only (#2132)
Browse files Browse the repository at this point in the history
The pglite based linearlite example is going to take this ones place -
#2123. Splitting the rename out as a separate PR so that the history is
maintained when merged to main.
  • Loading branch information
samwillis authored Dec 9, 2024
1 parent 255da54 commit fc8fccf
Show file tree
Hide file tree
Showing 121 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
restore-keys: |
sst-cache-main-${{ runner.os }}
- name: Deploy Linearlite
working-directory: examples/linearlite
- name: Deploy Linearlite Read Only
working-directory: examples/linearlite-read-only
run: |
pnpm sst deploy --stage ${{ env.DEPLOY_ENV }}
if [ -f ".sst/outputs.json" ]; then
linearlite=$(jq -r '.website' .sst/outputs.json)
echo "linearlite=$linearlite" >> $GITHUB_ENV
linearlite_read_only=$(jq -r '.website' .sst/outputs.json)
echo "linearlite_read_only=$linearlite_read_only" >> $GITHUB_ENV
else
echo "sst outputs file not found. Exiting."
exit 1
Expand All @@ -79,12 +79,12 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const linearlite = process.env.linearlite;
const linearlite_read_only = process.env.linearlite_read_only;
const nextjs = process.env.nextjs;
const prNumber = context.issue.number;
const commentBody = `## Examples
- linearlite: ${linearlite}
- linearlite-read-only: ${linearlite_read_only}
- nextjs: ${nextjs}
`;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Linearlite
# Linearlite Read Only

This is an example Linear clone developed using ElectricSQL.

Expand All @@ -22,7 +22,7 @@ pnpm run -r build
Navigate back to this directory:

```shell
cd examples/linearlite
cd examples/linearlite-read-only
```

Start the example backend services using [Docker Compose](https://docs.docker.com/compose/):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@electric-examples/linearlite",
"name": "@electric-examples/linearlite-read-only",
"version": "0.0.1",
"license": "Apache-2.0",
"private": true,
"type": "module",
"scripts": {
"backend:down": "PROJECT_NAME=linearlite pnpm -C ../../ run example-backend:down",
"backend:up": "PROJECT_NAME=linearlite pnpm -C ../../ run example-backend:up && pnpm db:migrate && pnpm db:load-data",
"backend:down": "PROJECT_NAME=linearlite-read-only pnpm -C ../../ run example-backend:down",
"backend:up": "PROJECT_NAME=linearlite-read-only pnpm -C ../../ run example-backend:up && pnpm db:migrate && pnpm db:load-data",
"build": "vite build",
"db:load-data": "dotenv -e ../../.env.dev -- node ./db/load_data.js",
"db:migrate": "dotenv -e ../../.env.dev -- pnpm exec pg-migrations apply --directory ./db/migrations",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { execSync } from 'child_process'
export default $config({
app(input) {
return {
name: `linearlite`,
name: `linearlite-read-only`,
removal: input?.stage === `production` ? `retain` : `remove`,
home: `aws`,
providers: {
Expand All @@ -25,12 +25,12 @@ export default $config({
branchId: project.defaultBranchId,
}

const db = new neon.Database(`linearlite`, {
const db = new neon.Database(`linearlite-read-only`, {
...base,
name:
$app.stage === `Production`
? `linearlite-production`
: `linearlite-${$app.stage}`,
? `linearlite-read-only-production`
: `linearlite-read-only-${$app.stage}`,
ownerName: `neondb_owner`,
})

Expand All @@ -51,7 +51,7 @@ export default $config({
website: website.url,
}
} catch (e) {
console.error(`Failed to deploy linearlite stack`, e)
console.error(`Failed to deploy linearlite-read-only stack`, e)
}
},
})
Expand All @@ -77,18 +77,18 @@ function loadData(uri: string) {
function deployLinearLite(
electricInfo: $util.Output<{ id: string; token: string }>
) {
return new sst.aws.StaticSite(`linearlite`, {
return new sst.aws.StaticSite(`linearlite-read-only`, {
environment: {
VITE_ELECTRIC_URL: process.env.ELECTRIC_API!,
VITE_ELECTRIC_TOKEN: electricInfo.token,
VITE_DATABASE_ID: electricInfo.id,
},
build: {
command: `pnpm run --filter @electric-sql/client --filter @electric-sql/react --filter @electric-examples/linearlite build`,
command: `pnpm run --filter @electric-sql/client --filter @electric-sql/react --filter @electric-examples/linearlite-read-only build`,
output: `dist`,
},
domain: {
name: `linearlite${$app.stage === `production` ? `` : `-stage-${$app.stage}`}.electric-sql.com`,
name: `linearlite-read-only${$app.stage === `production` ? `` : `-stage-${$app.stage}`}.electric-sql.com`,
dns: sst.cloudflare.dns(),
},
})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc8fccf

Please sign in to comment.