@valbuild/init 0.85.0 → 0.86.0

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.
@@ -504,7 +504,7 @@ function transformNextAppRouterValProvider(fileInfo, api, options) {
504
504
 
505
505
  var packageJson = {
506
506
  name: "@valbuild/init",
507
- version: "0.85.0",
507
+ version: "0.86.0",
508
508
  description: "Initialize a new val.build project",
509
509
  exports: {
510
510
  "./main": {
@@ -555,10 +555,10 @@ var packageJson = {
555
555
  };
556
556
 
557
557
  var VAL_CLIENT = function VAL_CLIENT(configImportPath) {
558
- return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst { useValStega: useVal, useValRouteStega: useValRoute } =\n initValClient(config);\n\nexport { useVal, useValRoute };\n");
558
+ return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst {\n useValStega: useVal,\n useValRouteStega: useValRoute,\n useValRouteUrl,\n} = initValClient(config);\n\nexport { useVal, useValRoute, useValRouteUrl };\n");
559
559
  };
560
560
  var VAL_RSC = function VAL_RSC(configImportPath, valModulesImportPath) {
561
- return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport valModules from \"").concat(valModulesImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst { fetchValStega: fetchVal, fetchValRouteStega: fetchValRoute } =\n initValRsc(config, valModules, {\n draftMode,\n headers,\n cookies,\n });\n\nexport { fetchVal, fetchValRoute };\n");
561
+ return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport valModules from \"").concat(valModulesImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst {\n fetchValStega: fetchVal,\n fetchValRouteStega: fetchValRoute,\n fetchValRouteUrl,\n} =\n initValRsc(config, valModules, {\n draftMode,\n headers,\n cookies,\n });\n\nexport { fetchVal, fetchValRoute, fetchValRouteUrl };\n");
562
562
  };
563
563
  var VAL_SERVER = function VAL_SERVER(configImportPath, valModulesImportPath) {
564
564
  return "import \"server-only\";\nimport { initValServer } from \"@valbuild/next/server\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { draftMode } from \"next/headers\";\nimport valModules from \"").concat(valModulesImportPath, "\";\n\nconst { valNextAppRouter } = initValServer(\n valModules,\n { ...config },\n {\n draftMode,\n }\n);\n\nexport { valNextAppRouter };\n");
@@ -1756,7 +1756,7 @@ function _execute() {
1756
1756
  writeFile(maybeFileOp, plan.root, key.startsWith("update"));
1757
1757
  }
1758
1758
  }
1759
- info("\n \nVal was successfully initialized!\n\n Start the application:\n\n $ ".concat(chalk__default["default"].cyan("npm run dev"), "\n\n Open (assumes http://localhost:3000):\n\n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("http://localhost:3000/val"), "\n\n When you want to enable editor support, import the project by opening the following link:\n \n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("https://app.val.build/orgs/new".concat(plan.gitRemote ? "?org=".concat(encodeURIComponent(plan.gitRemote.owner), "&owner=").concat(encodeURIComponent(plan.gitRemote.owner), "&repo=").concat(encodeURIComponent(plan.gitRemote.repo)) : "")), "\n\n"));
1759
+ info("\n \nVal was successfully initialized!\n\n Start the application:\n\n $ ".concat(chalk__default["default"].cyan("npm run dev"), "\n\n Open (assumes http://localhost:3000):\n\n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("http://localhost:3000/val"), "\n\n When you want to enable editor support, import the project by opening the following link:\n \n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("https://admin.val.build/orgs/new".concat(plan.gitRemote ? "?org=".concat(encodeURIComponent(plan.gitRemote.owner), "&owner=").concat(encodeURIComponent(plan.gitRemote.owner), "&repo=").concat(encodeURIComponent(plan.gitRemote.repo)) : "")), "\n\n"));
1760
1760
  case 7:
1761
1761
  case "end":
1762
1762
  return _context4.stop();
@@ -504,7 +504,7 @@ function transformNextAppRouterValProvider(fileInfo, api, options) {
504
504
 
505
505
  var packageJson = {
506
506
  name: "@valbuild/init",
507
- version: "0.85.0",
507
+ version: "0.86.0",
508
508
  description: "Initialize a new val.build project",
509
509
  exports: {
510
510
  "./main": {
@@ -555,10 +555,10 @@ var packageJson = {
555
555
  };
556
556
 
557
557
  var VAL_CLIENT = function VAL_CLIENT(configImportPath) {
558
- return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst { useValStega: useVal, useValRouteStega: useValRoute } =\n initValClient(config);\n\nexport { useVal, useValRoute };\n");
558
+ return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst {\n useValStega: useVal,\n useValRouteStega: useValRoute,\n useValRouteUrl,\n} = initValClient(config);\n\nexport { useVal, useValRoute, useValRouteUrl };\n");
559
559
  };
560
560
  var VAL_RSC = function VAL_RSC(configImportPath, valModulesImportPath) {
561
- return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport valModules from \"").concat(valModulesImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst { fetchValStega: fetchVal, fetchValRouteStega: fetchValRoute } =\n initValRsc(config, valModules, {\n draftMode,\n headers,\n cookies,\n });\n\nexport { fetchVal, fetchValRoute };\n");
561
+ return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport valModules from \"").concat(valModulesImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst {\n fetchValStega: fetchVal,\n fetchValRouteStega: fetchValRoute,\n fetchValRouteUrl,\n} =\n initValRsc(config, valModules, {\n draftMode,\n headers,\n cookies,\n });\n\nexport { fetchVal, fetchValRoute, fetchValRouteUrl };\n");
562
562
  };
563
563
  var VAL_SERVER = function VAL_SERVER(configImportPath, valModulesImportPath) {
564
564
  return "import \"server-only\";\nimport { initValServer } from \"@valbuild/next/server\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { draftMode } from \"next/headers\";\nimport valModules from \"").concat(valModulesImportPath, "\";\n\nconst { valNextAppRouter } = initValServer(\n valModules,\n { ...config },\n {\n draftMode,\n }\n);\n\nexport { valNextAppRouter };\n");
@@ -1756,7 +1756,7 @@ function _execute() {
1756
1756
  writeFile(maybeFileOp, plan.root, key.startsWith("update"));
1757
1757
  }
1758
1758
  }
1759
- info("\n \nVal was successfully initialized!\n\n Start the application:\n\n $ ".concat(chalk__default["default"].cyan("npm run dev"), "\n\n Open (assumes http://localhost:3000):\n\n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("http://localhost:3000/val"), "\n\n When you want to enable editor support, import the project by opening the following link:\n \n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("https://app.val.build/orgs/new".concat(plan.gitRemote ? "?org=".concat(encodeURIComponent(plan.gitRemote.owner), "&owner=").concat(encodeURIComponent(plan.gitRemote.owner), "&repo=").concat(encodeURIComponent(plan.gitRemote.repo)) : "")), "\n\n"));
1759
+ info("\n \nVal was successfully initialized!\n\n Start the application:\n\n $ ".concat(chalk__default["default"].cyan("npm run dev"), "\n\n Open (assumes http://localhost:3000):\n\n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("http://localhost:3000/val"), "\n\n When you want to enable editor support, import the project by opening the following link:\n \n ").concat(chalk__default["default"].bgBlack.hex("#37cd99").underline("https://admin.val.build/orgs/new".concat(plan.gitRemote ? "?org=".concat(encodeURIComponent(plan.gitRemote.owner), "&owner=").concat(encodeURIComponent(plan.gitRemote.owner), "&repo=").concat(encodeURIComponent(plan.gitRemote.repo)) : "")), "\n\n"));
1760
1760
  case 7:
1761
1761
  case "end":
1762
1762
  return _context4.stop();
@@ -492,7 +492,7 @@ function transformNextAppRouterValProvider(fileInfo, api, options) {
492
492
 
493
493
  var packageJson = {
494
494
  name: "@valbuild/init",
495
- version: "0.85.0",
495
+ version: "0.86.0",
496
496
  description: "Initialize a new val.build project",
497
497
  exports: {
498
498
  "./main": {
@@ -543,10 +543,10 @@ var packageJson = {
543
543
  };
544
544
 
545
545
  var VAL_CLIENT = function VAL_CLIENT(configImportPath) {
546
- return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst { useValStega: useVal, useValRouteStega: useValRoute } =\n initValClient(config);\n\nexport { useVal, useValRoute };\n");
546
+ return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst {\n useValStega: useVal,\n useValRouteStega: useValRoute,\n useValRouteUrl,\n} = initValClient(config);\n\nexport { useVal, useValRoute, useValRouteUrl };\n");
547
547
  };
548
548
  var VAL_RSC = function VAL_RSC(configImportPath, valModulesImportPath) {
549
- return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport valModules from \"").concat(valModulesImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst { fetchValStega: fetchVal, fetchValRouteStega: fetchValRoute } =\n initValRsc(config, valModules, {\n draftMode,\n headers,\n cookies,\n });\n\nexport { fetchVal, fetchValRoute };\n");
549
+ return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport valModules from \"").concat(valModulesImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst {\n fetchValStega: fetchVal,\n fetchValRouteStega: fetchValRoute,\n fetchValRouteUrl,\n} =\n initValRsc(config, valModules, {\n draftMode,\n headers,\n cookies,\n });\n\nexport { fetchVal, fetchValRoute, fetchValRouteUrl };\n");
550
550
  };
551
551
  var VAL_SERVER = function VAL_SERVER(configImportPath, valModulesImportPath) {
552
552
  return "import \"server-only\";\nimport { initValServer } from \"@valbuild/next/server\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { draftMode } from \"next/headers\";\nimport valModules from \"").concat(valModulesImportPath, "\";\n\nconst { valNextAppRouter } = initValServer(\n valModules,\n { ...config },\n {\n draftMode,\n }\n);\n\nexport { valNextAppRouter };\n");
@@ -1744,7 +1744,7 @@ function _execute() {
1744
1744
  writeFile(maybeFileOp, plan.root, key.startsWith("update"));
1745
1745
  }
1746
1746
  }
1747
- info("\n \nVal was successfully initialized!\n\n Start the application:\n\n $ ".concat(chalk.cyan("npm run dev"), "\n\n Open (assumes http://localhost:3000):\n\n ").concat(chalk.bgBlack.hex("#37cd99").underline("http://localhost:3000/val"), "\n\n When you want to enable editor support, import the project by opening the following link:\n \n ").concat(chalk.bgBlack.hex("#37cd99").underline("https://app.val.build/orgs/new".concat(plan.gitRemote ? "?org=".concat(encodeURIComponent(plan.gitRemote.owner), "&owner=").concat(encodeURIComponent(plan.gitRemote.owner), "&repo=").concat(encodeURIComponent(plan.gitRemote.repo)) : "")), "\n\n"));
1747
+ info("\n \nVal was successfully initialized!\n\n Start the application:\n\n $ ".concat(chalk.cyan("npm run dev"), "\n\n Open (assumes http://localhost:3000):\n\n ").concat(chalk.bgBlack.hex("#37cd99").underline("http://localhost:3000/val"), "\n\n When you want to enable editor support, import the project by opening the following link:\n \n ").concat(chalk.bgBlack.hex("#37cd99").underline("https://admin.val.build/orgs/new".concat(plan.gitRemote ? "?org=".concat(encodeURIComponent(plan.gitRemote.owner), "&owner=").concat(encodeURIComponent(plan.gitRemote.owner), "&repo=").concat(encodeURIComponent(plan.gitRemote.repo)) : "")), "\n\n"));
1748
1748
  case 7:
1749
1749
  case "end":
1750
1750
  return _context4.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/init",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "description": "Initialize a new val.build project",
5
5
  "exports": {
6
6
  "./main": {
package/src/init.ts CHANGED
@@ -944,7 +944,7 @@ Val was successfully initialized!
944
944
  ${chalk.bgBlack
945
945
  .hex("#37cd99")
946
946
  .underline(
947
- `https://app.val.build/orgs/new${
947
+ `https://admin.val.build/orgs/new${
948
948
  plan.gitRemote
949
949
  ? `?org=${encodeURIComponent(
950
950
  plan.gitRemote.owner,
package/src/templates.ts CHANGED
@@ -2,10 +2,13 @@ export const VAL_CLIENT = (configImportPath: string) => `import "client-only";
2
2
  import { initValClient } from "@valbuild/next/client";
3
3
  import { config } from "${configImportPath}";
4
4
 
5
- const { useValStega: useVal, useValRouteStega: useValRoute } =
6
- initValClient(config);
5
+ const {
6
+ useValStega: useVal,
7
+ useValRouteStega: useValRoute,
8
+ useValRouteUrl,
9
+ } = initValClient(config);
7
10
 
8
- export { useVal, useValRoute };
11
+ export { useVal, useValRoute, useValRouteUrl };
9
12
  `;
10
13
 
11
14
  export const VAL_RSC = (
@@ -17,14 +20,18 @@ import { config } from "${configImportPath}";
17
20
  import valModules from "${valModulesImportPath}";
18
21
  import { cookies, draftMode, headers } from "next/headers";
19
22
 
20
- const { fetchValStega: fetchVal, fetchValRouteStega: fetchValRoute } =
23
+ const {
24
+ fetchValStega: fetchVal,
25
+ fetchValRouteStega: fetchValRoute,
26
+ fetchValRouteUrl,
27
+ } =
21
28
  initValRsc(config, valModules, {
22
29
  draftMode,
23
30
  headers,
24
31
  cookies,
25
32
  });
26
33
 
27
- export { fetchVal, fetchValRoute };
34
+ export { fetchVal, fetchValRoute, fetchValRouteUrl };
28
35
  `;
29
36
 
30
37
  export const VAL_SERVER = (