Socket
Socket
Sign inDemoInstall

ng-tailwindcss-jit

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-tailwindcss-jit - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

logging.js

63

index.js

@@ -5,4 +5,7 @@ #! /usr/bin/env node

const packageJson = require("./package.json");
const { execSync } = require("child_process");
const ora = require("ora");
const {
isRoot,
isAlreadyConfigured,
getPackageJson,

@@ -13,11 +16,16 @@ updatePackageJson,

} = require("./utils");
const { execSync } = require("child_process");
const { logSuccess, logError, logWarning } = require("./logging");
console.log(`ng-tailwindcss-jit v${packageJson.version}`);
console.log(`${packageJson.name} v${packageJson.version}`);
if (!isRoot()) {
console.warn("Not running at project root");
logWarning("Not running at project root");
process.exit();
}
if (isAlreadyConfigured()) {
logWarning(`${packageJson.name} is already configured`);
process.exit();
}
const pkg = getPackageJson();

@@ -29,16 +37,16 @@ const installedPackages = [

// if (!installedPackages.includes("@angular/core")) {
// console.warn("Not an angular project");
// process.exit();
// }
if (!installedPackages.includes("@angular/core")) {
logWarning("Not an angular project");
process.exit();
}
// if (!installedPackages.includes("tailwindcss")) {
// console.warn("Tailwind is not installed");
// process.exit();
// }
if (!installedPackages.includes("tailwindcss")) {
logWarning("Tailwind is not installed");
process.exit();
}
// if (!pkg.scripts.start) {
// console.warn("Start command not found");
// process.exit();
// }
if (!pkg.scripts.start) {
logWarning("Start command not found");
process.exit();
}

@@ -54,11 +62,22 @@ pkg.scripts.start = `TAILWIND_MODE='watch' ${pkg.scripts.start}`;

console.log("Installing @tailwindcss/jit");
if (!installedPackages.includes("@tailwindcss/jit")) {
const spinner = ora({
text: "Installing @tailwindcss/jit\n",
interval: 10,
}).start();
spinner.color = "green";
try {
execSync("node ./scripts/ng-tailwindcss-jit.js && npm i @tailwindcss/jit --save-dev");
} catch {
console.log("Installation of @tailwindcss/jit failed");
process.exit();
try {
execSync(
"node ./scripts/ng-tailwindcss-jit.js && npm i @tailwindcss/jit --save-dev"
);
} catch {
logError("Installation of @tailwindcss/jit failed");
process.exit();
}
spinner.stop();
} else {
execSync("node ./scripts/ng-tailwindcss-jit.js");
}
console.log("Configured successfully");
logSuccess("Configured successfully");
{
"name": "ng-tailwindcss-jit",
"version": "0.0.1",
"version": "0.0.2",
"description": "Configures your angular project to use jit compiler for tailwindcss",

@@ -11,6 +11,10 @@ "bin": {

},
"repository": {
"type": "git",
"url": "https://github.com/apvarun/ng-tailwindcss-jit.git"
},
"bugs": "https://github.com/apvarun/ng-tailwindcss-jit/issues",
"keywords": [
"tailwindcss",
"tailwindcss",
"jit",
"tailwindcss jit",
"tailwind",

@@ -23,4 +27,6 @@ "jit",

"dependencies": {
"fs-extra": "^9.1.0"
"chalk": "^4.1.0",
"fs-extra": "^9.1.0",
"ora": "^5.4.0"
}
}

@@ -5,4 +5,6 @@ # ng-tailwindcss-jit

## Instructions
![](./ng-tailwindcss-jit.png)
## Usage
```

@@ -14,7 +16,12 @@ npx ng-tailwindcss-jit

- Project must have tailwindcss installed
- Should be running the default angular builder
- Project must have Twilwind CSS installed
- Minimum angular version 11.2 (version from which angular supports Tailwind CSS out-of-the-box)
- Should be using the default angular builder
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[MIT](./LICENSE)
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details

@@ -15,2 +15,8 @@ const path = require("path");

function isAlreadyConfigured() {
const pkgPath = path.resolve("./scripts/ng-tailwindcss-jit.js");
return existsSync(pkgPath);
}
function getPackageJson() {

@@ -57,2 +63,3 @@ const pkgPath = path.resolve("./package.json");

isRoot,
isAlreadyConfigured,
getPackageJson,

@@ -59,0 +66,0 @@ updatePackageJson,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc