create-feathersdev 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/esm/flows/with-application.js +1 -1
- package/examples/frontend/react/package.json +5 -3
- package/examples/frontend/react/src/App.tsx +17 -20
- package/examples/frontend/react/src/Counter.tsx +25 -0
- package/examples/frontend/react/src/automerge.ts +5 -3
- package/examples/frontend/react/vite.config.ts +2 -1
- package/examples/frontend/svelte/package.json +4 -3
- package/examples/frontend/vanilla/package.json +10 -6
- package/examples/frontend/vue/package.json +4 -4
- package/examples/frontend/vue/src/App.vue +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.11.1](https://github.com/feathersdev/cloud/compare/v0.11.0...v0.11.1) (2025-05-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Update default development port ([#280](https://github.com/feathersdev/cloud/issues/280)) ([bfcbefa](https://github.com/feathersdev/cloud/commit/bfcbefaffe32bb7b1054540699519fc0d5f8dd33))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [0.11.0](https://github.com/feathersdev/cloud/compare/v0.10.1...v0.11.0) (2025-05-25)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -14,7 +14,7 @@ export async function createApplication(init) {
|
|
|
14
14
|
type: 'input',
|
|
15
15
|
message: 'What are the allowed referers?',
|
|
16
16
|
suffix: chalk.white(' A comma separated list of URLs where your frontend is running'),
|
|
17
|
-
default: 'http://localhost:
|
|
17
|
+
default: 'http://localhost:4040',
|
|
18
18
|
},
|
|
19
19
|
})))
|
|
20
20
|
.then(async (ctx) => {
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "react
|
|
2
|
+
"name": "feathersdev-react",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vite --port
|
|
7
|
+
"dev": "vite --port 4040",
|
|
8
8
|
"build": "tsc -b && vite build",
|
|
9
9
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
10
10
|
"preview": "vite preview"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@feathersdev/auth": "^0.
|
|
13
|
+
"@feathersdev/auth": "^0.11.0",
|
|
14
|
+
"@feathersdev/automerge": "^0.11.0",
|
|
14
15
|
"react": "^18.3.1",
|
|
15
16
|
"react-dom": "^18.3.1"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
19
|
+
"vite-plugin-wasm": "^3.4.1",
|
|
18
20
|
"@types/react": "^18.3.12",
|
|
19
21
|
"@types/react-dom": "^18.3.1",
|
|
20
22
|
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import './App.css'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const response = await authFetch('http://localhost:3030/message', {
|
|
9
|
-
method: 'GET'
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
if (response.status >= 400) {
|
|
13
|
-
throw new Error(`Failed to load message: ${response.statusText}`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return response.json();
|
|
17
|
-
}
|
|
4
|
+
import { auth } from './auth'
|
|
5
|
+
import { loadAppDocument, AppDocumentHandle } from './automerge'
|
|
6
|
+
import { FeathersAuthUser } from '@feathersdev/auth'
|
|
7
|
+
import Counter from './Counter'
|
|
18
8
|
|
|
19
9
|
function App() {
|
|
20
|
-
const [
|
|
10
|
+
const [handle, setHandle] = useState<AppDocumentHandle>()
|
|
11
|
+
const [user, setUser] = useState<FeathersAuthUser | null>(null)
|
|
21
12
|
|
|
22
13
|
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
// Get the application document
|
|
15
|
+
loadAppDocument().then(async handle => {
|
|
16
|
+
setHandle(handle)
|
|
17
|
+
// Once the app document is available we also know
|
|
18
|
+
// we are logged in and can set the user
|
|
19
|
+
setUser(await auth.getUser())
|
|
20
|
+
})
|
|
21
|
+
}, [])
|
|
25
22
|
|
|
26
23
|
return (
|
|
27
24
|
<>
|
|
28
|
-
<h1>
|
|
25
|
+
<h1>feathers.dev React Demo</h1>
|
|
29
26
|
<div className="card">
|
|
30
|
-
<p>
|
|
27
|
+
<p>Hello {user?.email}!</p>
|
|
28
|
+
{handle && <Counter handle={handle} />}
|
|
31
29
|
</div>
|
|
32
|
-
<h2>{message}</h2>
|
|
33
30
|
</>
|
|
34
31
|
)
|
|
35
32
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { AppDocumentHandle } from "./automerge";
|
|
3
|
+
|
|
4
|
+
export default function Counter({ handle }: { handle: AppDocumentHandle }) {
|
|
5
|
+
const [counter, setCounter] = useState(0)
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
handle.on("change", ({ doc }) => {
|
|
9
|
+
setCounter(doc.counter || 0)
|
|
10
|
+
})
|
|
11
|
+
}, [handle])
|
|
12
|
+
|
|
13
|
+
const incrementCounter = () => {
|
|
14
|
+
handle.change((doc) => {
|
|
15
|
+
doc.counter = (doc.counter || 0) + 1
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return <div>
|
|
20
|
+
Our community counter is: <strong>{counter}</strong>
|
|
21
|
+
<div>
|
|
22
|
+
<button onClick={incrementCounter}>Increment</button>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createAutomerge } from '@feathersdev/automerge'
|
|
1
|
+
import { createAutomerge, DocHandle } from '@feathersdev/automerge'
|
|
2
2
|
import { auth } from './auth.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,10 +7,12 @@ import { auth } from './auth.js'
|
|
|
7
7
|
*/
|
|
8
8
|
export const automerge = createAutomerge(auth)
|
|
9
9
|
|
|
10
|
-
interface AppData {
|
|
10
|
+
export interface AppData {
|
|
11
11
|
counter: number
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export type AppDocumentHandle = DocHandle<AppData>
|
|
15
|
+
|
|
16
|
+
export async function loadAppDocument(): Promise<AppDocumentHandle> {
|
|
15
17
|
return automerge.find<AppData>()
|
|
16
18
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "svelte
|
|
2
|
+
"name": "feathersdev-svelte",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vite --port
|
|
7
|
+
"dev": "vite --port 4040",
|
|
8
8
|
"build": "vite build",
|
|
9
9
|
"preview": "vite preview",
|
|
10
10
|
"check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@feathersdev/auth": "^0.
|
|
13
|
+
"@feathersdev/auth": "^0.11.0",
|
|
14
|
+
"@feathersdev/automerge": "^0.11.0"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "vanilla
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
2
|
+
"name": "feathersdev-vanilla",
|
|
5
3
|
"type": "module",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vite --port
|
|
7
|
+
"dev": "vite --port 4040",
|
|
8
8
|
"build": "tsc && vite build",
|
|
9
9
|
"preview": "vite preview"
|
|
10
10
|
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@feathersdev/auth": "^0.11.0",
|
|
13
|
+
"@feathersdev/automerge": "^0.11.0"
|
|
14
|
+
},
|
|
11
15
|
"devDependencies": {
|
|
12
16
|
"typescript": "^5.6.3",
|
|
13
|
-
"vite
|
|
14
|
-
"vite": "^
|
|
17
|
+
"vite": "^5.4.11",
|
|
18
|
+
"vite-plugin-wasm": "^3.4.1"
|
|
15
19
|
}
|
|
16
20
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "vue
|
|
2
|
+
"name": "feathersdev-vue",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vite --port
|
|
7
|
+
"dev": "vite --port 4040",
|
|
8
8
|
"build": "run-p type-check \"build-only {@}\" --",
|
|
9
9
|
"preview": "vite preview",
|
|
10
10
|
"build-only": "vite build",
|
|
11
11
|
"type-check": "vue-tsc --build --force"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@feathersdev/auth": "^0.
|
|
15
|
-
"@feathersdev/automerge": "^0.
|
|
14
|
+
"@feathersdev/auth": "^0.11.0",
|
|
15
|
+
"@feathersdev/automerge": "^0.11.0",
|
|
16
16
|
"vue": "^3.5.12"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-feathersdev",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.1",
|
|
5
5
|
"description": "The feathers.dev CLI",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Feathers Cloud Inc.",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"shx": "^0.4.0",
|
|
64
64
|
"typescript": "^5.8.3"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "762d75e57ce8a52a4e26d26459d74f19c53dda03"
|
|
67
67
|
}
|