diff --git a/build.js b/build.ts similarity index 87% rename from build.js rename to build.ts index 2d6fbe7..3b66b82 100644 --- a/build.js +++ b/build.ts @@ -1,22 +1,22 @@ const fs = require("fs").promises; -const removeCommon = (text) => { +const removeCommon = (text: string) => { const regex = /:root[\s\S]*?@-webkit-keyframes/; return text.replace(regex, "@-webkit-keyframes"); }; -const removeWebkitKeyframes = (text) => { +const removeWebkitKeyframes = (text: string) => { const regex = /@-webkit-keyframes\s+[\w-]+\s*\{[^{}]*?(?:\{[^{}]*?\}[^{}]*?)*\}/g; return text.replace(regex, ""); }; -const removeCSSClass = (text) => { +const removeCSSClass = (text: string) => { const regex = /\.[\w-]+(?:\.[\w-]+)*\s*\{[^{}]*?(?:\{[^{}]*?\}[^{}]*?)*\}/g; return text.replace(regex, ""); }; -const convertCSSKeyframesToJS = (text) => { +const convertCSSKeyframesToJS = (text: string) => { const regex = /@keyframes\s+(\w+)\s*\{([^{}]*?(?:\{[^{}]*?\}[^{}]*?)*)\}/g; let result; diff --git a/package.json b/package.json index 5f25ba8..cf2c506 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "styled-components-animatecss", "title": "Styled Components Animatecss", "description": "Extract and convert keyframes from animate.css into a JavaScript module that can be imported and used with styled-components.", - "version": "1.0.2", + "version": "1.0.3", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": { @@ -31,7 +31,7 @@ "styled-components": "*" }, "scripts": { - "build": "node build.js && swc index.ts -d dist && tsc", + "build": "tsc ./build.ts && node build.js && swc index.ts -d dist && tsc", "prepublishOnly": "yarn build" } }