crankscript 0.15.1 → 0.16.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # crankscript
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#66](https://github.com/crankscript/crankscript/pull/66) [`d25e342`](https://github.com/crankscript/crankscript/commit/d25e3427ea07c4a6c4f76931f89f2a5a2e2c7a4f) Thanks [@alberteddu](https://github.com/alberteddu)! - update types to Playdate SDK 2.7.4
8
+
9
+ ## 0.15.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#64](https://github.com/crankscript/crankscript/pull/64) [`f771b7a`](https://github.com/crankscript/crankscript/commit/f771b7a9414fcca89ac2e50cda85d171e127927e) Thanks [@alberteddu](https://github.com/alberteddu)! - abstract methods do not cause transpilation to fail anymore
14
+
3
15
  ## 0.15.0
4
16
 
5
17
  ### Minor Changes
@@ -9,10 +9,15 @@ Object.defineProperty(exports, "transformMethodDeclaration", {
9
9
  }
10
10
  });
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _typescript = /*#__PURE__*/ _interop_require_wildcard._(require("typescript"));
12
13
  const _typescripttolua = /*#__PURE__*/ _interop_require_wildcard._(require("typescript-to-lua"));
13
14
  const _function = require("typescript-to-lua/dist/transformation/visitors/function");
14
15
  const _transformPropertyName = require("./transformPropertyName");
15
16
  const transformMethodDeclaration = (context, node, className)=>{
17
+ var _node_modifiers;
18
+ if ((_node_modifiers = node.modifiers) == null ? void 0 : _node_modifiers.some((modifier)=>modifier.kind === _typescript.SyntaxKind.AbstractKeyword)) {
19
+ return undefined;
20
+ }
16
21
  const [functionExpression] = (0, _function.transformFunctionToExpression)(context, node);
17
22
  return _typescripttolua.createAssignmentStatement(_typescripttolua.createTableIndexExpression(className, (0, _transformPropertyName.transformPropertyName)(context, node.name)), functionExpression);
18
23
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../libs/tstl-plugin/src/transformClassDeclaration/transformMethodDeclaration.ts"],"sourcesContent":["import * as ts from 'typescript';\nimport { TransformationContext } from 'typescript-to-lua';\nimport * as tstl from 'typescript-to-lua';\nimport { transformFunctionToExpression } from 'typescript-to-lua/dist/transformation/visitors/function';\nimport { transformPropertyName } from './transformPropertyName';\n\nexport const transformMethodDeclaration = (\n context: TransformationContext,\n node: ts.MethodDeclaration,\n className: tstl.Identifier,\n): tstl.Statement | undefined => {\n const [functionExpression] = transformFunctionToExpression(context, node);\n return tstl.createAssignmentStatement(\n tstl.createTableIndexExpression(\n className,\n transformPropertyName(context, node.name),\n ),\n functionExpression,\n );\n};\n"],"names":["transformMethodDeclaration","context","node","className","functionExpression","transformFunctionToExpression","tstl","createAssignmentStatement","createTableIndexExpression","transformPropertyName","name"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;;2EAJS;0BACwB;uCACR;AAE/B,MAAMA,6BAA6B,CACtCC,SACAC,MACAC;IAEA,MAAM,CAACC,mBAAmB,GAAGC,IAAAA,uCAA6B,EAACJ,SAASC;IACpE,OAAOI,iBAAKC,yBAAyB,CACjCD,iBAAKE,0BAA0B,CAC3BL,WACAM,IAAAA,4CAAqB,EAACR,SAASC,KAAKQ,IAAI,IAE5CN;AAER"}
1
+ {"version":3,"sources":["../../../../../libs/tstl-plugin/src/transformClassDeclaration/transformMethodDeclaration.ts"],"sourcesContent":["import * as ts from 'typescript';\nimport { TransformationContext } from 'typescript-to-lua';\nimport * as tstl from 'typescript-to-lua';\nimport { transformFunctionToExpression } from 'typescript-to-lua/dist/transformation/visitors/function';\nimport { transformPropertyName } from './transformPropertyName';\n\nexport const transformMethodDeclaration = (\n context: TransformationContext,\n node: ts.MethodDeclaration,\n className: tstl.Identifier,\n): tstl.Statement | undefined => {\n if (\n node.modifiers?.some(\n modifier => modifier.kind === ts.SyntaxKind.AbstractKeyword,\n )\n ) {\n return undefined;\n }\n\n const [functionExpression] = transformFunctionToExpression(context, node);\n return tstl.createAssignmentStatement(\n tstl.createTableIndexExpression(\n className,\n transformPropertyName(context, node.name),\n ),\n functionExpression,\n );\n};\n"],"names":["transformMethodDeclaration","context","node","className","modifiers","some","modifier","kind","ts","SyntaxKind","AbstractKeyword","undefined","functionExpression","transformFunctionToExpression","tstl","createAssignmentStatement","createTableIndexExpression","transformPropertyName","name"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;;sEANO;2EAEE;0BACwB;uCACR;AAE/B,MAAMA,6BAA6B,CACtCC,SACAC,MACAC;QAGID;IADJ,KACIA,kBAAAA,KAAKE,SAAS,qBAAdF,gBAAgBG,IAAI,CAChBC,CAAAA,WAAYA,SAASC,IAAI,KAAKC,YAAGC,UAAU,CAACC,eAAe,GAEjE;QACE,OAAOC;IACX;IAEA,MAAM,CAACC,mBAAmB,GAAGC,IAAAA,uCAA6B,EAACZ,SAASC;IACpE,OAAOY,iBAAKC,yBAAyB,CACjCD,iBAAKE,0BAA0B,CAC3Bb,WACAc,IAAAA,4CAAqB,EAAChB,SAASC,KAAKgB,IAAI,IAE5CN;AAER"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crankscript",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "bin": {
5
5
  "crankscript": "./src/index.js"
6
6
  },
@@ -0,0 +1,4 @@
1
+ let A = class A {
2
+ };
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../libs/cli/src/commands/TranspileCommand/fn/_tests/test-abstract/src/index.ts"],"sourcesContent":["abstract class A {\n abstract a(): void;\n}\n"],"names":["A"],"rangeMappings":";","mappings":"AAAA,IAAA,AAAeA,IAAf,MAAeA;AAEf"}