@valbuild/init 0.57.0 → 0.59.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.
@@ -463,7 +463,7 @@ function transformNextAppRouterValProvider(fileInfo, api, options) {
463
463
 
464
464
  var packageJson = {
465
465
  name: "@valbuild/init",
466
- version: "0.57.0",
466
+ version: "0.59.0",
467
467
  description: "Initialize a new val.build project",
468
468
  exports: {
469
469
  "./main": {
@@ -516,6 +516,9 @@ var packageJson = {
516
516
  var VAL_CLIENT = function VAL_CLIENT(configImportPath) {
517
517
  return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst { useValStega: useVal } = initValClient(config);\n\nexport { useVal };\n");
518
518
  };
519
+ var VAL_RSC = function VAL_RSC(configImportPath) {
520
+ return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst { fetchValStega: fetchVal } = initValRsc(config, {\n draftMode,\n headers,\n cookies,\n});\n\nexport { fetchVal };\n");
521
+ };
519
522
  var VAL_SERVER = function VAL_SERVER(configImportPath) {
520
523
  return "import \"server-only\";\nimport { initValServer } from \"@valbuild/next/server\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { draftMode } from \"next/headers\";\n\nconst { valNextAppRouter } = initValServer(\n { ...config },\n {\n draftMode,\n }\n);\n\nexport { valNextAppRouter };\n");
521
524
  };
@@ -1142,7 +1145,7 @@ function _plan() {
1142
1145
  if (_answer4) {
1143
1146
  plan.createValRsc = {
1144
1147
  path: path__default["default"].join(valUtilsDir, analysis.isTypeScript ? "val.rsc.ts" : "val.rsc.js"),
1145
- source: VAL_SERVER(valUtilsImportPath)
1148
+ source: VAL_RSC(valUtilsImportPath)
1146
1149
  };
1147
1150
  } else {
1148
1151
  plan.createValRsc = false;
@@ -463,7 +463,7 @@ function transformNextAppRouterValProvider(fileInfo, api, options) {
463
463
 
464
464
  var packageJson = {
465
465
  name: "@valbuild/init",
466
- version: "0.57.0",
466
+ version: "0.59.0",
467
467
  description: "Initialize a new val.build project",
468
468
  exports: {
469
469
  "./main": {
@@ -516,6 +516,9 @@ var packageJson = {
516
516
  var VAL_CLIENT = function VAL_CLIENT(configImportPath) {
517
517
  return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst { useValStega: useVal } = initValClient(config);\n\nexport { useVal };\n");
518
518
  };
519
+ var VAL_RSC = function VAL_RSC(configImportPath) {
520
+ return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst { fetchValStega: fetchVal } = initValRsc(config, {\n draftMode,\n headers,\n cookies,\n});\n\nexport { fetchVal };\n");
521
+ };
519
522
  var VAL_SERVER = function VAL_SERVER(configImportPath) {
520
523
  return "import \"server-only\";\nimport { initValServer } from \"@valbuild/next/server\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { draftMode } from \"next/headers\";\n\nconst { valNextAppRouter } = initValServer(\n { ...config },\n {\n draftMode,\n }\n);\n\nexport { valNextAppRouter };\n");
521
524
  };
@@ -1142,7 +1145,7 @@ function _plan() {
1142
1145
  if (_answer4) {
1143
1146
  plan.createValRsc = {
1144
1147
  path: path__default["default"].join(valUtilsDir, analysis.isTypeScript ? "val.rsc.ts" : "val.rsc.js"),
1145
- source: VAL_SERVER(valUtilsImportPath)
1148
+ source: VAL_RSC(valUtilsImportPath)
1146
1149
  };
1147
1150
  } else {
1148
1151
  plan.createValRsc = false;
@@ -451,7 +451,7 @@ function transformNextAppRouterValProvider(fileInfo, api, options) {
451
451
 
452
452
  var packageJson = {
453
453
  name: "@valbuild/init",
454
- version: "0.57.0",
454
+ version: "0.59.0",
455
455
  description: "Initialize a new val.build project",
456
456
  exports: {
457
457
  "./main": {
@@ -504,6 +504,9 @@ var packageJson = {
504
504
  var VAL_CLIENT = function VAL_CLIENT(configImportPath) {
505
505
  return "import \"client-only\";\nimport { initValClient } from \"@valbuild/next/client\";\nimport { config } from \"".concat(configImportPath, "\";\n\nconst { useValStega: useVal } = initValClient(config);\n\nexport { useVal };\n");
506
506
  };
507
+ var VAL_RSC = function VAL_RSC(configImportPath) {
508
+ return "import \"server-only\";\nimport { initValRsc } from \"@valbuild/next/rsc\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { cookies, draftMode, headers } from \"next/headers\";\n\nconst { fetchValStega: fetchVal } = initValRsc(config, {\n draftMode,\n headers,\n cookies,\n});\n\nexport { fetchVal };\n");
509
+ };
507
510
  var VAL_SERVER = function VAL_SERVER(configImportPath) {
508
511
  return "import \"server-only\";\nimport { initValServer } from \"@valbuild/next/server\";\nimport { config } from \"".concat(configImportPath, "\";\nimport { draftMode } from \"next/headers\";\n\nconst { valNextAppRouter } = initValServer(\n { ...config },\n {\n draftMode,\n }\n);\n\nexport { valNextAppRouter };\n");
509
512
  };
@@ -1130,7 +1133,7 @@ function _plan() {
1130
1133
  if (_answer4) {
1131
1134
  plan.createValRsc = {
1132
1135
  path: path.join(valUtilsDir, analysis.isTypeScript ? "val.rsc.ts" : "val.rsc.js"),
1133
- source: VAL_SERVER(valUtilsImportPath)
1136
+ source: VAL_RSC(valUtilsImportPath)
1134
1137
  };
1135
1138
  } else {
1136
1139
  plan.createValRsc = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/init",
3
- "version": "0.57.0",
3
+ "version": "0.59.0",
4
4
  "description": "Initialize a new val.build project",
5
5
  "exports": {
6
6
  "./main": {
package/src/init.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  VAL_APP_PAGE,
14
14
  VAL_CLIENT,
15
15
  VAL_CONFIG,
16
+ VAL_RSC,
16
17
  VAL_SERVER,
17
18
  } from "./templates";
18
19
  import * as logger from "./logger";
@@ -487,7 +488,7 @@ async function plan(
487
488
  valUtilsDir,
488
489
  analysis.isTypeScript ? "val.rsc.ts" : "val.rsc.js"
489
490
  ),
490
- source: VAL_SERVER(valUtilsImportPath),
491
+ source: VAL_RSC(valUtilsImportPath),
491
492
  };
492
493
  } else {
493
494
  plan.createValRsc = false;