@cms0/cms0 0.0.13 → 0.1.1

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.
@@ -120,10 +120,14 @@ async function loadUserConfig(configPath) {
120
120
  const isEsmPkg = pkgType === "module";
121
121
  if (isEsmPkg) {
122
122
  const compiledHref = await transpileTsModuleToTemp(resolvedPath);
123
- const imported = (await Promise.resolve(`${compiledHref}`).then(s => __importStar(require(s))));
124
- const config = imported?.default ?? imported?.config ?? imported ?? {};
125
- cleanupTempModule(compiledHref);
126
- return { path: resolvedPath, config };
123
+ try {
124
+ const imported = (await importByHref(compiledHref));
125
+ const config = imported?.default ?? imported?.config ?? imported ?? {};
126
+ return { path: resolvedPath, config };
127
+ }
128
+ finally {
129
+ cleanupTempModule(compiledHref);
130
+ }
127
131
  }
128
132
  const previous = process.env.TS_NODE_COMPILER_OPTIONS;
129
133
  // register ts-node on demand so TypeScript configs can be required
@@ -144,10 +148,15 @@ async function loadUserConfig(configPath) {
144
148
  }
145
149
  }
146
150
  }
147
- const imported = (await Promise.resolve(`${(0, url_1.pathToFileURL)(resolvedPath).href}`).then(s => __importStar(require(s))));
151
+ const imported = (await importByHref((0, url_1.pathToFileURL)(resolvedPath).href));
148
152
  const config = imported?.default ?? imported?.config ?? imported ?? {};
149
153
  return { path: resolvedPath, config };
150
154
  }
155
+ async function importByHref(href) {
156
+ // Keep runtime import() intact in both ESM and CJS outputs.
157
+ const runImport = new Function("specifier", "return import(specifier);");
158
+ return runImport(href);
159
+ }
151
160
  function resolvePaths(cfgPath, config) {
152
161
  if (!config.entry) {
153
162
  throw new Error("cms0: config.entry is required");
@@ -76,10 +76,14 @@ async function loadUserConfig(configPath) {
76
76
  const isEsmPkg = pkgType === "module";
77
77
  if (isEsmPkg) {
78
78
  const compiledHref = await transpileTsModuleToTemp(resolvedPath);
79
- const imported = (await import(compiledHref));
80
- const config = imported?.default ?? imported?.config ?? imported ?? {};
81
- cleanupTempModule(compiledHref);
82
- return { path: resolvedPath, config };
79
+ try {
80
+ const imported = (await importByHref(compiledHref));
81
+ const config = imported?.default ?? imported?.config ?? imported ?? {};
82
+ return { path: resolvedPath, config };
83
+ }
84
+ finally {
85
+ cleanupTempModule(compiledHref);
86
+ }
83
87
  }
84
88
  const previous = process.env.TS_NODE_COMPILER_OPTIONS;
85
89
  // register ts-node on demand so TypeScript configs can be required
@@ -100,10 +104,15 @@ async function loadUserConfig(configPath) {
100
104
  }
101
105
  }
102
106
  }
103
- const imported = (await import(pathToFileURL(resolvedPath).href));
107
+ const imported = (await importByHref(pathToFileURL(resolvedPath).href));
104
108
  const config = imported?.default ?? imported?.config ?? imported ?? {};
105
109
  return { path: resolvedPath, config };
106
110
  }
111
+ async function importByHref(href) {
112
+ // Keep runtime import() intact in both ESM and CJS outputs.
113
+ const runImport = new Function("specifier", "return import(specifier);");
114
+ return runImport(href);
115
+ }
107
116
  function resolvePaths(cfgPath, config) {
108
117
  if (!config.entry) {
109
118
  throw new Error("cms0: config.entry is required");
@@ -1,5 +1,5 @@
1
- import { Cms0Config } from "@cms0/cms0/config";
2
- import { ResolvedConfig } from "./types.js";
1
+ import type { Cms0Config } from "@cms0/cms0/config";
2
+ import type { ResolvedConfig } from "./types.js";
3
3
  declare const DEFAULT_CONFIG_BASENAMES: string[];
4
4
  declare function findConfigPath(provided?: string): string | undefined;
5
5
  declare function loadUserConfig(configPath?: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../../../src/libs/cli/config-loader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,QAAA,MAAM,wBAAwB,UAM7B,CAAC;AAEF,iBAAS,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmB7D;AA8BD,iBAAe,cAAc,CAC3B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,SAAS,CAAC,CAmD3D;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,cAAc,CAkBzE;AAED,iBAAS,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY3D;AA+BD,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,GACb,CAAC"}
1
+ {"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../../../src/libs/cli/config-loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,QAAA,MAAM,wBAAwB,UAM7B,CAAC;AAEF,iBAAS,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmB7D;AA8BD,iBAAe,cAAc,CAC3B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,SAAS,CAAC,CAsD3D;AAWD,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,cAAc,CAkBzE;AAED,iBAAS,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY3D;AA+BD,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,GACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cms0/cms0",
3
- "version": "0.0.13",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
@@ -42,10 +42,12 @@
42
42
  "types": "./dist/types/generated/schema-descriptor.d.ts",
43
43
  "import": "./dist/esm/generated/schema-descriptor.js",
44
44
  "require": "./dist/cjs/generated/schema-descriptor.cjs"
45
- }
45
+ },
46
+ "./responsive-break.css": "./src/responsive-break.css"
46
47
  },
47
48
  "files": [
48
- "dist"
49
+ "dist",
50
+ "src/responsive-break.css"
49
51
  ],
50
52
  "keywords": [],
51
53
  "author": "",
@@ -57,7 +59,7 @@
57
59
  "ts-node": "^10.9.2",
58
60
  "typescript": "^5.9.3",
59
61
  "zod": "^4.1.12",
60
- "@cms0/shared": "0.0.5"
62
+ "@cms0/shared": "0.1.0"
61
63
  },
62
64
  "devDependencies": {
63
65
  "@types/lodash": "^4.17.21",
@@ -0,0 +1 @@
1
+ @import "@cms0/shared/responsive-break.css";