@niledatabase/nextjs 5.0.0-alpha.10
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 +40 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
- package/src/index.ts +19 -0
- package/tsconfig.json +30 -0
- package/tsup.config.js +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [5.0.0-alpha.10](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.9...v5.0.0-alpha.10) (2025-06-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @niledatabase/nextjs
|
|
9
|
+
|
|
10
|
+
# [5.0.0-alpha.9](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.8...v5.0.0-alpha.9) (2025-06-16)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @niledatabase/nextjs
|
|
13
|
+
|
|
14
|
+
# [5.0.0-alpha.8](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.7...v5.0.0-alpha.8) (2025-06-12)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @niledatabase/nextjs
|
|
17
|
+
|
|
18
|
+
# [5.0.0-alpha.7](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.6...v5.0.0-alpha.7) (2025-06-11)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- **server:** update request params from context mutation ([6b9cdf6](https://github.com/niledatabase/nile-js/commit/6b9cdf672f1ace1adfd197f47fd3c216d89520aa))
|
|
23
|
+
|
|
24
|
+
# [5.0.0-alpha.6](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.5...v5.0.0-alpha.6) (2025-06-11)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
- **server:** move logging to the config object ([6e3e380](https://github.com/niledatabase/nile-js/commit/6e3e38014f5b9795552af0a7b97e2d3fe6cd1a88))
|
|
29
|
+
|
|
30
|
+
# [5.0.0-alpha.5](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.4...v5.0.0-alpha.5) (2025-06-10)
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
- **nextjs:** build and export correctly ([c522c5e](https://github.com/niledatabase/nile-js/commit/c522c5e485bea75b0fdf86cfcd6b0af662f5a0b5))
|
|
35
|
+
|
|
36
|
+
# [5.0.0-alpha.4](https://github.com/niledatabase/nile-js/compare/v5.0.0-alpha.3...v5.0.0-alpha.4) (2025-06-10)
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
- **server:** invites ([c10f598](https://github.com/niledatabase/nile-js/commit/c10f5980bcbc55ed436ce8cceca4111aa8e6a276))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 The Nile Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var x=Object.create;var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},i=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of C(e))!k.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(r=d(e,n))||r.enumerable});return t};var u=(t,e,o)=>(o=t!=null?x(f(t)):{},i(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),m=t=>i(s({},"__esModule",{value:!0}),t);var w={};p(w,{nextJs:()=>v});module.exports=m(w);var c=require("@niledatabase/server");function v(t){return{id:"next-js-cookies",onRequest:async()=>{let{cookies:e,headers:o}=await import("next/headers"),r=await o(),n=await e();if(t.setContext(r),!t.getContext().tenantId){let a=n.get(c.TENANT_COOKIE);a&&t.setContext({tenantId:a.value})}}}}0&&(module.exports={nextJs});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Server, TENANT_COOKIE } from '@niledatabase/server';\n\nexport function nextJs(instance: Server) {\n return {\n id: 'next-js-cookies',\n onRequest: async () => {\n const { cookies, headers } = await import('next/headers');\n const headersHelper = await headers();\n const cooks = await cookies();\n instance.setContext(headersHelper);\n if (!instance.getContext().tenantId) {\n const tenantCookie = cooks.get(TENANT_COOKIE);\n if (tenantCookie) {\n instance.setContext({ tenantId: tenantCookie.value });\n }\n }\n },\n };\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAsC,gCAE/B,SAASF,EAAOG,EAAkB,CACvC,MAAO,CACL,GAAI,kBACJ,UAAW,SAAY,CACrB,GAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAI,KAAM,QAAO,cAAc,EAClDC,EAAgB,MAAMD,EAAQ,EAC9BE,EAAQ,MAAMH,EAAQ,EAE5B,GADAD,EAAS,WAAWG,CAAa,EAC7B,CAACH,EAAS,WAAW,EAAE,SAAU,CACnC,IAAMK,EAAeD,EAAM,IAAI,eAAa,EACxCC,GACFL,EAAS,WAAW,CAAE,SAAUK,EAAa,KAAM,CAAC,CAExD,CACF,CACF,CACF","names":["index_exports","__export","nextJs","__toCommonJS","import_server","instance","cookies","headers","headersHelper","cooks","tenantCookie"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{TENANT_COOKIE as a}from"@niledatabase/server";function x(t){return{id:"next-js-cookies",onRequest:async()=>{let{cookies:o,headers:n}=await import("next/headers"),r=await n(),s=await o();if(t.setContext(r),!t.getContext().tenantId){let e=s.get(a);e&&t.setContext({tenantId:e.value})}}}}export{x as nextJs};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Server, TENANT_COOKIE } from '@niledatabase/server';\n\nexport function nextJs(instance: Server) {\n return {\n id: 'next-js-cookies',\n onRequest: async () => {\n const { cookies, headers } = await import('next/headers');\n const headersHelper = await headers();\n const cooks = await cookies();\n instance.setContext(headersHelper);\n if (!instance.getContext().tenantId) {\n const tenantCookie = cooks.get(TENANT_COOKIE);\n if (tenantCookie) {\n instance.setContext({ tenantId: tenantCookie.value });\n }\n }\n },\n };\n}\n"],"mappings":"AAAA,OAAiB,iBAAAA,MAAqB,uBAE/B,SAASC,EAAOC,EAAkB,CACvC,MAAO,CACL,GAAI,kBACJ,UAAW,SAAY,CACrB,GAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAI,KAAM,QAAO,cAAc,EAClDC,EAAgB,MAAMD,EAAQ,EAC9BE,EAAQ,MAAMH,EAAQ,EAE5B,GADAD,EAAS,WAAWG,CAAa,EAC7B,CAACH,EAAS,WAAW,EAAE,SAAU,CACnC,IAAMK,EAAeD,EAAM,IAAIN,CAAa,EACxCO,GACFL,EAAS,WAAW,CAAE,SAAUK,EAAa,KAAM,CAAC,CAExD,CACF,CACF,CACF","names":["TENANT_COOKIE","nextJs","instance","cookies","headers","headersHelper","cooks","tenantCookie"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@niledatabase/nextjs",
|
|
3
|
+
"version": "5.0.0-alpha.10",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"import": "./dist/index.mjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"prettier": {
|
|
15
|
+
"printWidth": 80,
|
|
16
|
+
"semi": true,
|
|
17
|
+
"singleQuote": true,
|
|
18
|
+
"trailingComma": "es5"
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup src/index.ts"
|
|
23
|
+
},
|
|
24
|
+
"author": "jrea",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/niledatabase/nile-js.git",
|
|
28
|
+
"directory": "packages/nextjs"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@niledatabase/server": "*",
|
|
35
|
+
"next": "^15"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"next": "^15.3.3",
|
|
39
|
+
"tsup": "^8.5.0"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "d81efc26168cb58f8d8f809898afc0ffc030c030"
|
|
42
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Server, TENANT_COOKIE } from '@niledatabase/server';
|
|
2
|
+
|
|
3
|
+
export function nextJs(instance: Server) {
|
|
4
|
+
return {
|
|
5
|
+
id: 'next-js-cookies',
|
|
6
|
+
onRequest: async () => {
|
|
7
|
+
const { cookies, headers } = await import('next/headers');
|
|
8
|
+
const headersHelper = await headers();
|
|
9
|
+
const cooks = await cookies();
|
|
10
|
+
instance.setContext(headersHelper);
|
|
11
|
+
if (!instance.getContext().tenantId) {
|
|
12
|
+
const tenantCookie = cooks.get(TENANT_COOKIE);
|
|
13
|
+
if (tenantCookie) {
|
|
14
|
+
instance.setContext({ tenantId: tenantCookie.value });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig",
|
|
3
|
+
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
|
|
4
|
+
"include": ["src/**/*"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"importHelpers": true,
|
|
7
|
+
// output .d.ts declaration files for consumers
|
|
8
|
+
"declaration": true,
|
|
9
|
+
// output .js.map sourcemap files for consumers
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
// stricter type-checking for stronger correctness. Recommended by TS
|
|
12
|
+
"strict": true,
|
|
13
|
+
// linter checks for common issues
|
|
14
|
+
"noImplicitReturns": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
|
|
17
|
+
"noUnusedLocals": false,
|
|
18
|
+
// set to false for code generation
|
|
19
|
+
"noUnusedParameters": false,
|
|
20
|
+
// interop between ESM and CJS modules. Recommended by TS
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
// error out if import and file system have a casing mismatch. Recommended by TS
|
|
25
|
+
"forceConsistentCasingInFileNames": true,
|
|
26
|
+
// `dts build` ignores this option, but it is commonly used when type-checking separately with `tsc`
|
|
27
|
+
"noEmit": false,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|
package/tsup.config.js
ADDED