@jsrepo/transform-javascript 0.0.1-beta.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 jsrepo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @jsrepo/transform-prettier
2
+
3
+ [![npm version](https://flat.badgen.net/npm/v/@jsrepo/transform-javascript?color=pink)](https://npmjs.com/package/@jsrepo/transform-javascript)
4
+ [![npm downloads](https://flat.badgen.net/npm/dm/@jsrepo/transform-javascript?color=pink)](https://npmjs.com/package/@jsrepo/transform-javascript)
5
+
6
+ A transform plugin for transforming TypeScript registry items into JavaScript before adding them to your project.
7
+
8
+ > [!NOTE]
9
+ > You might consider using this alongside a formatting plugin like [@jsrepo/transform-prettier](https://npmjs.com/package/@jsrepo/transform-prettier) or [@jsrepo/transform-biome](https://npmjs.com/package/@jsrepo/transform-biome) to ensure the code is formatted correctly.
10
+
11
+ ## Usage
12
+
13
+ Run the following command to install and add the transform to your config:
14
+
15
+ ```sh
16
+ jsrepo config transform javascript
17
+ # or initialize any jsrepo project with the --js flag
18
+ jsrepo init @ieedan/std --js
19
+ ```
20
+
21
+ ### Manual Configuration
22
+
23
+ Install the transform plugin:
24
+
25
+ ```sh
26
+ pnpm install @jsrepo/transform-javascript -D
27
+ ```
28
+
29
+ Add the transform to your config:
30
+
31
+ ```ts
32
+ import { defineConfig } from "jsrepo";
33
+ import javascript from "@jsrepo/transform-javascript";
34
+
35
+ export default defineConfig({
36
+ transforms: [javascript()],
37
+ });
38
+ ```
@@ -0,0 +1,34 @@
1
+ import { Transform } from "jsrepo";
2
+
3
+ //#region src/index.d.ts
4
+ type FileExtension = {
5
+ /** The TypeScript extension. */
6
+ ts: string;
7
+ /** The JavaScript extension. */
8
+ js?: string;
9
+ };
10
+ type Options = {
11
+ supportedExtensions?: FileExtension[];
12
+ };
13
+ declare const SUPPORTED_EXTENSIONS: FileExtension[];
14
+ /**
15
+ * A transform plugin for jsrepo to strip types from TypeScript code. It also renames TypeScript files to JavaScript files.
16
+ * @example
17
+ * ```ts
18
+ * import { defineConfig } from "jsrepo";
19
+ * import stripTypes from "@jsrepo/transform-javascript";
20
+ *
21
+ * export default defineConfig({
22
+ * // ...
23
+ * transforms: [stripTypes()],
24
+ * });
25
+ * ```
26
+ *
27
+ * @param options - The options for the transform plugin.
28
+ */
29
+ declare function export_default({
30
+ supportedExtensions
31
+ }?: Options): Transform;
32
+ //#endregion
33
+ export { FileExtension, Options, SUPPORTED_EXTENSIONS, export_default as default };
34
+ //# sourceMappingURL=index.d.ts.map