@danielx/civet 0.10.0 → 0.10.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ This changelog is generated automatically by [`build/changelog.civet`](build/cha
4
4
  For each version of Civet, it lists and links to all incorporated PRs,
5
5
  as well as a full diff and commit list.
6
6
 
7
+ ## 0.10.1 (2025-03-22, [diff](https://github.com/DanielXMoore/Civet/compare/v0.10.0...v0.10.1), [commits](https://github.com/DanielXMoore/Civet/commits/v0.10.1))
8
+ * More general expressions in indented forms of `implements` and `with` [[#1720](https://github.com/DanielXMoore/Civet/pull/1720)]
9
+ * Allow `>code` to continue an implicit JSX fragment [[#1721](https://github.com/DanielXMoore/Civet/pull/1721)]
10
+ * Fix hot reload via unplugin in NextJS, fix sourcemaps with `ts: "preserve"` [[#1722](https://github.com/DanielXMoore/Civet/pull/1722)]
11
+ * Farm and Rolldown bundler support [[#1723](https://github.com/DanielXMoore/Civet/pull/1723)]
12
+
7
13
  ## 0.10.0 (2025-03-17, [diff](https://github.com/DanielXMoore/Civet/compare/v0.9.7...v0.10.0), [commits](https://github.com/DanielXMoore/Civet/commits/v0.10.0))
8
14
  * Document `class with A, B` mixins [[#1703](https://github.com/DanielXMoore/Civet/pull/1703)]
9
15
  * Document how to use VSCode plugin [[#1704](https://github.com/DanielXMoore/Civet/pull/1704)]
package/README.md CHANGED
@@ -17,7 +17,7 @@ The modern way to write TypeScript.
17
17
  - [Civet VSCode Extension](https://marketplace.visualstudio.com/items?itemName=DanielX.civet)
18
18
  - [Discord Server](https://discord.gg/xkrW9GebBc)
19
19
  - Plugins for
20
- [Vite, esbuild, Astro, Rollup, Webpack, Rspack](source/unplugin),
20
+ [Vite, esbuild, Astro, Farm, Rolldown, Rollup, Webpack](source/unplugin),
21
21
  <!--
22
22
  [esbuild](source/esbuild-plugin.civet),
23
23
  [Vite](https://github.com/edemaine/vite-plugin-civet),
package/dist/browser.js CHANGED
@@ -7250,6 +7250,7 @@ ${js}`
7250
7250
  TypeIndexedAccess,
7251
7251
  UnknownAlias,
7252
7252
  TypePrimary,
7253
+ TypeIdentifier,
7253
7254
  ImportType,
7254
7255
  TypeTuple,
7255
7256
  TypeTupleContent,
@@ -8196,7 +8197,7 @@ ${js}`
8196
8197
  function ExtendsClause(ctx, state2) {
8197
8198
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsClause", ExtendsClause$0);
8198
8199
  }
8199
- var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ExtendsTarget, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
8200
+ var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, Expression, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
8200
8201
  var targets = $4;
8201
8202
  return targets.length ? (targets = targets.map(($) => $.slice(0, -1)), {
8202
8203
  type: "WithClause",
@@ -8270,7 +8271,7 @@ ${js}`
8270
8271
  function ExtendsTarget(ctx, state2) {
8271
8272
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsTarget", ExtendsTarget$0);
8272
8273
  }
8273
- var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ImplementsTarget, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
8274
+ var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, TypeIdentifier, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
8274
8275
  var i = $1, targets = $3;
8275
8276
  if (!targets.length) return $skip;
8276
8277
  let last = targets.at(-1).slice(0, -1);
@@ -13903,7 +13904,7 @@ ${js}`
13903
13904
  function Yield(ctx, state2) {
13904
13905
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
13905
13906
  }
13906
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
13907
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
13907
13908
  let jsx = $2.length === 0 ? $1 : {
13908
13909
  type: "JSXFragment",
13909
13910
  children: [
@@ -15004,14 +15005,24 @@ ${js}`
15004
15005
  t,
15005
15006
  children: $0
15006
15007
  };
15007
- }), TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
15008
+ }), TypePrimary$8 = TypeIdentifier, TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
15009
+ return $4 ? {
15010
+ type: "TypeParenthesized",
15011
+ children: [$1, $2, $4, $6, $7]
15012
+ // omit AllowAll/RestoreAll
15013
+ } : $skip;
15014
+ }), TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9];
15015
+ function TypePrimary(ctx, state2) {
15016
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
15017
+ }
15018
+ var TypeIdentifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
15008
15019
  return {
15009
15020
  type: "TypeIdentifier",
15010
15021
  children: $0,
15011
15022
  raw: $2.token,
15012
15023
  args: void 0
15013
15024
  };
15014
- }), TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
15025
+ }), TypeIdentifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
15015
15026
  var args = $4;
15016
15027
  return {
15017
15028
  type: "TypeIdentifier",
@@ -15019,15 +15030,9 @@ ${js}`
15019
15030
  raw: [$2.name, ...$3.map(([dot, id]) => dot.token + id.name)].join(""),
15020
15031
  args
15021
15032
  };
15022
- }), TypePrimary$10 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
15023
- return $4 ? {
15024
- type: "TypeParenthesized",
15025
- children: [$1, $2, $4, $6, $7]
15026
- // omit AllowAll/RestoreAll
15027
- } : $skip;
15028
- }), TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
15029
- function TypePrimary(ctx, state2) {
15030
- return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
15033
+ }), TypeIdentifier$$ = [TypeIdentifier$0, TypeIdentifier$1];
15034
+ function TypeIdentifier(ctx, state2) {
15035
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeIdentifier", TypeIdentifier$$);
15031
15036
  }
15032
15037
  var ImportType$0 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), OpenParen, __, StringLiteral, __, CloseParen, (0, import_lib2.$E)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)(TypeArguments)), ImportType$1 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), InsertOpenParen, (0, import_lib2.$E)(Trimmed_), StringLiteral, InsertCloseParen), ImportType$$ = [ImportType$0, ImportType$1];
15033
15038
  function ImportType(ctx, state2) {
package/dist/main.js CHANGED
@@ -9615,6 +9615,7 @@ var grammar = {
9615
9615
  TypeIndexedAccess,
9616
9616
  UnknownAlias,
9617
9617
  TypePrimary,
9618
+ TypeIdentifier,
9618
9619
  ImportType,
9619
9620
  TypeTuple,
9620
9621
  TypeTupleContent,
@@ -11182,7 +11183,7 @@ var ExtendsClause$0 = (0, import_lib2.$S)(ExtendsToken, __, ExtendsTarget);
11182
11183
  function ExtendsClause(ctx, state2) {
11183
11184
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsClause", ExtendsClause$0);
11184
11185
  }
11185
- var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ExtendsTarget, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11186
+ var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, Expression, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11186
11187
  var targets = $4;
11187
11188
  if (!targets.length) return $skip;
11188
11189
  targets = targets.map(($) => $.slice(0, -1));
@@ -11274,7 +11275,7 @@ var ExtendsTarget$0 = (0, import_lib2.$TV)(LeftHandSideExpressionWithObjectAppli
11274
11275
  function ExtendsTarget(ctx, state2) {
11275
11276
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsTarget", ExtendsTarget$0);
11276
11277
  }
11277
- var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ImplementsTarget, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11278
+ var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, TypeIdentifier, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11278
11279
  var i = $1;
11279
11280
  var targets = $3;
11280
11281
  if (!targets.length) return $skip;
@@ -18402,7 +18403,7 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
18402
18403
  function Yield(ctx, state2) {
18403
18404
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
18404
18405
  }
18405
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
18406
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
18406
18407
  const jsx = $2.length === 0 ? $1 : {
18407
18408
  type: "JSXFragment",
18408
18409
  children: [
@@ -19856,7 +19857,20 @@ var TypePrimary$7 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19856
19857
  children: $0
19857
19858
  };
19858
19859
  });
19859
- var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19860
+ var TypePrimary$8 = TypeIdentifier;
19861
+ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19862
+ if (!$4) return $skip;
19863
+ return {
19864
+ type: "TypeParenthesized",
19865
+ children: [$1, $2, $4, $6, $7]
19866
+ // omit AllowAll/RestoreAll
19867
+ };
19868
+ });
19869
+ var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9];
19870
+ function TypePrimary(ctx, state2) {
19871
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19872
+ }
19873
+ var TypeIdentifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19860
19874
  return {
19861
19875
  type: "TypeIdentifier",
19862
19876
  children: $0,
@@ -19864,7 +19878,7 @@ var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19864
19878
  args: void 0
19865
19879
  };
19866
19880
  });
19867
- var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19881
+ var TypeIdentifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19868
19882
  var args = $4;
19869
19883
  return {
19870
19884
  type: "TypeIdentifier",
@@ -19873,17 +19887,9 @@ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19873
19887
  args
19874
19888
  };
19875
19889
  });
19876
- var TypePrimary$10 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19877
- if (!$4) return $skip;
19878
- return {
19879
- type: "TypeParenthesized",
19880
- children: [$1, $2, $4, $6, $7]
19881
- // omit AllowAll/RestoreAll
19882
- };
19883
- });
19884
- var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
19885
- function TypePrimary(ctx, state2) {
19886
- return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19890
+ var TypeIdentifier$$ = [TypeIdentifier$0, TypeIdentifier$1];
19891
+ function TypeIdentifier(ctx, state2) {
19892
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeIdentifier", TypeIdentifier$$);
19887
19893
  }
19888
19894
  var ImportType$0 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), OpenParen, __, StringLiteral, __, CloseParen, (0, import_lib2.$E)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)(TypeArguments));
19889
19895
  var ImportType$1 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), InsertOpenParen, (0, import_lib2.$E)(Trimmed_), StringLiteral, InsertCloseParen);
package/dist/main.mjs CHANGED
@@ -9596,6 +9596,7 @@ var grammar = {
9596
9596
  TypeIndexedAccess,
9597
9597
  UnknownAlias,
9598
9598
  TypePrimary,
9599
+ TypeIdentifier,
9599
9600
  ImportType,
9600
9601
  TypeTuple,
9601
9602
  TypeTupleContent,
@@ -11163,7 +11164,7 @@ var ExtendsClause$0 = (0, import_lib2.$S)(ExtendsToken, __, ExtendsTarget);
11163
11164
  function ExtendsClause(ctx, state2) {
11164
11165
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsClause", ExtendsClause$0);
11165
11166
  }
11166
- var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ExtendsTarget, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11167
+ var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, Expression, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11167
11168
  var targets = $4;
11168
11169
  if (!targets.length) return $skip;
11169
11170
  targets = targets.map(($) => $.slice(0, -1));
@@ -11255,7 +11256,7 @@ var ExtendsTarget$0 = (0, import_lib2.$TV)(LeftHandSideExpressionWithObjectAppli
11255
11256
  function ExtendsTarget(ctx, state2) {
11256
11257
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsTarget", ExtendsTarget$0);
11257
11258
  }
11258
- var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ImplementsTarget, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11259
+ var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, TypeIdentifier, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11259
11260
  var i = $1;
11260
11261
  var targets = $3;
11261
11262
  if (!targets.length) return $skip;
@@ -18383,7 +18384,7 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
18383
18384
  function Yield(ctx, state2) {
18384
18385
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
18385
18386
  }
18386
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
18387
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
18387
18388
  const jsx = $2.length === 0 ? $1 : {
18388
18389
  type: "JSXFragment",
18389
18390
  children: [
@@ -19837,7 +19838,20 @@ var TypePrimary$7 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19837
19838
  children: $0
19838
19839
  };
19839
19840
  });
19840
- var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19841
+ var TypePrimary$8 = TypeIdentifier;
19842
+ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19843
+ if (!$4) return $skip;
19844
+ return {
19845
+ type: "TypeParenthesized",
19846
+ children: [$1, $2, $4, $6, $7]
19847
+ // omit AllowAll/RestoreAll
19848
+ };
19849
+ });
19850
+ var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9];
19851
+ function TypePrimary(ctx, state2) {
19852
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19853
+ }
19854
+ var TypeIdentifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19841
19855
  return {
19842
19856
  type: "TypeIdentifier",
19843
19857
  children: $0,
@@ -19845,7 +19859,7 @@ var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19845
19859
  args: void 0
19846
19860
  };
19847
19861
  });
19848
- var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19862
+ var TypeIdentifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19849
19863
  var args = $4;
19850
19864
  return {
19851
19865
  type: "TypeIdentifier",
@@ -19854,17 +19868,9 @@ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19854
19868
  args
19855
19869
  };
19856
19870
  });
19857
- var TypePrimary$10 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19858
- if (!$4) return $skip;
19859
- return {
19860
- type: "TypeParenthesized",
19861
- children: [$1, $2, $4, $6, $7]
19862
- // omit AllowAll/RestoreAll
19863
- };
19864
- });
19865
- var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
19866
- function TypePrimary(ctx, state2) {
19867
- return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19871
+ var TypeIdentifier$$ = [TypeIdentifier$0, TypeIdentifier$1];
19872
+ function TypeIdentifier(ctx, state2) {
19873
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeIdentifier", TypeIdentifier$$);
19868
19874
  }
19869
19875
  var ImportType$0 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), OpenParen, __, StringLiteral, __, CloseParen, (0, import_lib2.$E)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)(TypeArguments));
19870
19876
  var ImportType$1 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), InsertOpenParen, (0, import_lib2.$E)(Trimmed_), StringLiteral, InsertCloseParen);
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: import("./unplugin.js").PluginOptions) => JsPlugin;
2
+ export default _default;
@@ -0,0 +1,36 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\farm.civet.jsx
30
+ var farm_civet_exports = {};
31
+ __export(farm_civet_exports, {
32
+ default: () => farm_civet_default
33
+ });
34
+ module.exports = __toCommonJS(farm_civet_exports);
35
+ var import_unplugin = __toESM(require("./unplugin.js"));
36
+ var farm_civet_default = import_unplugin.default.farm;
@@ -0,0 +1,6 @@
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\farm.civet.jsx
2
+ import civetUnplugin from "./unplugin.mjs";
3
+ var farm_civet_default = civetUnplugin.farm;
4
+ export {
5
+ farm_civet_default as default
6
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: import("./unplugin.js").PluginOptions) => any;
2
+ export default _default;
@@ -0,0 +1,36 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rolldown.civet.jsx
30
+ var rolldown_civet_exports = {};
31
+ __export(rolldown_civet_exports, {
32
+ default: () => rolldown_civet_default
33
+ });
34
+ module.exports = __toCommonJS(rolldown_civet_exports);
35
+ var import_unplugin = __toESM(require("./unplugin.js"));
36
+ var rolldown_civet_default = import_unplugin.default.rolldown;
@@ -0,0 +1,6 @@
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rolldown.civet.jsx
2
+ import civetUnplugin from "./unplugin.mjs";
3
+ var rolldown_civet_default = civetUnplugin.rolldown;
4
+ export {
5
+ rolldown_civet_default as default
6
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: import("./unplugin.js").PluginOptions) => RspackPluginInstance;
2
+ export default _default;
@@ -0,0 +1,36 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rspack.civet.jsx
30
+ var rspack_civet_exports = {};
31
+ __export(rspack_civet_exports, {
32
+ default: () => rspack_civet_default
33
+ });
34
+ module.exports = __toCommonJS(rspack_civet_exports);
35
+ var import_unplugin = __toESM(require("./unplugin.js"));
36
+ var rspack_civet_default = import_unplugin.default.rspack;
@@ -0,0 +1,6 @@
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rspack.civet.jsx
2
+ import civetUnplugin from "./unplugin.mjs";
3
+ var rspack_civet_default = civetUnplugin.rspack;
4
+ export {
5
+ rspack_civet_default as default
6
+ };
@@ -424,22 +424,30 @@ var rawPlugin = (options = {}, meta) => {
424
424
  }
425
425
  const basename = id.slice(0, match.index + match[1].length);
426
426
  const filename = import_path.default.resolve(rootDir, basename);
427
+ this.addWatchFile(filename);
427
428
  let mtime, cached, resolve;
428
429
  if (cache != null) {
429
- mtime = (await fs.promises.stat(filename)).mtimeMs;
430
- cached = cache?.get(filename);
431
- if (cached && cached.mtime === mtime) {
432
- if (cached.promise) {
433
- await cached.promise;
434
- }
435
- if (cached.result) {
436
- return cached.result;
430
+ try {
431
+ mtime = (await fs.promises.stat(filename)).mtimeMs;
432
+ } catch (e) {
433
+ }
434
+ if (mtime != null) {
435
+ cached = cache.get(filename);
436
+ if (cached && cached.mtime === mtime) {
437
+ if (cached.promise) {
438
+ await cached.promise;
439
+ }
440
+ let ref3;
441
+ if ((ref3 = cached.result) != null) {
442
+ const result = ref3;
443
+ return result;
444
+ }
437
445
  }
446
+ const promise = new Promise((r) => {
447
+ resolve = r;
448
+ });
449
+ cache.set(filename, cached = { mtime, promise });
438
450
  }
439
- const promise = new Promise((r) => {
440
- resolve = r;
441
- });
442
- cache.set(filename, cached = { mtime, promise });
443
451
  }
444
452
  try {
445
453
  let checkErrors = function() {
@@ -449,7 +457,6 @@ var rawPlugin = (options = {}, meta) => {
449
457
  ;
450
458
  return;
451
459
  };
452
- this.addWatchFile(filename);
453
460
  let compiled;
454
461
  let sourceMap;
455
462
  const civetOptions = {
@@ -502,13 +509,14 @@ var rawPlugin = (options = {}, meta) => {
502
509
  }
503
510
  case "preserve": {
504
511
  compiled = compiledTS;
512
+ sourceMap = civetSourceMap;
505
513
  break;
506
514
  }
507
515
  }
508
516
  }
509
517
  if (transformTS) {
510
- for (let ref3 = import_civet.lib.gatherRecursive(ast, ($) => $.type === "ModuleSpecifier"), i = 0, len = ref3.length; i < len; i++) {
511
- const _spec = ref3[i];
518
+ for (let ref4 = import_civet.lib.gatherRecursive(ast, ($) => $.type === "ModuleSpecifier"), i = 0, len = ref4.length; i < len; i++) {
519
+ const _spec = ref4[i];
512
520
  const spec = _spec;
513
521
  if (spec.module?.input) {
514
522
  spec.module.token = spec.module.input.replace(/\.([mc])?ts(['"])$/, ".$1js$2");
@@ -593,6 +601,16 @@ var rawPlugin = (options = {}, meta) => {
593
601
  return modules;
594
602
  }
595
603
  },
604
+ rspack(compiler) {
605
+ if (implicitExtension) {
606
+ compiler.options ??= {};
607
+ compiler.options.resolve ??= {};
608
+ compiler.options.resolve.extensions ??= ["", ".js", ".json", ".wasm"];
609
+ return compiler.options.resolve.extensions.unshift(".civet");
610
+ }
611
+ ;
612
+ return;
613
+ },
596
614
  webpack(compiler) {
597
615
  if (implicitExtension) {
598
616
  compiler.options ??= {};
@@ -601,9 +619,9 @@ var rawPlugin = (options = {}, meta) => {
601
619
  compiler.options.resolve.extensions.unshift(".civet");
602
620
  }
603
621
  return aliasResolver = (id) => {
604
- let ref4;
605
- for (const key in ref4 = compiler.options.resolve.alias) {
606
- const value = ref4[key];
622
+ let ref5;
623
+ for (const key in ref5 = compiler.options.resolve.alias) {
624
+ const value = ref5[key];
607
625
  if (key.endsWith("$")) {
608
626
  if (id === key.slice(0, -1)) {
609
627
  return typeof value === "string" ? value : "\0";
@@ -392,22 +392,30 @@ var rawPlugin = (options = {}, meta) => {
392
392
  }
393
393
  const basename = id.slice(0, match.index + match[1].length);
394
394
  const filename = path.resolve(rootDir, basename);
395
+ this.addWatchFile(filename);
395
396
  let mtime, cached, resolve;
396
397
  if (cache != null) {
397
- mtime = (await fs.promises.stat(filename)).mtimeMs;
398
- cached = cache?.get(filename);
399
- if (cached && cached.mtime === mtime) {
400
- if (cached.promise) {
401
- await cached.promise;
402
- }
403
- if (cached.result) {
404
- return cached.result;
398
+ try {
399
+ mtime = (await fs.promises.stat(filename)).mtimeMs;
400
+ } catch (e) {
401
+ }
402
+ if (mtime != null) {
403
+ cached = cache.get(filename);
404
+ if (cached && cached.mtime === mtime) {
405
+ if (cached.promise) {
406
+ await cached.promise;
407
+ }
408
+ let ref3;
409
+ if ((ref3 = cached.result) != null) {
410
+ const result = ref3;
411
+ return result;
412
+ }
405
413
  }
414
+ const promise = new Promise((r) => {
415
+ resolve = r;
416
+ });
417
+ cache.set(filename, cached = { mtime, promise });
406
418
  }
407
- const promise = new Promise((r) => {
408
- resolve = r;
409
- });
410
- cache.set(filename, cached = { mtime, promise });
411
419
  }
412
420
  try {
413
421
  let checkErrors = function() {
@@ -417,7 +425,6 @@ var rawPlugin = (options = {}, meta) => {
417
425
  ;
418
426
  return;
419
427
  };
420
- this.addWatchFile(filename);
421
428
  let compiled;
422
429
  let sourceMap;
423
430
  const civetOptions = {
@@ -470,13 +477,14 @@ var rawPlugin = (options = {}, meta) => {
470
477
  }
471
478
  case "preserve": {
472
479
  compiled = compiledTS;
480
+ sourceMap = civetSourceMap;
473
481
  break;
474
482
  }
475
483
  }
476
484
  }
477
485
  if (transformTS) {
478
- for (let ref3 = lib.gatherRecursive(ast, ($) => $.type === "ModuleSpecifier"), i = 0, len = ref3.length; i < len; i++) {
479
- const _spec = ref3[i];
486
+ for (let ref4 = lib.gatherRecursive(ast, ($) => $.type === "ModuleSpecifier"), i = 0, len = ref4.length; i < len; i++) {
487
+ const _spec = ref4[i];
480
488
  const spec = _spec;
481
489
  if (spec.module?.input) {
482
490
  spec.module.token = spec.module.input.replace(/\.([mc])?ts(['"])$/, ".$1js$2");
@@ -561,6 +569,16 @@ var rawPlugin = (options = {}, meta) => {
561
569
  return modules;
562
570
  }
563
571
  },
572
+ rspack(compiler) {
573
+ if (implicitExtension) {
574
+ compiler.options ??= {};
575
+ compiler.options.resolve ??= {};
576
+ compiler.options.resolve.extensions ??= ["", ".js", ".json", ".wasm"];
577
+ return compiler.options.resolve.extensions.unshift(".civet");
578
+ }
579
+ ;
580
+ return;
581
+ },
564
582
  webpack(compiler) {
565
583
  if (implicitExtension) {
566
584
  compiler.options ??= {};
@@ -569,9 +587,9 @@ var rawPlugin = (options = {}, meta) => {
569
587
  compiler.options.resolve.extensions.unshift(".civet");
570
588
  }
571
589
  return aliasResolver = (id) => {
572
- let ref4;
573
- for (const key in ref4 = compiler.options.resolve.alias) {
574
- const value = ref4[key];
590
+ let ref5;
591
+ for (const key in ref5 = compiler.options.resolve.alias) {
592
+ const value = ref5[key];
575
593
  if (key.endsWith("$")) {
576
594
  if (id === key.slice(0, -1)) {
577
595
  return typeof value === "string" ? value : "\0";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.10.0",
4
+ "version": "0.10.1",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",
@@ -33,6 +33,36 @@
33
33
  "require": "./dist/unplugin/unplugin.js",
34
34
  "import": "./dist/unplugin/unplugin.mjs"
35
35
  },
36
+ "./astro": {
37
+ "types": "./dist/unplugin/astro.d.ts",
38
+ "require": "./dist/unplugin/astro.js",
39
+ "import": "./dist/unplugin/astro.mjs"
40
+ },
41
+ "./esbuild": {
42
+ "types": "./dist/unplugin/esbuild.d.ts",
43
+ "require": "./dist/unplugin/esbuild.js",
44
+ "import": "./dist/unplugin/esbuild.mjs"
45
+ },
46
+ "./farm": {
47
+ "types": "./dist/unplugin/farm.d.ts",
48
+ "require": "./dist/unplugin/farm.js",
49
+ "import": "./dist/unplugin/farm.mjs"
50
+ },
51
+ "./rolldown": {
52
+ "types": "./dist/unplugin/rolldown.d.ts",
53
+ "require": "./dist/unplugin/rolldown.js",
54
+ "import": "./dist/unplugin/rolldown.mjs"
55
+ },
56
+ "./rollup": {
57
+ "types": "./dist/unplugin/rollup.d.ts",
58
+ "require": "./dist/unplugin/rollup.js",
59
+ "import": "./dist/unplugin/rollup.mjs"
60
+ },
61
+ "./rspack": {
62
+ "types": "./dist/unplugin/rspack.d.ts",
63
+ "require": "./dist/unplugin/rspack.js",
64
+ "import": "./dist/unplugin/rspack.mjs"
65
+ },
36
66
  "./vite": {
37
67
  "types": "./dist/unplugin/vite.d.ts",
38
68
  "require": "./dist/unplugin/vite.js",
@@ -43,21 +73,6 @@
43
73
  "require": "./dist/unplugin/webpack.js",
44
74
  "import": "./dist/unplugin/webpack.mjs"
45
75
  },
46
- "./rollup": {
47
- "types": "./dist/unplugin/rollup.d.ts",
48
- "require": "./dist/unplugin/rollup.js",
49
- "import": "./dist/unplugin/rollup.mjs"
50
- },
51
- "./esbuild": {
52
- "types": "./dist/unplugin/esbuild.d.ts",
53
- "require": "./dist/unplugin/esbuild.js",
54
- "import": "./dist/unplugin/esbuild.mjs"
55
- },
56
- "./astro": {
57
- "types": "./dist/unplugin/astro.d.ts",
58
- "require": "./dist/unplugin/astro.js",
59
- "import": "./dist/unplugin/astro.mjs"
60
- },
61
76
  "./ts-diagnostic": {
62
77
  "require": "./dist/ts-diagnostic.js",
63
78
  "import": "./dist/ts-diagnostic.mjs"
@@ -92,7 +107,7 @@
92
107
  "dependencies": {
93
108
  "@cspotcode/source-map-support": "^0.8.1",
94
109
  "@typescript/vfs": "^1.6.0",
95
- "unplugin": "^2.1.0"
110
+ "unplugin": "^2.2.1"
96
111
  },
97
112
  "devDependencies": {
98
113
  "@danielx/civet": "0.9.4",