create-wirejs-app 2.0.172 → 2.0.174

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wirejs-app",
3
- "version": "2.0.172",
3
+ "version": "2.0.174",
4
4
  "description": "Initializes a wirejs package.",
5
5
  "author": "Jon Wire",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- import { AuthenticationService, Endpoint } from 'wirejs-resources';
1
+ import { AuthenticationService, Endpoint, GoogleOIDCProvider } from 'wirejs-resources';
2
2
  import { Chat } from './apps/chat.js';
3
3
  import { Todos } from './apps/todos.js';
4
4
  import { Wiki } from './apps/wiki.js';
@@ -11,7 +11,9 @@ export type * from './apps/todos.js';
11
11
  export type * from './apps/store.js';
12
12
  export type * from './apps/admin.js';
13
13
 
14
- const authService = new AuthenticationService('app', 'core-users');
14
+ const authService = new AuthenticationService('app', 'core-users', {
15
+ oidcProviders: [ GoogleOIDCProvider ]
16
+ });
15
17
 
16
18
  export const auth = authService.buildApi();
17
19
  export const chat = Chat(auth);
@@ -11,15 +11,15 @@
11
11
  "dependencies": {
12
12
  "dompurify": "^3.2.3",
13
13
  "marked": "^15.0.6",
14
+ "wirejs-components": "^0.1.112",
14
15
  "wirejs-dom": "^1.0.44",
15
- "wirejs-resources": "^0.1.167",
16
- "wirejs-components": "^0.1.110",
17
- "wirejs-module-payments-stripe": "^0.1.61",
18
- "wirejs-web-worker": "^1.0.64"
16
+ "wirejs-module-payments-stripe": "^0.1.63",
17
+ "wirejs-resources": "^0.1.169",
18
+ "wirejs-web-worker": "^1.0.66"
19
19
  },
20
20
  "devDependencies": {
21
- "wirejs-scripts": "^3.0.165",
22
- "typescript": "^5.7.3"
21
+ "typescript": "^5.7.3",
22
+ "wirejs-scripts": "^3.0.167"
23
23
  },
24
24
  "scripts": {
25
25
  "prebuild": "npm run prebuild --workspaces --if-present",
@@ -1,4 +1,5 @@
1
1
  import { html, list, node, text, hydrate } from 'wirejs-dom/v2';
2
+ import { AuthenticatedContent } from 'wirejs-components';
2
3
  import { Main } from '../layouts/main.js';
3
4
  import { admin, Endpoint, Setting, SystemAttribute } from 'internal-api';
4
5
 
@@ -154,14 +155,15 @@ function Admin() {
154
155
 
155
156
  async function App() {
156
157
  const self = html`<div id='app'>
157
- ${node('isAdmin', false, (isAdmin: boolean | undefined) =>
158
- isAdmin ?
159
- html`<div><p>Your <b>are</b> an admin.</p>${Admin()}</div>`
160
- : html`<p>You are <b>NOT</b> an admin.</p>`
161
- )}
162
- </div>`.onadd(async self => {
163
- self.data.isAdmin = await admin.isAdmin(null);
164
- });
158
+ ${await AuthenticatedContent({
159
+ authenticated: async () => {
160
+ return (await admin.isAdmin(null)) ?
161
+ html`<div><p>Your <b>are</b> an admin.</p>${Admin()}</div>`
162
+ : html`<p>You are <b>NOT</b> an admin.</p>`
163
+ },
164
+ unauthenticated: () => html`<p>You are not signed in.</p>`,
165
+ })}
166
+ </div>`;
165
167
  return self;
166
168
  }
167
169