@danielx/civet 0.7.33 → 0.7.35

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/types.d.ts CHANGED
@@ -20,6 +20,7 @@ declare module "@danielx/civet" {
20
20
  coffeeOf: boolean
21
21
  coffeePrototype: boolean
22
22
  defaultElement: string
23
+ globals: string[]
23
24
  implicitReturns: boolean
24
25
  jsxCode: boolean
25
26
  objectIs: boolean
@@ -57,7 +57,12 @@ var postfixRE = /[?#].*$/s;
57
57
  var isWindows = import_os.default.platform() === "win32";
58
58
  var windowsSlashRE = /\\/g;
59
59
  function cleanCivetId(id) {
60
- return id.replace(postfixRE, "").replace(/\.[jt]sx$/, "");
60
+ let postfix = "";
61
+ id = id.replace(postfixRE, (match) => {
62
+ postfix = match;
63
+ return "";
64
+ }).replace(/\.[jt]sx$/, "");
65
+ return { id, postfix };
61
66
  }
62
67
  function tryStatSync(file) {
63
68
  try {
@@ -357,8 +362,16 @@ var rawPlugin = (options = {}, meta) => {
357
362
  resolveId(id, importer, options2) {
358
363
  if (/\0/.test(id))
359
364
  return null;
360
- id = cleanCivetId(id);
361
- let resolvedId = import_path.default.isAbsolute(id) ? resolveAbsolutePath(rootDir, id, implicitExtension) : import_path.default.resolve(import_path.default.dirname(importer ?? ""), id);
365
+ let postfix;
366
+ ({ id, postfix } = cleanCivetId(id));
367
+ let ref;
368
+ if (import_path.default.isAbsolute(id)) {
369
+ ref = resolveAbsolutePath(rootDir, id, implicitExtension);
370
+ } else {
371
+ ref = import_path.default.resolve(import_path.default.dirname(importer ?? ""), id);
372
+ }
373
+ ;
374
+ let resolvedId = ref;
362
375
  if (!resolvedId)
363
376
  return null;
364
377
  if (!resolvedId.endsWith(".civet")) {
@@ -372,7 +385,7 @@ var rawPlugin = (options = {}, meta) => {
372
385
  if (options2.scan && meta.framework === "vite") {
373
386
  resolvedId = `\0${resolvedId}`;
374
387
  }
375
- return resolvedId + outExt;
388
+ return resolvedId + outExt + postfix;
376
389
  },
377
390
  loadInclude(id) {
378
391
  return isCivetTranspiled.test(id);
@@ -25,7 +25,12 @@ var postfixRE = /[?#].*$/s;
25
25
  var isWindows = os.platform() === "win32";
26
26
  var windowsSlashRE = /\\/g;
27
27
  function cleanCivetId(id) {
28
- return id.replace(postfixRE, "").replace(/\.[jt]sx$/, "");
28
+ let postfix = "";
29
+ id = id.replace(postfixRE, (match) => {
30
+ postfix = match;
31
+ return "";
32
+ }).replace(/\.[jt]sx$/, "");
33
+ return { id, postfix };
29
34
  }
30
35
  function tryStatSync(file) {
31
36
  try {
@@ -325,8 +330,16 @@ var rawPlugin = (options = {}, meta) => {
325
330
  resolveId(id, importer, options2) {
326
331
  if (/\0/.test(id))
327
332
  return null;
328
- id = cleanCivetId(id);
329
- let resolvedId = path.isAbsolute(id) ? resolveAbsolutePath(rootDir, id, implicitExtension) : path.resolve(path.dirname(importer ?? ""), id);
333
+ let postfix;
334
+ ({ id, postfix } = cleanCivetId(id));
335
+ let ref;
336
+ if (path.isAbsolute(id)) {
337
+ ref = resolveAbsolutePath(rootDir, id, implicitExtension);
338
+ } else {
339
+ ref = path.resolve(path.dirname(importer ?? ""), id);
340
+ }
341
+ ;
342
+ let resolvedId = ref;
330
343
  if (!resolvedId)
331
344
  return null;
332
345
  if (!resolvedId.endsWith(".civet")) {
@@ -340,7 +353,7 @@ var rawPlugin = (options = {}, meta) => {
340
353
  if (options2.scan && meta.framework === "vite") {
341
354
  resolvedId = `\0${resolvedId}`;
342
355
  }
343
- return resolvedId + outExt;
356
+ return resolvedId + outExt + postfix;
344
357
  },
345
358
  loadInclude(id) {
346
359
  return isCivetTranspiled.test(id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.7.33",
4
+ "version": "0.7.35",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",