@cedarjs/vite 3.1.2-next.0 → 3.1.2-next.128
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/dist/api/vite-plugin-cedar-vitest-api-preset.d.ts +1 -1
- package/dist/api/vite-plugin-cedar-vitest-api-preset.d.ts.map +1 -1
- package/dist/api/vite-plugin-cedar-vitest-api-preset.js +2 -2
- package/dist/bundled/react-server-dom-webpack.server.js +114 -62
- package/dist/cjs/api/vite-plugin-cedar-vitest-api-preset.js +2 -2
- package/dist/cjs/index.js +14 -10
- package/dist/cjs/lib/StatusError.js +1 -0
- package/dist/cjs/lib/getMergedConfig.js +1 -1
- package/dist/cjs/plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js +106 -0
- package/dist/cjs/plugins/vite-plugin-rsc-routes-auto-loader.js +6 -6
- package/dist/cjs/plugins/vite-plugin-rsc-routes-imports.js +6 -6
- package/dist/cjs/plugins/vite-plugin-rsc-transform-client.js +1 -0
- package/dist/cjs/plugins/vite-plugin-rsc-transform-server.js +1 -0
- package/dist/cjs/rsc/rscBuildAnalyze.js +7 -1
- package/dist/cjs/rsc/rscBuildForServer.js +9 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/lib/StatusError.js +1 -0
- package/dist/lib/getMergedConfig.d.ts.map +1 -1
- package/dist/lib/getMergedConfig.js +1 -1
- package/dist/plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.d.ts +3 -0
- package/dist/plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.d.ts.map +1 -0
- package/dist/plugins/vite-plugin-cedarjs-resolve-cedar-style-imports.js +72 -0
- package/dist/plugins/vite-plugin-rsc-routes-auto-loader.js +3 -3
- package/dist/plugins/vite-plugin-rsc-routes-imports.js +3 -3
- package/dist/plugins/vite-plugin-rsc-transform-client.js +1 -0
- package/dist/plugins/vite-plugin-rsc-transform-server.js +1 -0
- package/dist/rsc/rscBuildAnalyze.d.ts.map +1 -1
- package/dist/rsc/rscBuildAnalyze.js +8 -2
- package/dist/rsc/rscBuildForServer.d.ts.map +1 -1
- package/dist/rsc/rscBuildForServer.js +10 -3
- package/package.json +16 -16
- package/dist/cjs/plugins/vite-plugin-cedarjs-directory-named-import.js +0 -82
- package/dist/plugins/vite-plugin-cedarjs-directory-named-import.d.ts +0 -3
- package/dist/plugins/vite-plugin-cedarjs-directory-named-import.d.ts.map +0 -1
- package/dist/plugins/vite-plugin-cedarjs-directory-named-import.js +0 -48
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var vite_plugin_cedarjs_directory_named_import_exports = {};
|
|
30
|
-
__export(vite_plugin_cedarjs_directory_named_import_exports, {
|
|
31
|
-
cedarjsDirectoryNamedImportPlugin: () => cedarjsDirectoryNamedImportPlugin
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(vite_plugin_cedarjs_directory_named_import_exports);
|
|
34
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
|
-
var import_project_config = require("@cedarjs/project-config");
|
|
37
|
-
function getNewPath(value, filename) {
|
|
38
|
-
const dirname = import_node_path.default.dirname(value);
|
|
39
|
-
const basename = import_node_path.default.basename(value);
|
|
40
|
-
const indexImportPath = [dirname, basename, "index"].join("/");
|
|
41
|
-
const resolvedFile = (0, import_project_config.resolveFile)(
|
|
42
|
-
import_node_path.default.resolve(import_node_path.default.dirname(filename), indexImportPath)
|
|
43
|
-
);
|
|
44
|
-
if (resolvedFile) {
|
|
45
|
-
return resolvedFile;
|
|
46
|
-
} else {
|
|
47
|
-
const dirnameImportPath = [dirname, basename, basename].join("/");
|
|
48
|
-
const resolvedPath = import_node_path.default.resolve(import_node_path.default.dirname(filename), dirnameImportPath);
|
|
49
|
-
const dirnameResolvedFile = (0, import_project_config.resolveFile)(resolvedPath);
|
|
50
|
-
if (dirnameResolvedFile) {
|
|
51
|
-
return dirnameResolvedFile;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
function cedarjsDirectoryNamedImportPlugin() {
|
|
57
|
-
return {
|
|
58
|
-
name: "cedarjs-directory-named-import",
|
|
59
|
-
resolveId(id, importer) {
|
|
60
|
-
if (!importer || importer.includes("/node_modules/")) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
const resolvedPath = import_node_path.default.resolve(import_node_path.default.dirname(importer), id);
|
|
64
|
-
if (import_node_fs.default.existsSync(resolvedPath)) {
|
|
65
|
-
const stats = import_node_fs.default.statSync(resolvedPath);
|
|
66
|
-
if (stats.isFile()) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const newPath = getNewPath(id, importer);
|
|
71
|
-
if (!newPath) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
const resolvedDirnamePath = import_node_path.default.resolve(import_node_path.default.dirname(importer), newPath);
|
|
75
|
-
return resolvedDirnamePath;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
cedarjsDirectoryNamedImportPlugin
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-cedarjs-directory-named-import.d.ts","sourceRoot":"","sources":["../../src/plugins/vite-plugin-cedarjs-directory-named-import.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAgClC,wBAAgB,iCAAiC,IAAI,MAAM,CA+B1D"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { resolveFile } from "@cedarjs/project-config";
|
|
4
|
-
function getNewPath(value, filename) {
|
|
5
|
-
const dirname = path.dirname(value);
|
|
6
|
-
const basename = path.basename(value);
|
|
7
|
-
const indexImportPath = [dirname, basename, "index"].join("/");
|
|
8
|
-
const resolvedFile = resolveFile(
|
|
9
|
-
path.resolve(path.dirname(filename), indexImportPath)
|
|
10
|
-
);
|
|
11
|
-
if (resolvedFile) {
|
|
12
|
-
return resolvedFile;
|
|
13
|
-
} else {
|
|
14
|
-
const dirnameImportPath = [dirname, basename, basename].join("/");
|
|
15
|
-
const resolvedPath = path.resolve(path.dirname(filename), dirnameImportPath);
|
|
16
|
-
const dirnameResolvedFile = resolveFile(resolvedPath);
|
|
17
|
-
if (dirnameResolvedFile) {
|
|
18
|
-
return dirnameResolvedFile;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
function cedarjsDirectoryNamedImportPlugin() {
|
|
24
|
-
return {
|
|
25
|
-
name: "cedarjs-directory-named-import",
|
|
26
|
-
resolveId(id, importer) {
|
|
27
|
-
if (!importer || importer.includes("/node_modules/")) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const resolvedPath = path.resolve(path.dirname(importer), id);
|
|
31
|
-
if (fs.existsSync(resolvedPath)) {
|
|
32
|
-
const stats = fs.statSync(resolvedPath);
|
|
33
|
-
if (stats.isFile()) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const newPath = getNewPath(id, importer);
|
|
38
|
-
if (!newPath) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const resolvedDirnamePath = path.resolve(path.dirname(importer), newPath);
|
|
42
|
-
return resolvedDirnamePath;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
cedarjsDirectoryNamedImportPlugin
|
|
48
|
-
};
|