Skip to content

Commit 46ad482

Browse files
committed
v1.0.0
1 parent 38a0a1f commit 46ad482

File tree

8 files changed

+92
-28
lines changed

8 files changed

+92
-28
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "create-tinybase",
3-
"version": "0.3.1",
3+
"version": "1.0.0",
44
"author": "jamesgpearce",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/tinyplex/create-tinybase.git"
88
},
99
"license": "MIT",
1010
"homepage": "https://tinybase.org",
11-
"description": "The CLI to build new apps using TinyBase, a reactive data store and sync engine.",
11+
"description": "A command-line tool to create TinyBase apps with full synchronization and local-first capabilities.",
1212
"keywords": [
1313
"tiny",
1414
"sync engine",
@@ -28,7 +28,7 @@
2828
},
2929
"scripts": {
3030
"build": "node build.js",
31-
"ts": "tsc --noEmit",
31+
"ts": "tsc --noEmit -p src/tsconfig.json && tsc --noEmit -p test/tsconfig.json",
3232
"prettier": "prettier --check .",
3333
"lint": "eslint .",
3434
"test": "npm run build && vitest run --exclude test/e2e",

screenshots/chat.png

475 Bytes
Loading

templates/client/index.html.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@
168168
A tic-tac-toe game demonstrating turn-based logic and computed game state.
169169
{{/if}}
170170
<br><br>
171-
Built with {{#if typescript}}TypeScript{{#if schemas}} (using typed store schemas){{/if}}{{else}}JavaScript{{/if}}{{#if react}} and React{{/if}}.
171+
Built with: {{#if typescript}}TypeScript{{#if schemas}} (using typed store schemas){{/if}}{{else}}JavaScript{{/if}}{{#if react}} and React{{/if}}.{{#if persist}}
172+
<br><br>
173+
Persistence: {{#if persistLocalStorage}}Local Storage{{else if persistSqlite}}SQLite{{else if persistPglite}}PGlite{{/if}}.{{/if}}{{#if sync}}
174+
<br><br>
175+
Sync: {{#if (eq syncType "remote")}}Remote{{else if (eq syncType "node")}}Node.js Server{{else if (eq syncType "durable-objects")}}Durable Objects{{/if}}.{{/if}}
172176
</div>
173177
</div>
174178
</div>

test/__snapshots__/cli.test.ts.snap

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ with the store.
224224
A real-time chat application demonstrating TinyBase's reactive
225225
data management.
226226
<br /><br />
227-
Built with JavaScript and React.
227+
Built with: JavaScript and React.
228+
<br /><br />
229+
Persistence: Local Storage.
228230
</div>
229231
</div>
230232
</div>
@@ -905,7 +907,9 @@ with the store.
905907
A real-time chat application demonstrating TinyBase's reactive
906908
data management.
907909
<br /><br />
908-
Built with JavaScript and React.
910+
Built with: JavaScript and React.
911+
<br /><br />
912+
Persistence: SQLite.
909913
</div>
910914
</div>
911915
</div>
@@ -1633,7 +1637,9 @@ with the store.
16331637
A collaborative drawing canvas showcasing TinyBase's state
16341638
synchronization.
16351639
<br /><br />
1636-
Built with JavaScript and React.
1640+
Built with: JavaScript and React.
1641+
<br /><br />
1642+
Persistence: Local Storage.
16371643
</div>
16381644
</div>
16391645
</div>
@@ -2360,7 +2366,9 @@ with the store.
23602366
A tic-tac-toe game demonstrating turn-based logic and computed
23612367
game state.
23622368
<br /><br />
2363-
Built with JavaScript and React.
2369+
Built with: JavaScript and React.
2370+
<br /><br />
2371+
Persistence: Local Storage.
23642372
</div>
23652373
</div>
23662374
</div>
@@ -3025,7 +3033,9 @@ with the store.
30253033
A simple todo list application demonstrating TinyBase's reactive
30263034
data management with CRUD operations.
30273035
<br /><br />
3028-
Built with JavaScript and React.
3036+
Built with: JavaScript and React.
3037+
<br /><br />
3038+
Persistence: Local Storage.
30293039
</div>
30303040
</div>
30313041
</div>
@@ -3702,7 +3712,11 @@ The \`server\` directory contains your Cloudflare Durable Objects WebSocket serv
37023712
A simple todo list application demonstrating TinyBase's reactive
37033713
data management with CRUD operations.
37043714
<br /><br />
3705-
Built with JavaScript and React.
3715+
Built with: JavaScript and React.
3716+
<br /><br />
3717+
Persistence: SQLite.
3718+
<br /><br />
3719+
Sync: Durable Objects.
37063720
</div>
37073721
</div>
37083722
</div>
@@ -4452,7 +4466,9 @@ Your data is automatically saved and restored when you reload the page.
44524466
A real-time chat application demonstrating TinyBase's reactive
44534467
data management.
44544468
<br /><br />
4455-
Built with JavaScript.
4469+
Built with: JavaScript.
4470+
<br /><br />
4471+
Persistence: Local Storage.
44564472
</div>
44574473
</div>
44584474
</div>
@@ -5081,7 +5097,9 @@ Your data is automatically saved and restored when you reload the page.
50815097
A collaborative drawing canvas showcasing TinyBase's state
50825098
synchronization.
50835099
<br /><br />
5084-
Built with JavaScript.
5100+
Built with: JavaScript.
5101+
<br /><br />
5102+
Persistence: Local Storage.
50855103
</div>
50865104
</div>
50875105
</div>
@@ -5746,7 +5764,7 @@ The app uses **TinyBase** to manage application state in a reactive data store.
57465764
A collaborative drawing canvas showcasing TinyBase's state
57475765
synchronization.
57485766
<br /><br />
5749-
Built with JavaScript.
5767+
Built with: JavaScript.
57505768
</div>
57515769
</div>
57525770
</div>
@@ -6404,7 +6422,9 @@ Your data is automatically saved and restored when you reload the page.
64046422
A tic-tac-toe game demonstrating turn-based logic and computed
64056423
game state.
64066424
<br /><br />
6407-
Built with JavaScript.
6425+
Built with: JavaScript.
6426+
<br /><br />
6427+
Persistence: Local Storage.
64086428
</div>
64096429
</div>
64106430
</div>
@@ -6998,7 +7018,9 @@ Your data is automatically saved and restored when you reload the page.
69987018
A simple todo list application demonstrating TinyBase's reactive
69997019
data management with CRUD operations.
70007020
<br /><br />
7001-
Built with JavaScript.
7021+
Built with: JavaScript.
7022+
<br /><br />
7023+
Persistence: Local Storage.
70027024
</div>
70037025
</div>
70047026
</div>
@@ -7579,7 +7601,9 @@ with the store.
75797601
A real-time chat application demonstrating TinyBase's reactive
75807602
data management.
75817603
<br /><br />
7582-
Built with TypeScript and React.
7604+
Built with: TypeScript and React.
7605+
<br /><br />
7606+
Persistence: Local Storage.
75837607
</div>
75847608
</div>
75857609
</div>
@@ -8356,7 +8380,11 @@ The \`server\` directory contains your Node.js WebSocket server.
83568380
A real-time chat application demonstrating TinyBase's reactive
83578381
data management.
83588382
<br /><br />
8359-
Built with TypeScript and React.
8383+
Built with: TypeScript and React.
8384+
<br /><br />
8385+
Persistence: Local Storage.
8386+
<br /><br />
8387+
Sync: Node.js Server.
83608388
</div>
83618389
</div>
83628390
</div>
@@ -9160,7 +9188,9 @@ with the store.
91609188
A collaborative drawing canvas showcasing TinyBase's state
91619189
synchronization.
91629190
<br /><br />
9163-
Built with TypeScript and React.
9191+
Built with: TypeScript and React.
9192+
<br /><br />
9193+
Persistence: Local Storage.
91649194
</div>
91659195
</div>
91669196
</div>
@@ -9932,7 +9962,9 @@ with the store.
99329962
A tic-tac-toe game demonstrating turn-based logic and computed
99339963
game state.
99349964
<br /><br />
9935-
Built with TypeScript and React.
9965+
Built with: TypeScript and React.
9966+
<br /><br />
9967+
Persistence: Local Storage.
99369968
</div>
99379969
</div>
99389970
</div>
@@ -10643,7 +10675,9 @@ with the store.
1064310675
A simple todo list application demonstrating TinyBase's reactive
1064410676
data management with CRUD operations.
1064510677
<br /><br />
10646-
Built with TypeScript and React.
10678+
Built with: TypeScript and React.
10679+
<br /><br />
10680+
Persistence: Local Storage.
1064710681
</div>
1064810682
</div>
1064910683
</div>
@@ -11330,7 +11364,11 @@ with the store.
1133011364
A simple todo list application demonstrating TinyBase's reactive
1133111365
data management with CRUD operations.
1133211366
<br /><br />
11333-
Built with TypeScript and React.
11367+
Built with: TypeScript and React.
11368+
<br /><br />
11369+
Persistence: Local Storage.
11370+
<br /><br />
11371+
Sync: Remote.
1133411372
</div>
1133511373
</div>
1133611374
</div>
@@ -12027,7 +12065,9 @@ Your data is automatically saved and restored when you reload the page.
1202712065
A real-time chat application demonstrating TinyBase's reactive
1202812066
data management.
1202912067
<br /><br />
12030-
Built with TypeScript.
12068+
Built with: TypeScript.
12069+
<br /><br />
12070+
Persistence: Local Storage.
1203112071
</div>
1203212072
</div>
1203312073
</div>
@@ -12710,7 +12750,9 @@ Your data is automatically saved and restored when you reload the page.
1271012750
A collaborative drawing canvas showcasing TinyBase's state
1271112751
synchronization.
1271212752
<br /><br />
12713-
Built with TypeScript.
12753+
Built with: TypeScript.
12754+
<br /><br />
12755+
Persistence: Local Storage.
1271412756
</div>
1271512757
</div>
1271612758
</div>
@@ -13431,7 +13473,9 @@ Your data is automatically saved and restored when you reload the page.
1343113473
A tic-tac-toe game demonstrating turn-based logic and computed
1343213474
game state.
1343313475
<br /><br />
13434-
Built with TypeScript.
13476+
Built with: TypeScript.
13477+
<br /><br />
13478+
Persistence: Local Storage.
1343513479
</div>
1343613480
</div>
1343713481
</div>
@@ -14068,7 +14112,9 @@ Your data is automatically saved and restored when you reload the page.
1406814112
A tic-tac-toe game demonstrating turn-based logic and computed
1406914113
game state.
1407014114
<br /><br />
14071-
Built with TypeScript.
14115+
Built with: TypeScript.
14116+
<br /><br />
14117+
Persistence: PGlite.
1407214118
</div>
1407314119
</div>
1407414120
</div>
@@ -14747,7 +14793,9 @@ Your data is automatically saved and restored when you reload the page.
1474714793
A simple todo list application demonstrating TinyBase's reactive
1474814794
data management with CRUD operations.
1474914795
<br /><br />
14750-
Built with TypeScript.
14796+
Built with: TypeScript.
14797+
<br /><br />
14798+
Persistence: Local Storage.
1475114799
</div>
1475214800
</div>
1475314801
</div>

test/e2e/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {setTimeout as sleep} from 'timers/promises';
77
import {fileURLToPath} from 'url';
88
import {expect} from 'vitest';
99

10+
export {sleep};
11+
1012
const __dirname = dirname(fileURLToPath(import.meta.url));
1113
export const TEST_DIR = join(__dirname, '..', '..', 'tmp');
1214
export const BASE_PORT = 5173;

test/e2e/drawing.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
runTypeScriptCheck,
1212
setupPageErrorHandling,
1313
setupTestProject,
14+
sleep,
1415
sleepForPersistence,
1516
startDevServer,
1617
testBasicApp,
@@ -152,6 +153,10 @@ async function testDrawingPersistence(page: Page, persistenceType: string) {
152153
await page.reload({waitUntil: 'domcontentloaded'});
153154
await page.waitForFunction(() => !document.getElementById('loading'));
154155

156+
if (persistenceType === 'pglite') {
157+
await sleep(500);
158+
}
159+
155160
const persistedCanvasData = await page.evaluate(() => {
156161
const cnv = document.querySelector('canvas');
157162
return cnv ? cnv.toDataURL() : null;
@@ -176,7 +181,12 @@ async function testDrawingPersistence(page: Page, persistenceType: string) {
176181
await page.reload({waitUntil: 'domcontentloaded'});
177182
await page.waitForFunction(() => !document.getElementById('loading'));
178183

184+
if (persistenceType === 'pglite') {
185+
await sleep(500);
186+
}
187+
179188
await page.waitForSelector('.colorBtn');
189+
180190
const activeColor = await page.evaluate(() => {
181191
const activeBtn = document.querySelector('.colorBtn.active');
182192
return activeBtn ? (activeBtn as HTMLElement).style.background : null;

test/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"types": ["node"]
88
},
99
"include": ["./**/*"],
10-
"exclude": ["node_modules"]
10+
"exclude": ["node_modules", ".test-output", "../tmp"]
1111
}

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
{
88
test: {
99
name: 'unit',
10-
exclude: ['**/e2e/**', '**/node_modules/**'],
10+
exclude: ['**/e2e/**', '**/node_modules/**', 'tmp/**'],
1111
},
1212
},
1313
{

0 commit comments

Comments
 (0)