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 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:3030',
17
+ default: 'http://localhost:4040',
18
18
  },
19
19
  })))
20
20
  .then(async (ctx) => {
@@ -1,20 +1,22 @@
1
1
  {
2
- "name": "react-frontend",
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 3000",
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.6.5",
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 { authFetch } from './auth'
5
-
6
- async function loadMessage() {
7
- // Get data with authentication from your server
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 [message, setMessage] = useState('')
10
+ const [handle, setHandle] = useState<AppDocumentHandle>()
11
+ const [user, setUser] = useState<FeathersAuthUser | null>(null)
21
12
 
22
13
  useEffect(() => {
23
- loadMessage().then(({ message }) => setMessage(message))
24
- }, [message])
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>Feathers Auth React Demo</h1>
25
+ <h1>feathers.dev React Demo</h1>
29
26
  <div className="card">
30
- <p>The message from the server is:</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 async function getHandle() {
14
+ export type AppDocumentHandle = DocHandle<AppData>
15
+
16
+ export async function loadAppDocument(): Promise<AppDocumentHandle> {
15
17
  return automerge.find<AppData>()
16
18
  }
@@ -1,7 +1,8 @@
1
1
  import react from '@vitejs/plugin-react'
2
2
  import { defineConfig } from 'vite'
3
+ import wasm from 'vite-plugin-wasm'
3
4
 
4
5
  // https://vitejs.dev/config/
5
6
  export default defineConfig({
6
- plugins: [react()],
7
+ plugins: [wasm(), react()],
7
8
  })
@@ -1,16 +1,17 @@
1
1
  {
2
- "name": "svelte-frontend",
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 3000",
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.6.5"
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-frontend",
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 3000",
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-plugin-wasm": "^3.4.1",
14
- "vite": "^5.4.11"
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-Frontend",
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 3000",
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.10.0",
15
- "@feathersdev/automerge": "^0.10.0",
14
+ "@feathersdev/auth": "^0.11.0",
15
+ "@feathersdev/automerge": "^0.11.0",
16
16
  "vue": "^3.5.12"
17
17
  },
18
18
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
- import { automerge } from './auth'
3
+ import { automerge } from './automerge.js'
4
4
 
5
5
  const handle = await automerge.find<{ counter: number }>()
6
6
  const counter = ref<number>(0)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-feathersdev",
3
3
  "type": "module",
4
- "version": "0.11.0",
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": "c39ce0034f664037faf0e4be4ca209309835bfa4"
66
+ "gitHead": "762d75e57ce8a52a4e26d26459d74f19c53dda03"
67
67
  }