@astrojs/ts-plugin 1.0.0 → 1.0.2
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +6 -0
- package/dist/astro2tsx.js +3 -3
- package/package.json +4 -5
- package/src/astro2tsx.ts +1 -1
- package/dist/workers/TSXService.js +0 -39
- package/dist/workers/TSXWorker.js +0 -9
- package/src/workers/TSXService.ts +0 -11
- package/src/workers/TSXWorker.ts +0 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@astrojs/ts-plugin:build: cache hit, replaying output
|
|
1
|
+
@astrojs/ts-plugin:build: cache hit, replaying output fc8623dff5f41743
|
|
2
2
|
@astrojs/ts-plugin:build:
|
|
3
|
-
@astrojs/ts-plugin:build: > @astrojs/ts-plugin@1.0.
|
|
3
|
+
@astrojs/ts-plugin:build: > @astrojs/ts-plugin@1.0.2 build /home/runner/work/language-tools/language-tools/packages/ts-plugin
|
|
4
4
|
@astrojs/ts-plugin:build: > astro-scripts build "src/**/*.ts"
|
|
5
5
|
@astrojs/ts-plugin:build:
|
package/CHANGELOG.md
CHANGED
package/dist/astro2tsx.js
CHANGED
|
@@ -21,13 +21,13 @@ __export(astro2tsx_exports, {
|
|
|
21
21
|
astro2tsx: () => astro2tsx
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(astro2tsx_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_sync = require("@astrojs/compiler/sync");
|
|
25
25
|
function astro2tsx(content, fileName) {
|
|
26
|
-
const tsx = (0,
|
|
26
|
+
const tsx = (0, import_sync.convertToTSX)(content, { filename: fileName });
|
|
27
27
|
return tsx;
|
|
28
28
|
}
|
|
29
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
30
|
0 && (module.exports = {
|
|
31
31
|
astro2tsx
|
|
32
32
|
});
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2FzdHJvMnRzeC50cyJdLAogICJtYXBwaW5ncyI6ICI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxrQkFBNkI7QUFHdEIsU0FBUyxVQUFVLFNBQWlCLFVBQTZCO0FBQ3ZFLFFBQU0sVUFBTSwwQkFBYSxTQUFTLEVBQUUsVUFBVSxTQUFTLENBQUM7QUFFeEQsU0FBTztBQUNSOyIsCiAgIm5hbWVzIjogW10KfQo=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/ts-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A TypeScript Plugin providing Astro intellisense",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
"author": "withastro",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@astrojs/compiler": "^1.
|
|
17
|
-
"@jridgewell/trace-mapping": "^0.3.15"
|
|
18
|
-
"synckit": "^0.8.4"
|
|
16
|
+
"@astrojs/compiler": "^1.4.1",
|
|
17
|
+
"@jridgewell/trace-mapping": "^0.3.15"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"@types/chai": "^4.3.0",
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
"chai": "^4.3.6",
|
|
28
27
|
"glob": "^8.0.3",
|
|
29
28
|
"mocha": "^9.2.2",
|
|
30
|
-
"typescript": "~
|
|
29
|
+
"typescript": "~5.0.2"
|
|
31
30
|
},
|
|
32
31
|
"repository": {
|
|
33
32
|
"type": "git",
|
package/src/astro2tsx.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { convertToTSX } from '@astrojs/compiler/sync';
|
|
1
2
|
import type { TSXResult } from '@astrojs/compiler/types';
|
|
2
|
-
import { convertToTSX } from './workers/TSXService';
|
|
3
3
|
|
|
4
4
|
export function astro2tsx(content: string, fileName: string): TSXResult {
|
|
5
5
|
const tsx = convertToTSX(content, { filename: fileName });
|
|
@@ -1,39 +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
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var TSXService_exports = {};
|
|
26
|
-
__export(TSXService_exports, {
|
|
27
|
-
convertToTSX: () => convertToTSX
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(TSXService_exports);
|
|
30
|
-
var import_synckit = require("synckit");
|
|
31
|
-
const convertToTSXSync = (0, import_synckit.createSyncFn)(require.resolve("./TSXWorker"));
|
|
32
|
-
function convertToTSX(source, options) {
|
|
33
|
-
return convertToTSXSync(source, options);
|
|
34
|
-
}
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
convertToTSX
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL3dvcmtlcnMvVFNYU2VydmljZS50cyJdLAogICJtYXBwaW5ncyI6ICI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQSxxQkFBNkI7QUFFN0IsTUFBTSx1QkFBbUIsNkJBQTZCLDhCQUFjO0FBSzdELFNBQVMsYUFBYSxRQUFnQixTQUEwQztBQUN0RixTQUFPLGlCQUFpQixRQUFRLE9BQU87QUFDeEM7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var import_synckit = require("synckit");
|
|
3
|
-
const dynamicImport = new Function("m", "return import(m)");
|
|
4
|
-
(0, import_synckit.runAsWorker)(async (source, options) => {
|
|
5
|
-
const { convertToTSX } = await dynamicImport("@astrojs/compiler");
|
|
6
|
-
const result = convertToTSX(source, options);
|
|
7
|
-
return result;
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL3dvcmtlcnMvVFNYV29ya2VyLnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQUFBLHFCQUE0QjtBQUU1QixNQUFNLGdCQUFnQixJQUFJLFNBQVMsS0FBSyxrQkFBa0I7QUFBQSxJQUMxRCw0QkFBWSxPQUFPLFFBQWdCLFlBQW9DO0FBQ3RFLFFBQU0sRUFBRSxhQUFhLElBQUksTUFBTSxjQUFjLG1CQUFtQjtBQUNoRSxRQUFNLFNBQWMsYUFBYSxRQUFRLE9BQU87QUFDaEQsU0FBTztBQUNSLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TSXResult } from '@astrojs/compiler/types';
|
|
2
|
-
import { createSyncFn } from 'synckit';
|
|
3
|
-
|
|
4
|
-
const convertToTSXSync = createSyncFn(require.resolve('./TSXWorker'));
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Parse code by `@astrojs/compiler`
|
|
8
|
-
*/
|
|
9
|
-
export function convertToTSX(source: string, options: { filename: string }): TSXResult {
|
|
10
|
-
return convertToTSXSync(source, options);
|
|
11
|
-
}
|
package/src/workers/TSXWorker.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { runAsWorker } from 'synckit';
|
|
2
|
-
|
|
3
|
-
const dynamicImport = new Function('m', 'return import(m)');
|
|
4
|
-
runAsWorker(async (source: string, options: { sourcefile: string }) => {
|
|
5
|
-
const { convertToTSX } = await dynamicImport('@astrojs/compiler');
|
|
6
|
-
const result: any = convertToTSX(source, options);
|
|
7
|
-
return result;
|
|
8
|
-
});
|