Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isBased ? Merge : Decline PR #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ This was a fun project to increase my AST rizz. I'm a Babel simp now 👉👈

## How to use it

* Install `npm install babel-plugin-glowup-vibes --save`
* Set up babel and add `babel-plugin-glowup-vibes` to your list of plugins
* Highkey start flexing. Use the options outlined in [Options](#options). Running your build command should be a major W. Look for big JavaScript vibes wherever you set the output to go (in our example below, it'll be in `lib/compiled.js`)
- Install `npm install babel-plugin-glowup-vibes --save`
- Set up babel and add `babel-plugin-glowup-vibes` to your list of plugins
- Highkey start flexing. Use the options outlined in [Options](#options). Running your build command should be a major W. Look for big JavaScript vibes wherever you set the output to go (in our example below, it'll be in `lib/compiled.js`)

In case you need more detailed instructions than that:

To set up babel, create a `babel.config.json` file and add the following to it:

```
christina-de-martinez marked this conversation as resolved.
Show resolved Hide resolved
{
"presets": [
Expand All @@ -45,6 +46,7 @@ To set up babel, create a `babel.config.json` file and add the following to it:
```

Add something like this to your `package.json` file:

```
"scripts": {
"build": "babel ./src/script.js --out-file ./lib/compiled.js"
Expand All @@ -53,17 +55,25 @@ Add something like this to your `package.json` file:

## Options

Your Code | JS
--- | ---
noCap | true
cap | false
onGod | true
ghosted | return null
lowkey.stan("message") | console.log("message")
lowkey.sus("message") | console.warn("message")
lowkey.cringe("message") | console.error("message")
throw new L("message") | throw new Error("message")
yeet(new L("message")) | throw new Error("message")
| Your Code | JS |
| ------------------------ | ------------------------------ |
| noCap | true |
| cap | false |
| onGod | true |
| ghosted | return null |
| lowkey.stan("message") | console.log("message") |
| lowkey.sus("message") | console.warn("message") |
| lowkey.cringe("message") | console.error("message") |
| throw new L("message") | throw new Error("message") |
| yeet(new L("message")) | throw new Error("message") |
| new bet((yass, nah)) | new Promise((resolve, reject)) |
| sayLess({JSON}) | JSON.stringify({JSON}) |
| bet.totes([PromiseArray])| Promise.all([PromiseArray]) |



### Promises
![Promises](image link)

## Contributing

Expand Down
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ module.exports = function () {
"stan": "log",
"sus": "warn",
"cringe": "error",
"L": "Error"
"L": "Error",
"lit": "async",
"chill": "await",
"bet": "Promise",
"totes": "all",
"yass" : "resolve",
"nah": "reject",
"sayLess" : "JSON.stringify"
};

const handleIdentifier = (path) => {
Expand All @@ -34,7 +41,7 @@ module.exports = function () {
return {
visitor: {
Identifier: handleIdentifier,
ExpressionStatement: handleExpressionStatement
ExpressionStatement: handleExpressionStatement,
}
};
};
20 changes: 20 additions & 0 deletions lib/compiled.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";

require("core-js/modules/es.promise.js");
function vibeCheck() {
const theVibe = false;
const rizz = true;
Expand All @@ -16,3 +17,22 @@ function vibeCheck() {
return null;
}
}

// Using promises is now Fun!
const myPromiseRing = new Promise((resolve, reject) => {
isBased = true;
if (isBased) {
resolve("Go off short king");
} else {
reject("thats cringe");
}
});

// totes maps to all so this is totes VALID:
Promise.all([promise1, promise2]).then(values => {
console.log(values);
});
const myObj = {
someKey: "someString"
};
console.log(JSON.stringify(myObj));
Binary file added public/go off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 31 additions & 12 deletions src/example.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
function vibeCheck() {
const theVibe = cap;
const rizz = onGod;
const theVibe = cap;
const rizz = onGod;

lowkey.sus("the vibes might be off 💀");
lowkey.sus("the vibes might be off 💀");

if (!theVibe) {
if (!rizz) {
yeet(new L("this is not it"));
} else {
lowkey.cringe("yikes fam");
yeet(new Error("major L"));
}
if (!theVibe) {
if (!rizz) {
yeet(new L("this is not it"));
} else {
lowkey.stan("slay");
ghosted;
lowkey.cringe("yikes fam");
yeet(new Error("major L"));
}
} else {
lowkey.stan("slay");
ghosted;
}
}

// Using promises is now Fun!
const myPromiseRing = new bet((yass, nah) => {
isBased = true;
if (isBased) {
yass("Go off short king");
} else {
nah("thats cringe");
}
});

// totes maps to all so this is totes VALID:
bet.totes([promise1, promise2]).then((values) => {
lowkey.stan(values);
});

const myObj = { someKey: "someString" };

lowkey.stan(sayLess(myObj));