Skip to content

Commit 417893d

Browse files
DominicGBauerDominicGBauer
andauthored
chore: add angular demo (#62)
Co-authored-by: DominicGBauer <dominic@nomanini.com>
1 parent 1229e52 commit 417893d

Some content is hidden

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

54 files changed

+5248
-45
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,29 @@ PowerSync is a service and set of SDKs that keeps Postgres databases in sync wit
1212

1313
- [packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md)
1414
- React Native SDK implementation (extension of `packages/powersync-sdk-common`)
15-
15+
1616
- [packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md)
1717
- JS Web SDK implementation (extension of `packages/powersync-sdk-common`)
18-
18+
1919
- [packages/powersync-react](./packages/powersync-react/README.md)
2020
- React integration for PowerSync.
2121

2222
- [packages/powersync-attachments](./packages/powersync-attachments/README.md)
2323
- Attachments helper package for React Native.
24-
24+
2525
- [packages/powersync-sdk-common](./packages/powersync-sdk-common/README.md)
2626
- Shared package: TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation.
2727

2828
## Demo Apps / Example Projects
2929

3030
Demo applications are located in the [`demos/`](./demos/) directory.
3131

32-
- [demos/nextjs-supabase-todolist](./demos/nextjs-supabase-todolist/): A Next.js to-do list example app using the PowerSync Web SDK and a Supabase backend.
33-
- [demos/yjs-nextjs-supabase-text-collab](./demos/yjs-nextjs-supabase-text-collab/README.md): A Next.js real-time text editing collaboration example app powered by [Yjs](https://github.com/yjs/yjs) CRDTs and [Tiptap](https://tiptap.dev/), using the PowerSync Web SDK and a Supabase backend.
34-
- [demos/react-native-supabase-todolist](./demos/react-native-supabase-todolist) A React Native to-do list example app using a Supabase backend.
35-
- [demos/example-webpack](./demos/example-webpack/README.md) contains a minimal example demonstrating bundling with Webpack.
36-
- [demos/example-vite](./demos/example-vite/README.md) contains a minimal example demonstrating bundling with Vite.
32+
- [demos/nextjs-supabase-todolist](./demos/nextjs-supabase-todolist/): A Next.js to-do list example app using the PowerSync Web SDK and a Supabase backend.
33+
- [demos/yjs-nextjs-supabase-text-collab](./demos/yjs-nextjs-supabase-text-collab/README.md): A Next.js real-time text editing collaboration example app powered by [Yjs](https://github.com/yjs/yjs) CRDTs and [Tiptap](https://tiptap.dev/), using the PowerSync Web SDK and a Supabase backend.
34+
- [demos/react-native-supabase-todolist](./demos/react-native-supabase-todolist): A React Native to-do list example app using a Supabase backend.
35+
- [demos/angular-supabase-todolist](./demos/angular-supabase-todolist/README.md) An Angular to-do list example app using the PowerSync Web SDK and a Supabase backend.
36+
- [demos/example-webpack](./demos/example-webpack/README.md): A minimal example demonstrating bundling with Webpack.
37+
- [demos/example-vite](./demos/example-vite/README.md): A minimal example demonstrating bundling with Vite.
3738

3839
# Development
3940

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*
131+
# See http://help.github.com/ignore-files/ for more about ignoring files.
132+
133+
# Compiled output
134+
/dist
135+
/tmp
136+
/out-tsc
137+
/bazel-out
138+
139+
# Node
140+
/node_modules
141+
npm-debug.log
142+
yarn-error.log
143+
144+
# IDEs and editors
145+
.idea/
146+
.project
147+
.classpath
148+
.c9/
149+
*.launch
150+
.settings/
151+
*.sublime-workspace
152+
153+
# Visual Studio Code
154+
.vscode/*
155+
.history/*
156+
157+
# Miscellaneous
158+
/.angular/cache
159+
.sass-cache/
160+
/connect.lock
161+
/coverage
162+
/libpeerconnection.log
163+
testem.log
164+
/typings
165+
166+
# System files
167+
.DS_Store
168+
Thumbs.db
169+
170+
environment.ts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# PowerSync + Supabase Angular Demo: Todo List
2+
3+
## Note: Alpha Release
4+
5+
This demo is currently in an alpha release.
6+
7+
## Overview
8+
9+
Demo app demonstrating use of the [PowerSync SDK for Web](https://www.npmjs.com/package/@journeyapps/powersync-sdk-web) together with Supabase.
10+
11+
A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.com/integration-guides/supabase).
12+
13+
## Quick Start
14+
15+
1. Run `pnpm install`
16+
2. Run `pnpm watch` to build application and check for code changes
17+
3. In a new terminal run `pnpm start` to start the server
18+
4. Go to <http://localhost:8080>
19+
20+
**Note:** The Angular development server (`pnpm serve`) doesn't support service worker applications
21+
22+
## Development Server
23+
24+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
25+
26+
## Code Scaffolding
27+
28+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
29+
30+
## Build
31+
32+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
33+
34+
## Further Help
35+
36+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"powersync-angular-demo": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-builders/custom-webpack:browser",
19+
"options": {
20+
"customWebpackConfig": {
21+
"path": "./extra-webpack.config.js"
22+
},
23+
"allowedCommonJsDependencies": [
24+
"object-hash",
25+
"event-iterator",
26+
"can-ndjson-stream",
27+
"uuid",
28+
"lodash",
29+
"js-logger",
30+
"websocket"
31+
],
32+
"outputPath": "dist",
33+
"index": "src/index.html",
34+
"main": "src/main.ts",
35+
"tsConfig": "./tsconfig.app.json",
36+
"styles": ["src/styles.scss"],
37+
"assets": ["src/favicon.ico", "src/assets", "src/manifest.webmanifest"],
38+
"serviceWorker": true,
39+
"ngswConfigPath": "ngsw-config.json"
40+
},
41+
"configurations": {
42+
"production": {
43+
"budgets": [
44+
{
45+
"type": "initial",
46+
"maximumWarning": "500kb",
47+
"maximumError": "5mb"
48+
},
49+
{
50+
"type": "anyComponentStyle",
51+
"maximumWarning": "2kb",
52+
"maximumError": "4kb"
53+
}
54+
],
55+
"outputHashing": "all",
56+
"serviceWorker": true,
57+
"ngswConfigPath": "ngsw-config.json"
58+
},
59+
"development": {
60+
"optimization": false,
61+
"extractLicenses": false,
62+
"sourceMap": true
63+
}
64+
},
65+
"defaultConfiguration": "production"
66+
},
67+
"serve": {
68+
"builder": "@angular-builders/custom-webpack:dev-server",
69+
"configurations": {
70+
"production": {
71+
"buildTarget": "powersync-angular-demo:build:production"
72+
},
73+
"development": {
74+
"buildTarget": "powersync-angular-demo:build:development"
75+
}
76+
},
77+
"defaultConfiguration": "development"
78+
},
79+
"extract-i18n": {
80+
"builder": "@angular-devkit/build-angular:extract-i18n",
81+
"options": {
82+
"buildTarget": "powersync-angular-demo:build"
83+
}
84+
}
85+
}
86+
}
87+
},
88+
"cli": {
89+
"analytics": false
90+
}
91+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const webpack = require('webpack');
2+
const pkg = require('./package.json');
3+
const { inspect } = require('util');
4+
const path = require('path');
5+
6+
module.exports = (config, options, targetOptions) => {
7+
delete config.optimization;
8+
return {
9+
...config,
10+
module: {
11+
rules: config.module.rules
12+
},
13+
resolve: config.resolve,
14+
plugins: config.plugins,
15+
output: {
16+
filename: config.filename,
17+
path: config.path,
18+
clean: true
19+
},
20+
resolveLoader: { symlinks: true },
21+
cache: config.cache,
22+
target: config.target,
23+
experiments: config.experiments,
24+
stats: config.stats,
25+
devtool: 'source-map',
26+
mode: 'development'
27+
};
28+
};

0 commit comments

Comments
 (0)