nitro-web 0.0.93 → 0.0.94
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/client/app.tsx +4 -0
- package/client/globals.ts +0 -9
- package/client/index.ts +2 -3
- package/components/auth/reset.tsx +1 -1
- package/components/auth/signin.tsx +1 -1
- package/components/auth/signup.tsx +1 -1
- package/components/partials/element/accordion.tsx +0 -1
- package/components/partials/styleguide.tsx +1 -1
- package/package.json +2 -2
- package/tsconfig.json +3 -4
- package/types/core-only-globals.d.ts +2 -2
- package/types/{required-globals.d.ts → globals.d.ts} +5 -3
package/client/app.tsx
CHANGED
|
@@ -40,6 +40,10 @@ type RouteWithPolicies = Route & {
|
|
|
40
40
|
|
|
41
41
|
export async function setupApp(config: Config, storeContainer: StoreContainer, layouts: React.FC<LayoutProps>[]) {
|
|
42
42
|
if (!layouts) throw new Error('layouts are required')
|
|
43
|
+
if (!(window as unknown as { useTracked: unknown }).useTracked) {
|
|
44
|
+
throw new Error('useTracked is not defined globally before setupApp()')
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
// Fetch state and init app
|
|
44
48
|
const settings: Settings = {
|
|
45
49
|
beforeApp: config.beforeApp || beforeApp,
|
package/client/globals.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
|
|
2
2
|
import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'
|
|
3
|
-
import { onChange } from 'nitro-web'
|
|
4
3
|
|
|
5
4
|
declare global {
|
|
6
|
-
// Common application globals
|
|
7
|
-
const onChange: typeof import('nitro-web').onChange
|
|
8
|
-
|
|
9
|
-
// Common aependency globals
|
|
10
|
-
/** The public API for rendering a history-aware `<a>`. */
|
|
11
5
|
const Link: typeof import('react-router-dom').Link
|
|
12
6
|
const useCallback: typeof import('react').useCallback
|
|
13
7
|
const useEffect: typeof import('react').useEffect
|
|
@@ -21,9 +15,6 @@ declare global {
|
|
|
21
15
|
}
|
|
22
16
|
|
|
23
17
|
Object.assign(window, {
|
|
24
|
-
// application globals
|
|
25
|
-
onChange: onChange,
|
|
26
|
-
// dependency globals
|
|
27
18
|
Link: Link,
|
|
28
19
|
useCallback: useCallback,
|
|
29
20
|
useEffect: useEffect,
|
package/client/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
import '../types/
|
|
1
|
+
// const pi = parseFloat(3.142)
|
|
2
|
+
import '../types/globals.d.ts'
|
|
3
3
|
|
|
4
|
-
// export const pi = parseFloat(3.142)
|
|
5
4
|
// Utility functions
|
|
6
5
|
export * from '../util.js'
|
|
7
6
|
export * as util from '../util.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Topbar, Field, Button, FormError, request, queryObject, injectedConfig, updateJwt } from 'nitro-web'
|
|
1
|
+
import { Topbar, Field, Button, FormError, request, queryObject, injectedConfig, updateJwt, onChange } from 'nitro-web'
|
|
2
2
|
import { Errors } from 'nitro-web/types'
|
|
3
3
|
|
|
4
4
|
export function Signin() {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Drop, Dropdown, Field, Select, Button as ButtonNitro, Checkbox, GithubLink, Modal, Calendar, injectedConfig,
|
|
3
3
|
Filters, FiltersHandleType, FilterType,
|
|
4
4
|
} from 'nitro-web'
|
|
5
|
-
import { getCountryOptions, getCurrencyOptions, ucFirst } from 'nitro-web/util'
|
|
5
|
+
import { getCountryOptions, getCurrencyOptions, onChange, ucFirst } from 'nitro-web/util'
|
|
6
6
|
import { Check, FileEditIcon } from 'lucide-react'
|
|
7
7
|
|
|
8
8
|
type StyleguideProps = {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.94",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|
|
7
|
-
"main": "./client/index.ts",
|
|
8
7
|
"type": "module",
|
|
8
|
+
"main": "./client/index.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./client/index.ts",
|
|
11
11
|
"./client/imgs/*": "./client/imgs/*",
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Store } from 'nitro-web/types'
|
|
2
2
|
import { Dispatch, SetStateAction } from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
declare global {
|
|
5
|
+
// useTracked global (normally defined in your project's /client/index.ts)
|
|
6
6
|
const useTracked: () => [Store, Dispatch<SetStateAction<Store>>]
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Required global types
|
|
2
1
|
import 'twin.macro'
|
|
3
2
|
import { css as cssImport } from '@emotion/react'
|
|
4
3
|
import styledImport from '@emotion/styled'
|
|
@@ -8,12 +7,13 @@ declare global {
|
|
|
8
7
|
/** Webpack injected config variables */
|
|
9
8
|
const INJECTED_CONFIG: Record<string, string|boolean|object>
|
|
10
9
|
/** Webpack svg loader */
|
|
11
|
-
module '*.svg' {
|
|
10
|
+
declare module '*.svg' {
|
|
12
11
|
const content: React.FC<React.SVGProps<SVGElement>>
|
|
13
12
|
export default content
|
|
14
13
|
}
|
|
14
|
+
|
|
15
15
|
/** Webpack image loader */
|
|
16
|
-
module '*.jpg' {
|
|
16
|
+
declare module '*.jpg' {
|
|
17
17
|
const content: string
|
|
18
18
|
export default content
|
|
19
19
|
}
|
|
@@ -37,3 +37,5 @@ declare module 'react' {
|
|
|
37
37
|
for?: string | undefined
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
export {}
|