├── .github
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── config.yml
│ ├── feature_request.md
│ └── support_request.md
├── MAINTAINING.md
├── PULL_REQUEST_TEMPLATE.md
└── SUPPORT.md
├── LICENSE
├── README.md
├── _config.yml
├── current-version.json
├── postcss.alfredworkflow
├── screenshots
├── alfred.png
└── postcss.png
└── src
├── data.json
├── icon.png
├── postcss.php
├── update.json
└── workflows.php
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @iamnewton
2 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | Open source software is thriving. Large corporations are building on software that rests on open collaboration, enjoying the many benefits of significant community adoption. Free and open source software is amazing for its ability to bring together many people from all over the world, and join their efforts and skills by their interests.
4 |
5 | That said, and because we come from so many different backgrounds, it’s worth taking a moment to reflect on how we work together. The manner in which you conduct yourself while working with others can sometimes impact whether your work is merged, whether someone works on your issue, or in some cases, why you might be blocked from participating in the repository in the future. This post was written to guide people as best as possible on how to keep these communications running smoothly. Here’s a bullet point list of etiquette in open source to help you have a more enjoyable time in the community and contribute to making it a better place.
6 |
7 | ## Our Pledge
8 |
9 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
10 |
11 | ## Our Standards
12 |
13 | Examples of behavior that contributes to creating a positive environment include:
14 |
15 | * Using welcoming and inclusive language
16 | * Being respectful of differing viewpoints and experiences
17 | * Gracefully accepting constructive criticism
18 | * Focusing on what is best for the community
19 | * Showing empathy towards other community members
20 |
21 | Examples of unacceptable behavior by participants include:
22 |
23 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
24 | * Trolling, insulting/derogatory comments, and personal or political attacks
25 | * Public or private harassment
26 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
27 | * Other conduct which could reasonably be considered inappropriate in a professional setting
28 |
29 | ## Our Responsibilities
30 |
31 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
32 |
33 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
34 |
35 | ## Scope
36 |
37 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
38 |
39 | ## Enforcement
40 |
41 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting us . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
42 |
43 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
44 |
45 | ## Attribution
46 |
47 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org/), version 1.4, available at . For more information read the [TODO groups site](http://todogroup.org/opencodeofconduct/).
48 |
49 | ## For the Maintainer
50 |
51 | * Use labels like help wanted or good first issue to guide people to issues they can work on if they are new to the project.
52 | * When running benchmarks, show the authors of the framework/library/etc the code you’re going to run to benchmark on before running it. Allow them to PR (it’s ok to give a deadline). That way when your benchmark is run you know they have your approval and it’s as fair as possible. This also fixes issues like benchmarking dev instead of prod or some user errors.
53 | * When you ask someone for help or label an issue help wanted and someone PRs, please write a comment explaining why you are closing it if you decide not to merge. It’s disrespectful of their time otherwise, as they were following your call to action. I would even go so far as to say it would be nice to comment on any PR that you close OR merge, to explain why or say thank you, respectively.
54 | * Don’t close a PR from an active contributor and reimplement the same thing yourself. Just… don’t do this.
55 | * If a fight breaks out on an issue that gets personal, shut it down to core maintainers as soon as possible. Lock the issue and ensure to enforce the code of conduct if necessary.
56 |
57 | ## For the User
58 |
59 | * Saying thank you for the project before making an inquiry about a new feature or filing a bug is usually appreciated.
60 | * When opening an issue, create a small, isolated, simple, reproduction of the issue using an online code editor (like codepen or codesandbox) if possible and a GitHub repository if not. The process may help you discover the underlying issue (or realize that it’s not an issue with the project). It will also make it easier for maintainers to help you resolve the problem.
61 | * When opening an issue, please suggest a solution to the problem. Take a few minutes to do a little digging. This [blog post](https://blog.kentcdodds.com/what-open-source-project-should-i-contribute-to-7d50ecfe1cb4) has a few suggestions for how to dive into the source code a little. If you’re not sure, explain you’re unsure what to do.
62 | * When opening an issue, if you’re unable to resolve it yourself, please explain that. The expectation is that you resolve the issues you bring up. If someone else does it, that’s a gift they’re giving to you (so you should express the appropriate gratitude in that case).
63 | * Don’t file issues that say things like “is this even maintained anymore?” A comment like this is insulting to the time they have put in, it reads as though the project is not valid anymore just because they needed a break, or were working on something else, or their parent died or they had a kid or any other myriad human reasons for not being at the beck and call of code. It’s totally ok to ask if there’s a roadmap for the future, or to decide based on past commits that it’s not maintained enough for your liking. It’s not ok to be passive aggressive to someone who created something for you for free.
64 | * If someone respectfully declines a PR because, though valid code, it’s not the direction they’d like to take the project, don’t keep commenting on the pull request.
65 | * When you want to submit a really large pull request to a project you’re not a core contributor on, it’s a good idea to ask via an issue if the direction you’d like to go makes sense. This also means you’re more likely to get the pull request merged because you have given them a heads up and communicated the plan. Better yet, break it into smaller pull requests so that it’s not too much to grok at one time.
66 | * Avoid entitlement. The maintainers of the project don’t owe you anything. When you start using the project, it becomes your responsibility to help maintain it. If you don’t like the way the project is being maintained, be respectful when you provide suggestions and offer help to improve the situation.
67 | * Before doing anything on a project, familiarize yourself with the contributor guidelines.
68 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 |
3 | :bangbang: This project has a [Code of Conduct](./CODE_OF_CONDUCT.md). By interacting with this repository, organization, and/or community you agree to abide by its terms.
4 |
5 | Third-party patches are essential for keeping open-source software great. In the spirit of keeping it as simple as possible to contribute changes that get things working in your environment, here are a few guidelines that contributors should follow. As [Nicholas Gallagher](http://github.com/necolas/normalize.css/blob/master/CONTRIBUTING.md) put it in his contributing guidelines:
6 |
7 | > Following these guidelines helps to communicate that you respect the time of the developers managing and developing […]. In return, they should reciprocate that respect in addressing your issue or assessing your patches and features.
8 |
9 | ## How do I…
10 |
11 | 1. [Get Started](#get-started)
12 | 2. [Create an Issue](#create-a-good-issue)
13 | 3. [Create a Feature Request](#creating-a-good-feature-request)
14 | 4. [Contribute Documentation](#contributing-to-documentation)
15 | 5. [Create a Pull Request](#create-a-pull-request)
16 | 6. [Additional Resources](#additional-resources)
17 |
18 | ## Get Started
19 |
20 | 1. Make sure you have a GitHub account.
21 | 2. Please ask the [CODEOWNERS](./CODEOWNERS) before making significant changes. I'd hate for you to put in a lot of work for something that doesn't align with the vision of this project.
22 | 3. Search on Github within the repo for the issue or Pull Request. This means you have to read through the issue(s) in order to determine if your particular issue has already been created. Don't forget to look through the closed ones as well.
23 | 4. If the issue has not been fixed then try to reproduce the issue in a fresh clone of the repository off the master branch. Read below on [how to set up your environment](#create-a-pull-request).
24 | 5. Create a [reduced test case](http://css-tricks.com/reduced-test-cases/) as outlined by Chris Coyier of [CSS Tricks](http://css-tricks.com/). Link to the [Code Pen](http://codepen.io), [JS Bin](http://jsbin.com), or whatever you use, as long as its publicly accessible.
25 | 6. Read our [branching strategy](#branching-strategy), [commit conventions](#commit-conventions) below for tips on how to contribute. We won't accept any pull request that doesn't adhere, so be forewarned.
26 |
27 | If this seems like a lot or you aren't able to do all this setup, you might also be able to [edit the files directly](https://help.github.com/articles/editing-files-in-another-user-s-repository/) without having to do any of this setup. Yes, [even code](#create-a-pull-request).
28 |
29 | ## Create a Good Issue
30 |
31 | The easiest way to contribute is to help improve the library by finding bugs within the system. Bugs are small, testable and demonstrate problems caused by the code. A good report will be able to easily outline the problem and provide steps to recreate. If you're going to submit a bug, please verify you've done everything on the list above. Don't be afraid to go into detail; no one ever said too much detail was a problem, and if they did, it wasn't us.
32 |
33 | ### Filling Out a Ticket
34 |
35 | Now its time to submit a ticket. Bug reports should be thorough and not leave anyone wondering or questioning what you were thinking. No one should have to ask you anything or require further clarification. When creating a ticket, use the [Bug Report template](/issues/new?template=bug_report.md) to populate a lot of the information required. Below is a brief description of the parts of a bug report:
36 |
37 | * **title** (required): should be concise and descriptive. Anyone should be able to know what you're issue is at a glance and doesn't need the complete issue in it; try to keep it under 80 characters.
38 | * **description**: create a short summary of what is happening or what you're seeing.
39 | * **to reproduce** (required): the steps you followed to find this bug. This will make life so much easier to help fix the issue. Don't make any assumptions that someone will be on the same page or do the same thing as you. Nice and direct steps of what happened, what you clicked on can ease the time for us to debug.
40 | * **expected behavior** (required): let us know what you were expecting to happen. This may or may not align with the project, so be very detailed with this part; the more detail the better.
41 | * **screenshots**: a picture is worth a thousand words.
42 | * **device details** (required): for most of the information you can look at ; for others check out below for how to find them.
43 | * **OS & version**: Always include the OS(es) and version(s) where you found the issue. If, for example its Mavericks, you can put OSX 10.9.1.
44 | * **Browser(s) Version(s)**: Which browsers have you tested this in? What version are you running?
45 | * **Node Version(s)**: Not always required, but if there is something erring in the console, this is quite helpful.
46 | * **NPM Version(s)**: Not always required, but if there is something erring in the console, this is quite helpful.
47 | * **Browser Resolution**: Include resolutions as more of a range rather than an absolute. For example, < 768px or >= 768px && <= 1024th
48 | * **Library Version**: Required; please include which version of this library you're using
49 |
50 | ### Example Ticket
51 |
52 | Follow the example below and you'll be on the right path. Let's assume that a you're trying build a new page on your application and the icons aren't showing up:
53 |
54 | ```markdown
55 | Title: Icons are not showing up
56 |
57 | **Describe the bug**
58 |
59 | Developing my application and when it loads up
60 | the browser, I don't see any of the SVG icons loading up.
61 |
62 | **To Reproduce**
63 |
64 | 1. Open http://example.com/new-app
65 | 2. There is a blue button in the right side of the toolbar that says "Edit"
66 | 3. Notice there should be a pencil icon, and there is nothing.
67 |
68 | **Expected Behavior**
69 |
70 | When loading any page that contains an icon, I expect the icon to load alongside
71 | the other assets on the page, ie text, components, modules, etc
72 |
73 | **OS**: OSX 10.8.3
74 | **Browser(s) Version(s)**: All browsers, but founded initially in Chrome 38.0.2125.111
75 | **Node Version(s)**: v.7.8.0
76 | **NPM Version(s)**: 4.2.0
77 | **Browser Resolution(s)**: initially found at 1920 x 2063, but appears >768
78 | **Library Version**: 2.15.5
79 |
80 | **Additional context**
81 |
82 | - **Results**: Passed
83 | - **Line(s) of Code**: n/a
84 | - **Message**: n/a
85 | - **Console Errors**: 404 error on "svg/symbol-defs.svg"
86 | ```
87 |
88 | ### Testing
89 |
90 | It's helpful, but not required to run the test suite locally. If you have the time and energy it can increase the efficiency and decrease the effort required for us to fix things.
91 |
92 | There are 2 sides to test, CSS and JS. For the CSS, you can can run `npm run lint:css` to check for syntax errors that may cause issues, or you can run `npm run test:css` to test the mixins and/or CSS. With regard to JS, the same applies; run `npm run lint:js` to check syntax errors and `npm run test:js` to test the JS components. You can also run linting and testing on both sides by running `npm run lint` and `npm test` respectively.
93 |
94 | 1. **Results**: If there is a fail in a particular test, include the name of the test, otherwise list as "Passed".
95 | 2. **Line(s) of Code**: Definitely not a requirement, but doesn't hurt if you've already pin pointed the issue.
96 | 3. **Message**: When the tests fail, a stack trace or message is typically output, so copy/paste that into the issue.
97 |
98 | Now that you've created an issue, maybe you want to try your hand at fixing the issue? Set up your environment.
99 |
100 | ## Create a Good Feature Request
101 |
102 | Another way to contribute is to help improve the library by suggesting new ideas within the system. While we may not accept every feature, it doesn't hurt to suggest improvements, but please stop and think about the intent of the project. Maybe its better in another independent project, or maybe not; there is no harm in asking, or filling out a feature request. Before you do submit, please look at my [road map](/roadmap.md) to see if I've already thought of your feature. And remember, if I don't like the idea, doesn't mean you can't fork the project.
103 |
104 | ### Filling Out a Feature Request
105 |
106 | Now its time to submit a ticket. Feature requests should be thorough and not leave anyone wondering or questioning what you were thinking. No one should have to ask you anything or require further clarification. When creating a ticket, use the [Feature Request template](/issues/new?template=feature_request.md) to populate a lot of the information required. Below is a brief description of the parts of a feature request:
107 |
108 | * **Is your feature request related to a problem?**: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
109 | * **Describe the solution you'd like**: A clear and concise description of what you want to happen. Acceptance criteria are important for us to ensure a proper and complete feature.
110 | * **Describe alternatives you've considered**: A clear and concise description of any alternative solutions or features you've considered.
111 | * **Additional context**: Add any other context or screenshots about the feature request here.
112 |
113 | ### Example Feature Request
114 |
115 | Follow the example below and you'll be on the right path.
116 |
117 | ```markdown
118 | Title: Progress bar component
119 |
120 | **Is your feature request related to a problem? Please describe.**
121 | Not related to a problem. I would like to see an indicator of impressions to ad requests
122 | so that I can visualize the loss.
123 |
124 | **Describe the solution you'd like**
125 | I think a progress bar where the total value shown is the full width of
126 | the contained area, and the part that is filled in is the impressions.
127 |
128 | **Describe alternatives you've considered**
129 | A funnel chart was considered but its too similar to Googles design and
130 | Legal fears repercussions.
131 |
132 | **Additional context**
133 | N/A
134 | ```
135 |
136 | ## Contributing to Documentation
137 |
138 | Documentation is a super important, critical part of this project. Docs are how we keep track of the what, how, and why of we're doing; it's how we stay on the same page about our policies. And it's how we tell others everything they need in order to be able to use this project -- or contribute to it. So thank you in advance.
139 |
140 | Contributions of any size are welcome! Feel free to file a PR even if you're just rewording a sentence to be more clear, or fixing a spelling mistake!
141 |
142 | To contribute:
143 |
144 | * [Set up the project](#get-started).
145 | * Edit or add any relevant documentation.
146 | * Make sure your changes are formatted correctly and consistently with the rest of the documentation.
147 | * Re-read what you wrote, and run a spellchecker on it to make sure you didn't miss anything. Check out [Grammerly](https://www.grammarly.com) for spelling and grammar mistakes as well as tone of writing.
148 | * In your commit message(s), begin the first line with `chore(docs): `. For example: `chore(docs): Adding a doc contrib section to CONTRIBUTING.md`.
149 | * Write clear, concise commit message(s) using the [convention described below](#commit-convention). Documentation commits should use `chore(docs): `.
150 | * Go to and open a new pull request with your changes and fill out the template with the appropriate information.
151 | * If your PR is connected to an open issue, add a line in your PR's description that says `Fixes: #123`, where `#123` is the number of the issue you're fixing.
152 |
153 | Once you've filed the PR:
154 |
155 | * One or more maintainers will use GitHub's review feature to review your PR.
156 | * If the maintainer asks for any changes, edit your changes, push, and ask for another review.
157 | * If the maintainer decides to pass on your PR, they will thank you for the contribution and explain why they won't be accepting the changes. That's ok! We still really appreciate you taking the time to do it, and we don't take that lightly.
158 | * If your PR gets accepted, it will be marked as such with the `next-release` label, and merged soon after. Your contribution will be distributed to the masses next time the maintainers [tag a release](./MAINTAINING.md#tag-a-release)
159 |
160 | ## Create a Pull Request
161 |
162 | If you're unfamiliar with the Github flow, please [read this guide](https://guides.github.com/introduction/flow/index.html) as an introduction. Make sure you reach out to someone on the team before you start any work to ensure that what you're doing is aligned with the teams' vision. Read Ilya Grigorik's great article [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/). The following passage sums up some great points:
163 |
164 | > Contributions are always welcome, but surprise patches are mostly just a burden. Yes, you are offering your help, but someone else will have to maintain your code over the long term - get their buy-in first, avoid surprises. Even worse, a localized change to address a specific problem will often miss the full implications to the project: other existing use cases, future roadmap plans, or overall architectural decisions. A good idea can be implemented inappropriately for the specific project; it can be invalidated by another effort that you may not even be aware of; the timing may be wrong, and a dozen other reasons can conspire against you.
165 |
166 | **IMPORTANT**: By submitting a patch, you agree to the same license as that used by the project.
167 |
168 | For those of you willing to help out, that's great!!! Here's a quick how-to with regarding to submitting your changes to Github. This requires no need for access, rights or privileges and can be done without any help from a team member.
169 |
170 | 1. Fork It by pressing the "Fork" button in the top right corner.
171 | 2. Clone your newly forked repo (`git clone https://github.com//`).
172 | 3. Change into the directory you cloned (`cd `)
173 | 4. Add your fork as a remote (`git remote add https://github.com//`) where `` is your actual Github username and `` is the repository with which you're looking to contribute.
174 | 5. Create your feature branch (`git checkout -b `); checkout the guide below for our [branching strategy](#branching-strategy)
175 | 6. Commit your changes (`git commit`), following the [format suggested below](#commit-conventions). Please don't use the shortcut flag `git commit -m ` as there is more detail required than what is allowed by only using that flag.
176 | 7. Push to the branch (`git push `)
177 | 8. Create a new Pull Request; make sure you fill in the Pull Request template.
178 | a. Most of the time the Reviewers sections provides suggestions and you should include them; in cases when it doesn't add the core team.
179 | b. Don't forget to [update the CODEOWNERS](#code-owners) file adding the directory and your name to the end of the list.
180 |
181 | **IMPORTANT**: Every patch and subsequent message should have a bug attached. If there is no ticket, no work should be done.
182 |
183 | ### Gotchas
184 |
185 | - Please avoid working directly on the `master` branch.
186 | - Make commits of logical units.
187 | - Check for unnecessary whitespace with `git diff --check` before committing.
188 | - Make sure your commit messages are in the [proper format](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), also listed below in our guides.
189 |
190 | ### Branching Strategy
191 |
192 | **ALL WORK REQUIRES A BRANCH. WE DO NOT PUSH DIRECTLY TO MASTER!**
193 |
194 | There are a lot of [various](http://nvie.com/posts/a-successful-git-branching-model/) [opinions](https://docs.microsoft.com/en-us/vsts/git/concepts/git-branching-guidance) on [branching](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow) [strategies](https://barro.github.io/2016/02/a-succesful-git-branching-model-considered-harmful/) and while all of them are great and have their place, they all tend to add a lot of overhead and maintenance with little value to the workflow. We prefer to use the simplified strategy known as [Github flow](https://guides.github.com/introduction/flow/). So when working with the library, there's no need to prefix it with `feature/` or `hotfix/` or anything like that; Github's PR-style workflow allows for quick and disposable branches. Create branches off `master` and use descriptive names such as `create-donut-chart`, `refactor-dropdown` so that users can easily see what's being worked on.
195 |
196 | #### Naming
197 |
198 | Branch names should short, concise and easy to understand the work that is being done. While not a necessity, setting up `` completion for git branches can speed up the discovery of branch names. The following tips are designed to speed up your workflow with the addition of tab completion.
199 |
200 | * **Use only lower case letters**. Lowercasing makes it quicker to type by providing fewer letters to get working. Avoid upper case letters as it requires a higher level of dexterity that can decrease the speed of workflow
201 | * **Use dashes instead of underscores**. The same is true as above, they're are easier to type and require less dexterity.
202 | * **Don't prefix the branch name with any particular pattern**. Unless you regularly clean up your local branches, it's likely to increase the number of characters and tabbing through in order to complete the branch name you seek
203 | * **Don't include the ticket number**. Adding it falls into the same faults as suggestion 2 above; it requires a lot more typing in order to tab complete through to the branch you may want
204 |
205 | When searching through a bunch of branches, `issue-123` doesn't provide any inherent value to the developer in hopes to find the feature they want to help out on; however seeing `modal-trigger-open` gives the developer some insight into what work is being done.
206 |
207 | #### Example Branches
208 |
209 | ```
210 | // good
211 | git checkout -b fix-bug-x
212 | git checkout -b new-component
213 |
214 | // bad
215 | git checkout -b JIRA_1234
216 | git checkout -b tests
217 | ```
218 |
219 | _The only exception, at the time of this writing, is for tagging and releasing_
220 |
221 | ### Commit Conventions
222 |
223 | Commits should be small, concise and logical units of code. The goal is not to overwhelm reviewers with superfluous changes; do not add any unrelated changes to a commit in case the change needs to be reverted or backed out. The entirety of your code should answer the question:
224 |
225 | **Which problem am I trying to solve today?**
226 |
227 | All changes should be connected and without 1 change your entire commit would fall apart. If you find that you can keep a commit out and your code still makes sense, runs successfully, and fixes an issue then you're likely in a good condition to commit some code and create a pull request. Contributors are required to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification on all commit messages. If you're ready, follow below to create a good commit message in the proper format.
228 |
229 | A few tips to consider:
230 |
231 | * Absolutely no working directly on the master branch!!!
232 | * Check for unnecessary whitespace with `git diff --check` before committing.
233 | * And be sure to run git commit and NOT `git commit -m ` so that you can fill out the body of the message
234 |
235 | #### Parts of a Commit
236 |
237 | A commit should consist of a required title, optional but recommended body and an optional but recommended footer. Below is the desired format with an example:
238 |
239 | ```
240 | ():
241 |
242 |
243 |
244 |
245 | ```
246 |
247 | #### Example
248 |
249 | ```
250 | fix(filter): patch Autocomplete output when query is empty
251 |
252 | Show default options when no Autocomplete search input value is present.
253 |
254 | Fixes #1234
255 | ```
256 |
257 | #### Breakdown of message parts
258 |
259 | ##### Title
260 |
261 | * The first line should be less than 50 characters (our git-hooks will warn about this) but no greater than 72.
262 | * The and should always be lowercase as shown in example.
263 | * is required
264 | * is optional
265 | * should be written in the imperative with present tense.
266 | * Should contain no full stop (.).
267 |
268 | ###### Allowed type values
269 |
270 | * feat (new feature for the user, not a new feature for build script)
271 | * fix (bug fix for the user, not a fix to a build script)
272 | * chore (updating tasks etc, changes to docs, linting warnings, adding tests; no production code change)
273 |
274 | ###### What is scope
275 |
276 | should indicate the feature, component, or part that is being fixed. It should be very short but obvious.
277 |
278 | The value can be omitted. The feature may not exist or be too complex to assign to a single component. If the is empty the parenthesis should not be added to the title.
279 |
280 | ##### Body
281 |
282 | * optional, thorough descriptions are helpful for understanding commits
283 | * wrap it to about 72 characters or so
284 | * uses the imperative, present tense: “change” not “changed” nor “changes”; this convention matches up with commit messages generated by commands like git merge and git revert
285 | * includes motivation for the change and contrasts with previous behavior
286 | * it's more important that you include why these changes were made then listing out what was done
287 | * must be separated by a blank line from title
288 | * in some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together.
289 | * further paragraphs come after blank lines.
290 | * bullet points are okay, too
291 | * typically a hyphen or asterisk is used for the bullet, followed by a single space, with blank lines in between, but conventions vary here
292 | * use a hanging indent
293 |
294 | ##### Footer
295 |
296 | * optional
297 | * can reference which task it covers
298 | * can cover breaking changes
299 | * must be separated by a blank line
300 |
301 | ### Code Owners
302 |
303 | #### What is it?
304 |
305 | Code Owners is a powerful way to define individuals or teams that are responsible for code in a repository. When updating any bug or feature, be sure to update this file to include yourself for potential future reviews.
306 |
307 | > Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. Code owners are not automatically requested to review draft pull requests.
308 | >
309 | > When someone with admin or owner permissions has enabled required reviews, they also can optionally require approval from a code owner before the author can merge a pull request in the repository.
310 |
311 | [Read more about on GitHub](https://help.github.com/en/articles/about-code-owners)
312 |
313 | #### What does it look like?
314 |
315 | All teams are required to add the file within the `.github/` directory on the root of the repository. The format is the same as `.gitignore` which is followed by one or more GitHub usernames or team names using the standard @username or @org/team-name format. You can also refer to a user by an email address that has been added to their GitHub account, for example user@example.com.
316 |
317 | ```
318 | # This is a comment.
319 | # Each line is a file pattern followed by one or more owners.
320 |
321 | # These owners will be the default owners for everything in
322 | # the repo. Unless a later match takes precedence.
323 | # Typically the owners team should be responsible for the
324 | # entire repository.
325 | * @org/team
326 |
327 | # Order is important; the last matching pattern takes the most
328 | # precedence. When someone opens a pull request that only
329 | # modifies JS files, only maintainers and not the global
330 | # owner(s) will be requested for a review.
331 | *.js @org/maintainers
332 |
333 | # You can even call out other teams for audits.
334 | # In this example, @org/design owns any file in an that ends in
335 | # .scss or .css anywhere in your repository. Typically
336 | # all CODEOWNERS should have their (S)CSS audited by the UX
337 | # design team.
338 | *.scss @org/design
339 | *.css @org/design
340 | ```
341 |
342 | #### Why do I need one?
343 |
344 | As you can see from the example above, it automates the need to ask developers to review code. Even further, we can use [GitHub's branch protection](https://help.github.com/en/articles/configuring-protected-branches) to ensure that code isn't pushed through if the code owner(s) aren't consulted. The other side effect is providing outside contributors the knowledge of knowing whom to ask when looking to fix or improve library code. One should always reach out to someone on the team before making significant changes. We'd hate for you to put in a lot of work for something that doesn't align with the vision of this project.
345 |
346 | ## Additional Resources
347 |
348 | - [Reduced Test Cases](http://css-tricks.com/reduced-test-cases/)
349 | - [General GitHub documentation](http://help.github.com/)
350 | - [GitHub Send Pull Request Documentation](http://help.github.com/send-pull-requests/)
351 | - [GitHub Using Pull Request Documentation](https://help.github.com/articles/using-pull-requests/)
352 | - [Forking a Github Repo](http://help.github.com/fork-a-repo/)
353 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: iamnewton
4 | patreon: iamnewton
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | ---
5 |
6 | **Describe the bug**
7 | _A clear and concise description of what the bug is_
8 |
9 | **To Reproduce**
10 | _Steps to reproduce the behavior_
11 |
12 | Or better yet, provide a link to a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
13 |
14 | **Expected behavior**
15 | _A clear and concise description of what you expected to happen_
16 |
17 | **Screenshots**
18 | _If applicable, add screenshots to help explain your problem_
19 |
20 | **Additional context**
21 | _Add any other context about the problem here_
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | ---
5 |
6 | **Is your feature request related to a problem? Please describe.**
7 | _A clear and concise description of what the problem is. (e.g. I'm always frustrated when [...])_
8 |
9 | **Describe the solution you'd like**
10 | _A clear and concise description of what you want to happen_
11 |
12 | **Describe alternatives you've considered**
13 | _A clear and concise description of any alternative solutions or features you've considered_
14 |
15 | **Additional context**
16 | _Add any other context or screenshots about the feature request here_
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/support_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Support Request
3 | about: Ask a question about this project
4 | ---
5 |
6 | **How can we help you?**
7 | _A clear and concise description of what the bug is_
8 |
9 | **Additional context**
10 | _Add any other context about here_
11 |
--------------------------------------------------------------------------------
/.github/MAINTAINING.md:
--------------------------------------------------------------------------------
1 | # How to Maintain
2 |
3 | :bangbang: This project has a [Code of Conduct](./CODE_OF_CONDUCT.md). By interacting with this repository, organization, and/or community you agree to abide by its terms.
4 |
5 | If you're one of the important members on the team of Contributors, Maintainers or Owners and you're looking for a guide on how we do things around here, please read on.
6 |
7 | ## How do I…
8 |
9 | * [Use This Guide](#introduction)?
10 | * [Provide Support on Issues](#provide-support-on-issues)
11 | * [Label Issues](#label-issues)
12 | * [Clean Up Issues and PRs](#clean-up-issues-and-prs)
13 | * [Create a Pull Request](#create-a-pull-request)
14 | * [Review Pull Requests](#review-pull-requests)
15 | * [Merge Pull Requests](#merge-pull-requests)
16 | * [Prepare a Release](#prepare-a-release)
17 |
18 | ## Introduction
19 |
20 | All types of contributions are encouraged and valued. See the [table of contents](#toc) for the different ways to help and details about how this project handles them! Please make sure to read the relevant section before making your contribution! It will make it a lot easier for us maintainers to make the most of it and smooth out the experience for all involved.
21 |
22 | We look forward to your contributions. ✨
23 |
24 | ## Provide Support on Issues
25 |
26 | Helping out other users with their questions is a really awesome way of contributing to any community. It's not uncommon for most of the issues on projects being support-related questions by users trying to understand something they ran into, or find their way around a known bug.
27 |
28 | Sometimes, the `support` label will be added to things that turn out to actually be other things, like bugs or feature requests. In that case, suss out the details with the person who filed the original issue, add a comment explaining what the bug is, and change the label from `support` to `fix` or `feat`. If you can't do this yourself, @mention a maintainer so they can do it.
29 |
30 | In order to help other folks out with their questions:
31 |
32 | * Go to the issue tracker and [filter open issues by the `support` label](https://github.com/iamnewton/alfred-postcss-workflow/issues?q=is%3Aopen+is%3Aissue+label%3Asupport).
33 | * Read through the list until you find something that you're familiar enough with to give an answer.
34 | * Respond to the issue with whatever details are needed to clarify the question, or get more details about what's going on.
35 | * Once the discussion wraps up and things are clarified, either close the issue, or ask the original issue filer (or a maintainer) to close it for you.
36 |
37 | Some notes on picking up support issues:
38 |
39 | * Avoid responding to issues you don't know you can answer accurately.
40 | * As much as possible, try to refer to past issues with accepted answers. Link to them from your replies with the `#123` format.
41 | * Be kind and patient with users -- often, folks who have run into confusing things might be upset or impatient. This is ok. Try to understand where they're coming from, and if you're too uncomfortable with the tone, feel free to stay away or withdraw from the issue. (note: if the user is outright hostile or is violating the CoC, [refer to the Code of Conduct](./CODE_OF_CONDUCT.md) to resolve the conflict).
42 |
43 | ## Label Issues
44 |
45 | One of the most important tasks in handling issues is labeling them usefully and accurately. All other tasks involving issues ultimately rely on the issue being classified in such a way that relevant parties looking to do their own tasks can find them quickly and easily.
46 |
47 | In order to label issues, [open up the list of unlabeled issues](https://github.com/iamnewton/alfred-postcss-workflow/issues?q=is%3Aopen+is%3Aissue+no%3Alabel) and, **from newest to oldest**, read through each one and apply issue labels according to the table below. If you're unsure about what label to apply, skip the issue and try the next one: don't feel obligated to label each and every issue yourself!
48 |
49 | Label | Apply When | Notes
50 | --- | --- | ---
51 | `blocked` | Added to issues or pull requests that are blocked by either some other feature or bug fix required to complete the work | Can be combined with other labels such as `fix`, `feat` and `critical`.
52 | `chore` | Added to issues or pull requests that affect any of the documentation, tests or attempt to refactor the project. | These issues should not change code such that a version bump would be required.
53 | `critical` | Added to `fix` issues if the problem described makes the code completely unusable in a common situation. |
54 | `duplicate` | Added to issues or PRs that refer to the exact same issue as another one that's been previously labeled. | Duplicate issues should be marked and closed right away, with a message referencing the issue it's a duplicate of (with `#123`)
55 | `feat` | Added to [feature requests](#request-a-feature), PRs, or documentation issues that are purely additive: the code or docs currently work as expected, but a change is being requested or suggested. |
56 | `fix` | Cases where the code (or documentation) is behaving in a way it wasn't intended to. | If something is happening that surprises the *user* but does not go against the way the code is designed, it should use the `feat` label.
57 | `good first issue` | Applied by [Contributors](./CONTRIBUTING.md#permissions) or higher to issues that they consider good introductions to the project for people who have not contributed before. These are not necessarily "easy", but rather focused around how much context is necessary in order to understand what needs to be done for this project in particular. | Existing project members are expected to stay away from these unless they increase in priority.
58 | `help wanted` | Applied by [Contributors](./CONTRIBUTING.md#permissions) or higher to issues and PRs that they would like to get outside help for. Generally, this means it's lower priority for the maintainer team to itself implement, but that the community is encouraged to pick up if they so desire | Never applied on first-pass labeling.
59 | `in progress` | Applied by [Contributors](./CONTRIBUTING.md#permissions) or higher to PRs that are pending some work before they're ready for review. | The original PR submitter should @mention the team member that applied the label once the PR is complete.
60 | `needs clarification` | Applied by [Contributors](./CONTRIBUTING.md#permissions) or higher to issues or PRs that require a bit more information in order to move forward. | The original submitter should @mention the team member that applied the label once clarification has been provided.
61 | `next release` | Applied by [Maintainers](./CONTRIBUTING.md#permissions) or higher to PRs that have been approved and are tagged for the next release. | Generally we don't hold up PRs as we release as soon as possible, but in cases where we can't, this is handy to call out.
62 | `support` | This issue is either asking a question about how to use the project, clarifying the reason for unexpected behavior, or possibly reporting a `bug` but does not have enough detail yet to determine whether it would count as such. | The label should be switched to `fix` if reliable reproduction steps are provided. Issues primarily with unintended configurations of a user's environment are not considered bugs, even if they cause crashes.
63 | `wontfix` | Labelers may apply this label to issues that clearly have nothing at all to do with the project or are otherwise entirely outside of its scope/sphere of influence. [Committers](#join-the-project-team) may apply this label and close an issue or PR if they decide to pass on an otherwise relevant issue. | The issue or PR should be closed as soon as the label is applied, and a clear explanation provided of why the label was used. Contributors are free to contest the labeling, but the decision ultimately falls on committers as to whether to accept something or not.
64 |
65 | ## Clean Up Issues and PRs
66 |
67 | Issues and PRs can go stale after a while; maybe they're abandoned; maybe the team will not have time to address them any time soon. In these cases, they should be closed until they're brought up again or the interaction starts over.
68 |
69 | To clean up issues and PRs:
70 |
71 | * Search the issue tracker for issues or PRs, and add the term `updated:<=YYYY-MM-DD`, where the date is 30 days before today.
72 | * Go through each issue *from oldest to newest*, and close them if **all of the following are true**:
73 | * not opened by a maintainer
74 | * not marked as `critical`
75 | * not marked as `good first issue` or `help wanted` (these might stick around for a while, in general, as they're intended to be available)
76 | * no explicit messages in the comments asking for it to be left open
77 | * does not belong to a milestone
78 | * Leave a message when closing saying "Cleaning up stale issue. Please reopen or ping us if and when you're ready to resume this. See https://github.com/iamnewton/alfred-postcss-workflow/blob/latest/MAINTAINING.md#clean-up-issues-and-prs for more details."
79 |
80 | ## Create a Pull Request
81 |
82 | If you're unfamiliar with the Github flow, please [read this guide](https://guides.github.com/introduction/flow/index.html) as an introduction. Make sure you reach out to someone on the team before you start any work to ensure that what you're doing is aligned with the teams' vision. Read Ilya Grigorik's great article [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/). The following passage sums up some great points:
83 |
84 | > Contributions are always welcome, but surprise patches are mostly just a burden. Yes, you are offering your help, but someone else will have to maintain your code over the long term - get their buy-in first, avoid surprises. Even worse, a localized change to address a specific problem will often miss the full implications to the project: other existing use cases, future roadmap plans, or overall architectural decisions. A good idea can be implemented inappropriately for the specific project; it can be invalidated by another effort that you may not even be aware of; the timing may be wrong, and a dozen other reasons can conspire against you.
85 |
86 | 1. Clone the repo (`git clone https://github.com/iamnewton/alfred-postcss-workflow`)
87 | 2. If you've cloned previously, then get latest changes (`git checkout master; git pull origin master`).
88 | 3. Create your feature branch (`git checkout -b `); checkout the
89 | guide below for our branching strategy.
90 | 4. Commit your changes (`git commit`), following the format suggested below. Please don't use the shortcut flag `git commit -m ` as there is more detail required than what is allowed by only using that flag.
91 | 5. Push to the branch (`git push origin `)
92 | 6. Create a new Pull Request; make sure you fill in the Pull Request template.
93 |
94 | **IMPORTANT**: Every patch and subsequent message should have a bug attached. If there is no ticket, no work should be done.
95 |
96 | ### Gotchas
97 |
98 | - Please avoid working directly on the `master` branch.
99 | - Make commits of logical units.
100 | - Check for unnecessary whitespace with `git diff --check` before committing.
101 | - Make sure your commit messages are in the [proper format](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), also listed below in our guides.
102 |
103 | ## Review Pull Requests
104 |
105 | While anyone can comment on a PR, add feedback, etc, PRs are only *approved* by team members with Contributor or higher permissions.
106 |
107 | PR reviews use [GitHub's own review feature](https://help.github.com/articles/about-pull-request-reviews/), which manages comments, approval, and review iteration.
108 |
109 | *ALL PULL REQUESTS* being approved must:
110 |
111 | * be approved by at least 2 reviewers, one of which should come from a code owner from within the [CODEOWNERS](./CODEOWNERS) file, unless submitted by a Maintainer or above.
112 | * be up-to-date and have no conflicts with the master branch.
113 | * be covered by a test either by a previously-failing test, an existing test that covers the entire functionality of the submitted code, or new tests that verify any new/changed behavior.
114 | * have all tests pass and follow established conventions.
115 | * not drop the test coverage percentages, unless the specific case is considered reasonable by maintainers.
116 | * pass our linting suite 100% with no errors on both the JavaScript and SCSS side
117 |
118 | :notebook_with_decorative_cover: All of the above are generally covered by our [branch protection rules](https://help.github.com/en/github/administering-a-repository/about-protected-branches) so nothing extra is required from the reviewer.
119 |
120 | Some notes about reviewing:
121 |
122 | * You may ask for minor changes ("nitpicks"), but consider whether they are really blockers to merging: try to err on the side of "approve, with comments".
123 | * Please make sure you're familiar with the code or documentation being updated, unless it's a minor change (spellchecking, minor formatting, etc). You may @mention another project member who you think is better suited for the review, but still provide a non-approving review of your own. Check the [CODEOWNERS](./CODEOWNERS.md) file for a list of people you can mention when in doubt.
124 | * Be extra kind: people who submit code/doc contributions are putting themselves in a pretty vulnerable position, and have put time and care into what they've done (even if that's not obvious to you!) -- always respond with respect, be understanding, but don't feel like you need to sacrifice your standards for their sake, either; please don't be a jerk about it.
125 |
126 | :notebook_with_decorative_cover: Be sure to check out the list of browsers and devices we support listed below when testing out a PR. All features should function the same in each one, but don't necessarily require that they all match in design.
127 |
128 | ## Merge Pull Requests
129 |
130 | **Permission Required**: [Maintainer](./CONTRIBUTING.md#permissions)
131 |
132 | After a pull request has been given the green light, it's time to prepare for the deployment.
133 |
134 | ### Preparation
135 |
136 | 1. Merge your feature branch into master by pressing the button on GitHub's interface. Use the **Squash and merge** button in case there are other options. It's okay to merge multiple features and release once for those different features.
137 | 2. Ensure that the title of the PR is in the form of [conventional commits](https://conventionalcommits.org/). If you named the title of your PR in this format then it should follow through when you go to merge.
138 | 3. Read below for versioning.
139 |
140 | ## Prepare A Release
141 |
142 | **Permission Required**: [Owner](./CONTRIBUTING.md#permissions)
143 |
144 | At the time of this writing the process for releasing is not fully automated and requires some manual work; please read below for how we do it.
145 |
146 | For reference, we use [SemVer](https://semver.org/) for its versioning providing us an opt-in approach to releases. This means we add a version number according to the spec, as you see below. So rather than force developers to consume the latest and greatest, they can choose which version to consume and test any newer ones before upgrading. Please the read the spec as it goes into further detail.
147 |
148 | Given a version number **MAJOR.MINOR.PATCH**, increment the:
149 |
150 | * **MAJOR** version when you make incompatible API changes.
151 | * **MINOR** version when you add functionality in a backward-compatible manner.
152 | * **PATCH** version when you make backward-compatible bug fixes.
153 |
154 | Additional labels for pre-release and build metadata are available as extensions to the **MAJOR.MINOR.PATCH** format.
155 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | **Description**
2 | _A clear and concise description of why the feature is necessary_
3 |
4 | **Screenshots**
5 | _If applicable, add screenshots to help explain your problem_
6 |
7 | **Additional context**
8 | _Add any other context about the problem here. Where there any challenges that need to be documented_
9 |
10 | **Checklist**
11 | _Have you considered all of the following?_
12 |
13 | Please confirm by checking off each item to ensure you've considered it:
14 |
15 | - [ ] Did you create or update tests?
16 | - [ ] Did you create or update any documentation?
17 | - [ ] Did you export all new members of the lib?
18 |
19 | ---
20 |
21 | Fixes:
22 |
--------------------------------------------------------------------------------
/.github/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # Support
2 |
3 | :bangbang: This project has a [Code of Conduct](./CODE_OF_CONDUCT.md). By interacting with this repository, organization, and/or community you agree to abide by its terms.
4 |
5 | ## How do I…
6 |
7 | * [Request Support](#request-support)
8 | * [Report an Error or Bug](#report-an-error-or-bug)
9 | * [Request a Feature](#request-a-feature)
10 | * [Contribute Back](#contribute-to-the-project)
11 | * [Help Maintain](#help-out-with-maintenance)
12 |
13 | ## Request Support
14 |
15 | If you have a question about this project, how to use it, or need clarification about something:
16 |
17 | 1. Open a [support request](https://github.com/iamnewton/alfred-postcss-workflow/issues/new?template=support_request.md) or reach out via [email](mailto:holocron77@gmail.com).
18 | 2. Provide as much context as you can about what you're running into.
19 | 3. Provide browser, library and/or platform versions (`nodejs`, `npm`, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it.
20 |
21 | If you chose to write an issue, once it's filed:
22 |
23 | * The team will [label the issue](./MAINTAINING.md#label-issues).
24 | * Someone will try to respond as soon as possible, generally within 48 hours.
25 | * If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](./MAINTAINING.md#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made.
26 |
27 | If you chose to ask us a question, then ask a quality question:
28 |
29 | Help us help you!
30 |
31 | Spending time framing a question and adding support links or resources makes it much easier for us to help. It’s common to fall into the trap of asking something too specific when you’re close to a problem. Then, those trying to help you out have to spend a lot of time asking additional questions to understand what you are hoping to achieve.
32 |
33 | Spending the extra time up front can help save everyone time in the long run.
34 |
35 | * Try to define what you need help with:
36 | * Is there something in particular you want to do?
37 | * What problem are you encountering and what steps have you taken to try and fix it?
38 | * Is there a concept you’re not understanding?
39 | * Learn about the [rubber duck debugging method](https://rubberduckdebugging.com/).
40 | * Avoid falling for the [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378).
41 | * Search on GitHub and Slack to see if a similar question has been asked
42 | * If possible, provide sample code, a [CodeSandbox](https://codesandbox.io/) or a video
43 | * The more time you put into asking your question, the better we can help you
44 |
45 | ## Report an Error or Bug
46 |
47 | If you run into an error or bug with the project:
48 |
49 | 1. Open a [bug report](https://github.com/iamnewton/alfred-postcss-workflow/issues/new?template=bug_report.md)
50 | 2. Fill out the template and provide as much context as you can about what you're running into and be sure to include steps **to reproduce** such that someone else can follow to recreate the bug or error on their own.
51 | 4. Provide project and platform versions (`nodejs`, `npm`, etc), depending on what seems relevant. If not, please be ready to provide that information if maintainers ask for it.
52 |
53 | Once it's filed:
54 |
55 | * The team will [label the issue](./CONTRIBUTING.md#label-issues).
56 | * A team member will try to reproduce the issue with your provided steps. If there are no obvious ways to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-clarification`. Bugs with the `needs-clarification` tag will not be addressed until they are reproduced.
57 | * If the team is able to reproduce the issue, it will be marked `fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](https://github.com/iamnewton/alfred-postcss-workflow/graphs/contributors).
58 | * If you or the maintainers don't respond to an issue for 30 days, the [issue will be closed](./MAINTAINING.md#clean-up-issues-and-prs). If you want to come back to it, reply (once, please), and we'll reopen the existing issue. Please avoid filing new issues as extensions of one you already made.
59 | * `critical` issues may be left open, depending on perceived immediacy and severity, even past the 30 day deadline.
60 |
61 | ## Request a Feature
62 |
63 | If the project doesn't do something you need or want it to do:
64 |
65 | 1. Open a [feature request](https://github.com/iamnewton/alfred-postcss-workflow/issues/new?template=feature_request.md)
66 | 2. Fill out the template and provide as much context as you can about what you're running into.
67 | 3. Please try and be clear about why existing features and alternatives would not work for you.
68 |
69 | Once it's filed:
70 |
71 | * The team will [label the issue](./MAINTAINING.md#label-issues).
72 | * The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward.
73 | * If the feature request is accepted, it will be marked for implementation with `feat`, which can then be done by either by a core team member or by anyone in the community who wants to [contribute code](./CONTRIBUTING.md).
74 |
75 | :notebook_with_decorative_cover: The team is unlikely to be able to accept every single feature request that is filed. Please understand if they need to say no.
76 |
77 | ## Contribute to the project
78 |
79 | If you're looking to help contribute, please read our guide on [how to contribute](./CONTRIBUTING.md).
80 |
81 | ## Help Out with Maintenance
82 |
83 | If you're a maintainer and need some guidance on things are done, please read our guide on [helping maintain the library](./MAINTAINING.md).
84 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PostCSS Alfred Workflow
2 |
3 | Search for PostCSS plugins from
4 |
5 | ![alt text][postcss]
6 |
7 | ## Requirements
8 |
9 | 1. [Alfred App v2 or greater](http://www.alfredapp.com/#download)
10 | 2. [Alfred PowerPack](https://buy.alfredapp.com/)
11 |
12 | ## Installation
13 |
14 | 1. [Download](/blob/master/postcss.alfredworkflow)
15 | 2. Double-click downloaded file to import into Alfred
16 | 3. Review the workflow to add custom Hotkeys
17 |
18 | ## Commands
19 |
20 | - `postcss {query}`
21 |
22 | ## Contributors
23 |
24 | - [@willfarrell](https://github.com/willfarrell)
25 | - [@himynameisdave](https://github.com/himynameisdave/)
26 |
27 | [postcss]: ./screenshots/postcss.png "Sample search"
28 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-architect
2 |
--------------------------------------------------------------------------------
/current-version.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.0",
3 | "download_url": "https://raw.github.com/iamnewton/alfred-postcss-workflow/master/postcss.alfredworkflow",
4 | "description": "postcss.parts Search"
5 | }
6 |
--------------------------------------------------------------------------------
/postcss.alfredworkflow:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamnewton/alfred-postcss-workflow/ab363299667a12694cff999e45bd8a54b1497d63/postcss.alfredworkflow
--------------------------------------------------------------------------------
/screenshots/alfred.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamnewton/alfred-postcss-workflow/ab363299667a12694cff999e45bd8a54b1497d63/screenshots/alfred.png
--------------------------------------------------------------------------------
/screenshots/postcss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamnewton/alfred-postcss-workflow/ab363299667a12694cff999e45bd8a54b1497d63/screenshots/postcss.png
--------------------------------------------------------------------------------
/src/data.json:
--------------------------------------------------------------------------------
1 | [{"url":"https:\/\/github.com\/morishitter\/atcss","title":"atcss","description":"Plugin pack that transforms your CSS according to special annotation comments.","keywords":null},{"url":"https:\/\/github.com\/ben-eb\/cssnano","title":"cssnano","description":"Plugin pack that optimizes CSS size for use in production.","keywords":null},{"url":"https:\/\/github.com\/cssnext\/cssnext\/","title":"cssnext","description":"Plugin pack that allows you to use future CSS features today.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/precss","title":"precss","description":"Plugin pack that allows you to use Sass-like CSS.","keywords":null},{"url":"https:\/\/github.com\/simplaio\/rucksack","title":"rucksack","description":"Plugin pack to speeds up CSS development with new features and shortcuts.","keywords":null},{"url":"https:\/\/github.com\/stylelint\/stylelint","title":"stylelint","description":"Plugin pack that lints your stylesheets.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-color-function","title":"postcss-color-function","description":"Supports functions to transform colors.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-color-gray","title":"postcss-color-gray","description":"Supports the gray() function.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-color-hex-alpha","title":"postcss-color-hex-alpha","description":"Supports #rrggbbaa and #rgba notation.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-color-hwb","title":"postcss-color-hwb","description":"Transforms hwb() to widely compatible rgb().","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-color-rebeccapurple","title":"postcss-color-rebeccapurple","description":"Supports the rebeccapurple color.","keywords":null},{"url":"https:\/\/github.com\/rsanchez\/postcss-colors-only","title":"postcss-colors-only","description":"Removes all rules except those which contain one or more colors.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-conic-gradient","title":"postcss-conic-gradient","description":"Supports the conic-gradient background.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-custom-media","title":"postcss-custom-media","description":"Supports custom aliases for media queries.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-custom-properties","title":"postcss-custom-properties","description":"Supports variables, using syntax from the W3C Custom Properties.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-custom-selectors","title":"postcss-custom-selectors","description":"Adds custom aliases for selectors.","keywords":null},{"url":"https:\/\/github.com\/travco\/postcss-extend","title":"postcss-extend","description":"Supports spec-approximate @extend for rules and placeholders, recursively.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-font-variant","title":"postcss-font-variant","description":"Transpiles human-readable font-variant to more widely supported CSS.","keywords":null},{"url":"https:\/\/github.com\/vitkarpov\/postcss-host","title":"postcss-host","description":"Makes the Shadow DOM :host selector work properly with pseudo-classes.","keywords":null},{"url":"https:\/\/github.com\/maximkoretskiy\/postcss-initial","title":"postcss-initial","description":"supports `initial` keyword and `all: initial` to clean inherit styles.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-media-minmax","title":"postcss-media-minmax","description":"Adds <= and => statements to media queries.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-pseudo-class-any-link","title":"postcss-pseudo-class-any-link","description":"Adds :any-link pseudo-class.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-selector-not","title":"postcss-selector-not","description":"Transforms CSS4 :not() to CSS3 :not()","keywords":null},{"url":"https:\/\/github.com\/twbs\/mq4-hover-shim","title":"mq4-hover-shim","description":"Supports the @media(hover) feature.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-color-rgba-fallback","title":"postcss-color-rgba-fallback","description":"Transforms rgba() to hexadecimal.","keywords":null},{"url":"https:\/\/github.com\/Rycochet\/postcss-epub","title":"postcss-epub","description":"Adds the -epub- prefix to relevant properties.","keywords":null},{"url":"https:\/\/github.com\/iamvdo\/postcss-opacity","title":"postcss-opacity","description":"Adds opacity filter for IE8.","keywords":null},{"url":"https:\/\/github.com\/axa-ch\/postcss-pseudoelements","title":"postcss-pseudoelements","description":"Convert :: selectors into : selectors for IE 8 compatibility.","keywords":null},{"url":"https:\/\/github.com\/iamvdo\/postcss-vmin","title":"postcss-vmin","description":"Generates vm fallback for vmin unit in IE9.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-will-change","title":"postcss-will-change","description":"Inserts 3D hack before will-change property.","keywords":null},{"url":"https:\/\/github.com\/postcss\/autoprefixer","title":"autoprefixer","description":"Adds vendor prefixes for you, using data from Can I Use.","keywords":null},{"url":"https:\/\/github.com\/cssdream\/cssgrace","title":"cssgrace","description":"Provides various helpers and transpiles CSS 3 for IE and other old browsers.","keywords":null},{"url":"https:\/\/github.com\/robwierzbowski\/node-pixrem","title":"pixrem","description":"Generates pixel fallbacks for rem units.","keywords":null},{"url":"https:\/\/github.com\/ileri\/postcss-bem","title":"postcss-bem","description":"Adds at-rules for BEM and SUIT style classes.","keywords":null},{"url":"https:\/\/github.com\/andyjansson\/postcss-conditionals","title":"postcss-conditionals","description":"Adds @if statements.","keywords":null},{"url":"https:\/\/github.com\/MadLittleMods\/postcss-css-variables","title":"postcss-css-variables","description":"Supports variables for selectors, and at-rules using W3C similar syntax.","keywords":null},{"url":"https:\/\/github.com\/daleeidd\/postcss-define-property","title":"postcss-define-property","description":"To define properties shortcut.","keywords":null},{"url":"https:\/\/github.com\/outpunk\/postcss-each","title":"postcss-each","description":"Adds @each statement.","keywords":null},{"url":"https:\/\/github.com\/antyakushev\/postcss-for","title":"postcss-for","description":"Adds @for loops.","keywords":null},{"url":"https:\/\/github.com\/andyjansson\/postcss-functions","title":"postcss-functions","description":"enables exposure of JavaScript functions.","keywords":null},{"url":"https:\/\/github.com\/macropodhq\/postcss-local-constants","title":"postcss-local-constants","description":"Adds support for localized constants.","keywords":null},{"url":"https:\/\/github.com\/rtsao\/postcss-match","title":"postcss-match","description":"adds @match for Rust-style pattern matching.","keywords":null},{"url":"https:\/\/github.com\/pascalduez\/postcss-map","title":"postcss-map","description":"Enables configuration maps.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-mixins","title":"postcss-mixins","description":"Enables mixins more powerful than Sass', defined within stylesheets or in JS.","keywords":null},{"url":"https:\/\/github.com\/WolfgangKluge\/postcss-media-variables","title":"postcss-media-variables","description":"Adds support for var() and calc() in @media rules.","keywords":null},{"url":"https:\/\/github.com\/kristoferjoseph\/postcss-modular-scale","title":"postcss-modular-scale","description":"Adds a modular scale ms() function.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-nested","title":"postcss-nested","description":"Unwraps nested rules.","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-nested-props","title":"postcss-nested-props","description":"Unwraps nested properties.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-pseudo-class-enter","title":"postcss-pseudo-class-enter","description":"Transforms :enter into :hover and :focus.","keywords":null},{"url":"https:\/\/github.com\/pascalduez\/postcss-quantity-queries","title":"postcss-quantity-queries","description":"Enables quantity queries.","keywords":null},{"url":"https:\/\/github.com\/andyjansson\/postcss-sassy-mixins","title":"postcss-sassy-mixins","description":"Enables mixins with Sass keywords.","keywords":null},{"url":"https:\/\/github.com\/davidtheclark\/postcss-simple-extend","title":"postcss-simple-extend","description":"Lightweight extending of silent classes, like Sass' @extend.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-simple-vars","title":"postcss-simple-vars","description":"Supports for Sass-style variables.","keywords":null},{"url":"https:\/\/github.com\/whitneyit\/postcss-strip-units","title":"postcss-strip-units","description":"Strips units off of property values.","keywords":null},{"url":"https:\/\/github.com\/markgoodyear\/postcss-vertical-rhythm","title":"postcss-vertical-rhythm","description":"Adds a vertical rhythm unit based on font-size and line-height.","keywords":null},{"url":"https:\/\/github.com\/geddski\/csstyle","title":"csstyle","description":"Adds components workflow to your styles.","keywords":null},{"url":"https:\/\/github.com\/1j01\/postcss-gtk","title":"postcss-gtk","description":"Processes GTK+ CSS into browser CSS.","keywords":null},{"url":"https:\/\/github.com\/dfernandez79\/postcss-ase-colors","title":"postcss-ase-colors","description":"replaces color names with values read from an ASE palette file.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-brand-colors","title":"postcss-brand-colors","description":"Inserts company brand colors in the brand-colors module.","keywords":null},{"url":"https:\/\/github.com\/avanes\/postcss-color-alpha","title":"postcss-color-alpha","description":"Transforms #hex.a, black(alpha) and white(alpha) to rgba().","keywords":null},{"url":"https:\/\/github.com\/devgru\/postcss-color-hcl","title":"postcss-color-hcl","description":"Transforms hcl(H, C, L) and hcl(H, C, L, alpha) to #rgb and #rgba.","keywords":null},{"url":"https:\/\/github.com\/nicksheffield\/postcss-color-hexa","title":"postcss-color-hexa","description":"Transforms hexa(hex, alpha) into rgba() format.","keywords":null},{"url":"https:\/\/github.com\/iamstarkov\/postcss-color-mix","title":"postcss-color-mix","description":"Mixes two colors together.","keywords":null},{"url":"https:\/\/github.com\/zaim\/postcss-color-palette","title":"postcss-color-palette","description":"Transforms CSS 2 color keywords to a custom palette.","keywords":null},{"url":"https:\/\/github.com\/longdog\/postcss-color-pantone","title":"postcss-color-pantone","description":"Transforms pantone color to RGB.","keywords":null},{"url":"https:\/\/github.com\/kristoferjoseph\/postcss-color-scale","title":"postcss-color-scale","description":"Adds a color scale cs() function.","keywords":null},{"url":"https:\/\/github.com\/andrepolischuk\/postcss-color-short","title":"postcss-color-short","description":"adds shorthand color declarations.","keywords":null},{"url":"https:\/\/github.com\/btholt\/postcss-colorblind","title":"postcss-colorblind","description":"Transforms colors using filters to simulate colorblindness.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-hexrgba","title":"postcss-hexrgba","description":"Adds shorthand hex rgba(hex, alpha) method.","keywords":null},{"url":"https:\/\/github.com\/himynameisdave\/postcss-rgb-plz","title":"postcss-rgb-plz","description":"converts 3 or 6 digit hex values to rgb","keywords":null},{"url":"https:\/\/github.com\/borodean\/postcss-assets","title":"postcss-assets","description":"Allows you to simplify URLs, insert image dimensions, and inline files.","keywords":null},{"url":"https:\/\/github.com\/simonsmith\/postcss-at2x","title":"postcss-at2x","description":"Handles retina background images via use of at-2x keyword.","keywords":null},{"url":"https:\/\/github.com\/Ser-Gen\/postcss-data-packer","title":"postcss-data-packer","description":"Moves embedded Base64 data to a separate file.","keywords":null},{"url":"https:\/\/github.com\/alex499\/postcss-image-set","title":"postcss-image-set","description":"Adds background-image with first image for image-set().","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-font-pack","title":"postcss-font-pack","description":"Simplifies font declarations and validates they match configured font packs.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-fontpath","title":"postcss-fontpath","description":"Adds font links for different browsers.","keywords":null},{"url":"https:\/\/github.com\/2createStudio\/postcss-sprites","title":"postcss-sprites","description":"Generates CSS sprites from stylesheets.","keywords":null},{"url":"https:\/\/github.com\/Pavliko\/postcss-svg","title":"postcss-svg","description":"Insert inline SVG to CSS and allows to manage it colors.","keywords":null},{"url":"https:\/\/github.com\/justim\/postcss-svg-fallback","title":"postcss-svg-fallback","description":"Converts SVG in your CSS to PNG files for IE 8.","keywords":null},{"url":"https:\/\/github.com\/ben-eb\/postcss-svgo","title":"postcss-svgo","description":"Processes inline SVG through SVGO.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-url","title":"postcss-url","description":"Rebases or inlines url()s.","keywords":null},{"url":"https:\/\/github.com\/lexich\/webpcss","title":"webpcss","description":"Adds URLs for WebP images for browsers that support WebP.","keywords":null},{"url":"https:\/\/github.com\/yuezk\/postcss-urlrev","title":"postcss-urlrev","description":"Adds md5 hash strings to url()s.","keywords":null},{"url":"https:\/\/github.com\/andyjansson\/postcss-grid","title":"postcss-grid","description":"Adds a semantic grid system.","keywords":null},{"url":"https:\/\/github.com\/jo-asakura\/postcss-neat","title":"postcss-neat","description":"A semantic and fluid grid framework.","keywords":null},{"url":"https:\/\/github.com\/corysimmons\/lost","title":"lost","description":"Feature-rich calc() grid system by Jeet author.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-calc","title":"postcss-calc","description":"Reduces calc() to values (when expressions involve the same units).","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-import","title":"postcss-import","description":"Inlines the stylesheets referred to by @import rules.","keywords":null},{"url":"https:\/\/github.com\/hail2u\/postcss-single-charset","title":"postcss-single-charset","description":" ensures that there is one and only one @charset rule at the top of file.","keywords":null},{"url":"https:\/\/github.com\/ben-eb\/postcss-zindex","title":"postcss-zindex","description":"Rebases positive z-index values.","keywords":null},{"url":"https:\/\/github.com\/AoDev\/css-byebye","title":"css-byebye","description":"Removes the CSS rules that you don't want.","keywords":null},{"url":"https:\/\/github.com\/hail2u\/node-css-mqpacker","title":"css-mqpacker","description":"Joins matching CSS media queries into a single statement.","keywords":null},{"url":"https:\/\/github.com\/ben-eb\/stylehacks","title":"stylehacks","description":"Removes CSS hacks based on browser support.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-alias","title":"postcss-alias","description":"Creates shorter aliases for properties.","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-all-link-colors","title":"postcss-all-link-colors","description":"Insert colors for link-related pseudo-classes.","keywords":null},{"url":"https:\/\/github.com\/andrepolischuk\/postcss-border","title":"postcss-border","description":"Adds shorthand for width and color of all borders in border property.","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-center","title":"postcss-center","description":"centers elements","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-circle","title":"postcss-circle","description":"Inserts a circle with color.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-clearfix","title":"postcss-clearfix","description":"Adds fix and fix-legacy properties to the clear declaration.","keywords":null},{"url":"https:\/\/github.com\/johnie\/postcss-crip","title":"postcss-crip","description":"Shorthand properties for Crips that are too lazy to write.","keywords":null},{"url":"https:\/\/github.com\/antyakushev\/postcss-default-unit","title":"postcss-default-unit","description":"Adds default unit to numeric CSS properties.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-easings","title":"postcss-easings","description":"Replaces easing names from easings.net with cubic-bezier() functions.","keywords":null},{"url":"https:\/\/github.com\/alanev\/postcss-filter","title":"postcss-filter","description":"adds shorthand for black and white filter.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-focus","title":"postcss-focus","description":"Adds :focus selector to every :hover.","keywords":null},{"url":"https:\/\/github.com\/simonsmith\/postcss-generate-preset","title":"postcss-generate-preset","description":"Allows quick generation of rules. Useful for creating repetitive utilities.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-input-style","title":"postcss-input-style","description":"adds new pseudo-elements for cross-browser styling of inputs.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-position","title":"postcss-position","description":"Adds shorthand declarations for position attributes.","keywords":null},{"url":"https:\/\/github.com\/simonsmith\/postcss-property-lookup","title":"postcss-property-lookup","description":"Allows referencing property values without a variable.","keywords":null},{"url":"https:\/\/github.com\/seaneking\/postcss-responsive-type","title":"postcss-responsive-type","description":"Changes font-size depending on screen size.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-short","title":"short","description":"Adds and extends numerous shorthand properties.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-size","title":"postcss-size","description":"Adds a size shortcut that sets width and height with one declaration.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-transform-shortcut","title":"postcss-transform-shortcut","description":"Allows shorthand transform properties in CSS.","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-triangle","title":"postcss-triangle","description":"creates a triangle","keywords":null},{"url":"https:\/\/github.com\/davidhemphill\/postcss-verthorz","title":"postcss-verthorz","description":"Adds vertical and horizontal spacing declarations.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-font-magician","title":"postcss-font-magician","description":"generates all the @font-face rules needed in CSS.","keywords":null},{"url":"https:\/\/github.com\/thompsongl\/postcss-class-prefix","title":"postcss-class-prefix","description":"Adds a prefix\/namespace to class selectors.","keywords":null},{"url":"https:\/\/github.com\/pathsofdesign\/postcss-fakeid","title":"postcss-fakeid","description":"Transforms #foo IDs to attribute selectors [id='foo'].","keywords":null},{"url":"https:\/\/github.com\/hallvors\/postcss-flexboxfixer","title":"postcss-flexboxfixer","description":"Unprefixes -webkit- only flexbox in legacy CSS.","keywords":null},{"url":"https:\/\/github.com\/hallvors\/postcss-gradientfixer","title":"postcss-gradientfixer","description":"Unprefixes -webkit- only gradients in legacy CSS.","keywords":null},{"url":"https:\/\/github.com\/MadLittleMods\/postcss-increase-specificity","title":"postcss-increase-specificity","description":"increases the specificity of your selectors.","keywords":null},{"url":"https:\/\/github.com\/TCotton\/postcss-mq-keyframes","title":"postcss-mq-keyframes","description":"Moves any animation keyframes in media queries to the end of the file.","keywords":null},{"url":"https:\/\/github.com\/omgovich\/postcss-pseudo-elements-content","title":"postcss-pseudo-elements-content","description":"Automatically adds content: '' to :before and :after.","keywords":null},{"url":"https:\/\/github.com\/cuth\/postcss-pxtorem","title":"postcss-pxtorem","description":"Converts pixel units to rem.","keywords":null},{"url":"https:\/\/github.com\/johnotander\/postcss-remove-prefixes","title":"postcss-remove-prefixes","description":"removes vendor prefixes.","keywords":null},{"url":"https:\/\/github.com\/morishitter\/postcss-style-guide","title":"postcss-style-guide","description":"Generates a style guide automatically.","keywords":null},{"url":"https:\/\/github.com\/pazams\/postcss-scopify","title":"postcss-scopify","description":"Adds a user input scope to each selector.","keywords":null},{"url":"https:\/\/github.com\/morishitter\/cssfmt","title":"cssfmt","description":"formats CSS source code automatically inspired by Gofmt.","keywords":null},{"url":"https:\/\/github.com\/ben-eb\/perfectionist","title":"perfectionist","description":"Formats poorly written CSS and renders a 'pretty' result.","keywords":null},{"url":"https:\/\/github.com\/MohammadYounes\/rtlcss","title":"rtlcss","description":"Mirrors styles for right-to-left locales.","keywords":null},{"url":"https:\/\/github.com\/necolas\/postcss-bem-linter","title":"postcss-bem-linter","description":"Lints CSS for conformance to SUIT CSS methodology.","keywords":null},{"url":"https:\/\/github.com\/cssstats\/postcss-cssstats","title":"postcss-cssstats","description":"Returns an object with CSS statistics.","keywords":null},{"url":"https:\/\/github.com\/vovanbo\/css2modernizr","title":"css2modernizr","description":"Creates a Modernizr config file that requires only the tests that your CSS uses.","keywords":null},{"url":"https:\/\/github.com\/anandthakker\/doiuse","title":"doiuse","description":"Lints CSS for browser support, using data from Can I Use.","keywords":null},{"url":"https:\/\/github.com\/johnotander\/immutable-css","title":"immutable-css","description":"Lints CSS for class mutations.","keywords":null},{"url":"https:\/\/github.com\/davidtheclark\/list-selectors","title":"list-selectors","description":"Lists and categorizes the selectors used in your CSS, for code review.","keywords":null},{"url":"https:\/\/github.com\/a-axton\/postcss-selector-source","title":"postcss-selector-source","description":"Displays the original line and column position of your CSS selectors and declarations from your pre-processed files.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-browser-reporter","title":"postcss-browser-reporter","description":"Displays warning messages from other plugins right in your browser.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-reporter","title":"postcss-reporter","description":"Logs warnings and other messages from other plugins in the console.","keywords":null},{"url":"https:\/\/github.com\/dp-lewis\/postcss-australian-stylesheets","title":"postcss-australian-stylesheets","description":"Australian Style Sheets.","keywords":null},{"url":"https:\/\/github.com\/chancancode\/postcss-canadian-stylesheets","title":"postcss-canadian-stylesheets","description":"Canadian Style Sheets.","keywords":null},{"url":"https:\/\/github.com\/timche\/postcss-german-stylesheets","title":"postcss-german-stylesheets","description":"German Style Sheets.","keywords":null},{"url":"https:\/\/github.com\/cbas\/postcss-imperial","title":"postcss-imperial","description":"adds CSS support for Imperial and US customary units of length.","keywords":null},{"url":"https:\/\/github.com\/Semigradsky\/postcss-russian-units","title":"postcss-russian-units","description":"adds CSS support for russian units of length.","keywords":null},{"url":"https:\/\/github.com\/markgoodyear\/postcss-pointer","title":"postcss-pointer","description":"Replaces pointer: cursor with cursor: pointer.","keywords":null},{"url":"https:\/\/github.com\/HashanP\/postcss-spiffing","title":"postcss-spiffing","description":"Lets you use British English in your CSS.","keywords":null},{"url":"https:\/\/github.com\/talgautb\/postcss-currency","title":"postcss-currency","description":"replaces the name of currency with symbols.","keywords":null},{"url":"https:\/\/github.com\/admdh\/postcss-simple-grid","title":"postcss-simple-grid","description":"create grid with one line.","keywords":null},{"url":"https:\/\/github.com\/maximkoretskiy\/postcss-autoreset","title":"postcss-autoreset","description":"automatically adds reset styles.","keywords":null},{"url":"https:\/\/github.com\/moczolaszlo\/postcss-inline-comment","title":"postcss-inline-comment","description":"Plugin to use inline comments in CSS rules.","keywords":null},{"url":"https:\/\/github.com\/notacouch\/postcss-mqwidth-to-class","title":"postcss-mqwidth-to-class","description":"plugin converts min\/max-width media queries to classes, for IE8 support","keywords":null},{"url":"https:\/\/github.com\/johnie\/postcss-swedish-stylesheets","title":"postcss-swedish-stylesheets","description":"plugin for writing Swedish Style Sheets.","keywords":null},{"url":"https:\/\/github.com\/luisrudge\/postcss-flexbugs-fixes","title":"postcss-flexbugs-fixes","description":"fixes to some of known flexbox bugs","keywords":null},{"url":"https:\/\/github.com\/himynameisdave\/postcss-round-subpixels","title":"postcss-round-subpixels","description":"plugin that rounds sub-pixel values to the nearest full pixel.","keywords":null},{"url":"https:\/\/github.com\/sandralundgren\/postcss-lolcat-stylesheets","title":"postcss-lolcat-stylesheets","description":"Lolcat aka Lolspeak Style Sheets.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-unmq","title":"postcss-unmq","description":"removes media queries while preserving desktop rules for IE\u22648.","keywords":null},{"url":"https:\/\/github.com\/postcss\/postcss-selector-matches","title":"postcss-selector-matches","description":"transforms CSS4 `:matches()` to more compatible CSS.","keywords":null},{"url":"https:\/\/github.com\/liquidlight\/postcss-pseudo-content-insert","title":"postcss-pseudo-content-insert","description":"PostCSS plugin inserts an empty content block into your :before and :after pseudo elements if it is missing.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-partial-import","title":"postcss-partial-import","description":"inlines standard imports and Sass-like partials.","keywords":null},{"url":"https:\/\/github.com\/shutterstock\/postcss-copy-assets","title":"postcss-copy-assets","description":"copies assets referenced by relative `url()`s into a build directory.","keywords":null},{"url":"https:\/\/github.com\/jonathantneal\/postcss-write-svg","title":"postcss-write-svg","description":"write inline SVGs in CSS.","keywords":null},{"url":"https:\/\/github.com\/maximkoretskiy\/postcss-alias-atrules","title":"postcss-alias-atrules","description":"creates shorter aliases for at-rules.","keywords":null},{"url":"https:\/\/github.com\/Semigradsky\/postcss-russian-stylesheets","title":"postcss-russian-stylesheets","description":"Russian style sheets.","keywords":null},{"url":"https:\/\/github.com\/jedmao\/postcss-nested-vars","title":"postcss-nested-vars","description":"supports nested Sass-style variables.","keywords":null},{"url":"https:\/\/github.com\/bezoerb\/postcss-image-inliner","title":"postcss-image-inliner","description":"to inline local\/remote images.","keywords":null},{"url":"https:\/\/github.com\/kinday\/postcss-axis","title":"postcss-axis","description":"that adds shorthands for opposite properties","keywords":null},{"url":"https:\/\/github.com\/OEvgeny\/postcss-atroot","title":"postcss-atroot","description":" to place rules directly at the root node.","keywords":null},{"url":"https:\/\/github.com\/azat-io\/postcss-instagram","title":"postcss-instagram","description":" for adding Instagram filters to your photos.","keywords":null},{"url":"https:\/\/github.com\/azat-io\/postcss-responsive-images","title":"postcss-responsive-images","description":" making responsive images.","keywords":null},{"url":"https:\/\/github.com\/azat-io\/postcss-tatar-stylesheets","title":"postcss-tatar-stylesheets","description":"Tatar Style Sheets","keywords":null},{"url":"https:\/\/github.com\/SlexAxton\/css-colorguard","title":"colorguard","description":" that helps maintain a consistent color palette.","keywords":null}]
--------------------------------------------------------------------------------
/src/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamnewton/alfred-postcss-workflow/ab363299667a12694cff999e45bd8a54b1497d63/src/icon.png
--------------------------------------------------------------------------------
/src/postcss.php:
--------------------------------------------------------------------------------
1 | name;
13 | $url = $item->url;
14 | $description = $item->description;
15 | $keywords = join(',', $item->tags);
16 |
17 | $arr[] = array(
18 | "url" => $url,
19 | "title" => $title,
20 | "description" => $description,
21 | "keywords" => $tags
22 | );
23 | }
24 | if (count($arr)) {
25 | file_put_contents("data.json", json_encode($arr));
26 | }
27 | }
28 |
29 | if (!isset($query)) {
30 | $query = urlencode( "atcss" );
31 | }
32 |
33 | $data = json_decode(file_get_contents("data.json"));
34 |
35 | function registerResult($result) {
36 | global $w;
37 | $w->result( $result->title, $result->url, $result->title." ".$result->tags, $result->description, "icon.png" );
38 | return;
39 | }
40 |
41 | $found = array();
42 | $query = strtolower(trim($query));
43 |
44 | foreach ($data as $key => $result) {
45 | $value = strtolower(trim($result->title));
46 | $description = utf8_decode(strip_tags($result->description));
47 | $keywords = utf8_decode($result->keywords);
48 |
49 | if (strpos( $value, $query ) === 0) {
50 | if (!isset($found[$value])) {
51 | $found[$value] = true;
52 | registerResult($result);
53 | }
54 | }
55 | else if (strpos($value, $query) > 0) {
56 | if (!isset($found[$value])) {
57 | $found[$value] = true;
58 | registerResult($result);
59 | }
60 | }
61 | else if (strpos($keywords, $query) !== false) {
62 | if (!isset($found[$value])) {
63 | $found[$value] = true;
64 | registerResult($result);
65 | }
66 | }
67 | else if (strpos($description, $query) !== false) {
68 | if (!isset($found[$value])) {
69 | $found[$value] = true;
70 | registerResult($result);
71 | }
72 | }
73 | }
74 |
75 | echo $w->toxml();
76 | ?>
--------------------------------------------------------------------------------
/src/update.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.0",
3 | "remote_json": "https://raw.github.com/chrisopedia/alfred-postcss-workflow/master/current-version.json"
4 | }
5 |
--------------------------------------------------------------------------------
/src/workflows.php:
--------------------------------------------------------------------------------
1 | path = exec('pwd');
31 | $this->home = exec('printf $HOME');
32 |
33 | if ( file_exists( 'info.plist' ) ):
34 | $this->bundle = $this->get( 'bundleid', 'info.plist' );
35 | endif;
36 |
37 | if ( !is_null( $bundleid ) ):
38 | $this->bundle = $bundleid;
39 | endif;
40 |
41 | $this->cache = $this->home. "/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/".$this->bundle;
42 | $this->data = $this->home. "/Library/Application Support/Alfred 2/Workflow Data/".$this->bundle;
43 |
44 | if ( !file_exists( $this->cache ) ):
45 | exec("mkdir '".$this->cache."'");
46 | endif;
47 |
48 | if ( !file_exists( $this->data ) ):
49 | exec("mkdir '".$this->data."'");
50 | endif;
51 |
52 | $this->results = array();
53 | }
54 |
55 | /**
56 | * Description:
57 | * Accepts no parameter and returns the value of the bundle id for the current workflow.
58 | * If no value is available, then false is returned.
59 | *
60 | * @param none
61 | * @return false if not available, bundle id value if available.
62 | */
63 | public function bundle()
64 | {
65 | if ( is_null( $this->bundle ) ):
66 | return false;
67 | else:
68 | return $this->bundle;
69 | endif;
70 | }
71 |
72 | /**
73 | * Description:
74 | * Accepts no parameter and returns the value of the path to the cache directory for your
75 | * workflow if it is available. Returns false if the value isn't available.
76 | *
77 | * @param none
78 | * @return false if not available, path to the cache directory for your workflow if available.
79 | */
80 | public function cache()
81 | {
82 | if ( is_null( $this->bundle ) ):
83 | return false;
84 | else:
85 | if ( is_null( $this->cache ) ):
86 | return false;
87 | else:
88 | return $this->cache;
89 | endif;
90 | endif;
91 | }
92 |
93 | /**
94 | * Description:
95 | * Accepts no parameter and returns the value of the path to the storage directory for your
96 | * workflow if it is available. Returns false if the value isn't available.
97 | *
98 | * @param none
99 | * @return false if not available, path to the storage directory for your workflow if available.
100 | */
101 | public function data()
102 | {
103 | if ( is_null( $this->bundle ) ):
104 | return false;
105 | else:
106 | if ( is_null( $this->data ) ):
107 | return false;
108 | else:
109 | return $this->data;
110 | endif;
111 | endif;
112 | }
113 |
114 | /**
115 | * Description:
116 | * Accepts no parameter and returns the value of the path to the current directory for your
117 | * workflow if it is available. Returns false if the value isn't available.
118 | *
119 | * @param none
120 | * @return false if not available, path to the current directory for your workflow if available.
121 | */
122 | public function path()
123 | {
124 | if ( is_null( $this->path ) ):
125 | return false;
126 | else:
127 | return $this->path;
128 | endif;
129 | }
130 |
131 | /**
132 | * Description:
133 | * Accepts no parameter and returns the value of the home path for the current user
134 | * Returns false if the value isn't available.
135 | *
136 | * @param none
137 | * @return false if not available, home path for the current user if available.
138 | */
139 | public function home()
140 | {
141 | if ( is_null( $this->home ) ):
142 | return false;
143 | else:
144 | return $this->home;
145 | endif;
146 | }
147 |
148 | /**
149 | * Description:
150 | * Returns an array of available result items
151 | *
152 | * @param none
153 | * @return array - list of result items
154 | */
155 | public function results()
156 | {
157 | return $this->results;
158 | }
159 |
160 | /**
161 | * Description:
162 | * Convert an associative array into XML format
163 | *
164 | * @param $a - An associative array to convert
165 | * @param $format - format of data being passed (json or array), defaults to array
166 | * @return - XML string representation of the array
167 | */
168 | public function toxml( $a=null, $format='array' ) {
169 |
170 | if ( $format == 'json' ):
171 | $a = json_decode( $a, TRUE );
172 | endif;
173 |
174 | if ( is_null( $a ) && !empty( $this->results ) ):
175 | $a = $this->results;
176 | elseif ( is_null( $a ) && empty( $this->results ) ):
177 | return false;
178 | endif;
179 |
180 | $items = new SimpleXMLElement(" "); // Create new XML element
181 |
182 | foreach( $a as $b ): // Lop through each object in the array
183 | $c = $items->addChild( 'item' ); // Add a new 'item' element for each object
184 | $c_keys = array_keys( $b ); // Grab all the keys for that item
185 | foreach( $c_keys as $key ): // For each of those keys
186 | if ( $key == 'uid' ):
187 | $c->addAttribute( 'uid', $b[$key] );
188 | elseif ( $key == 'arg' ):
189 | $c->addAttribute( 'arg', $b[$key] );
190 | elseif ( $key == 'type' ):
191 | $c->addAttribute( 'type', $b[$key] );
192 | elseif ( $key == 'valid' ):
193 | if ( $b[$key] == 'yes' || $b[$key] == 'no' ):
194 | $c->addAttribute( 'valid', $b[$key] );
195 | endif;
196 | elseif ( $key == 'autocomplete' ):
197 | $c->addAttribute( 'autocomplete', $b[$key] );
198 | elseif ( $key == 'icon' ):
199 | if ( substr( $b[$key], 0, 9 ) == 'fileicon:' ):
200 | $val = substr( $b[$key], 9 );
201 | $c->$key = $val;
202 | $c->$key->addAttribute( 'type', 'fileicon' );
203 | elseif ( substr( $b[$key], 0, 9 ) == 'filetype:' ):
204 | $val = substr( $b[$key], 9 );
205 | $c->$key = $val;
206 | $c->$key->addAttribute( 'type', 'filetype' );
207 | else:
208 | $c->$key = $b[$key];
209 | endif;
210 | else:
211 | $c->$key = $b[$key];
212 | endif;
213 | endforeach;
214 | endforeach;
215 |
216 | return $items->asXML(); // Return XML string representation of the array
217 |
218 | }
219 |
220 | /**
221 | * Description:
222 | * Remove all items from an associative array that do not have a value
223 | *
224 | * @param $a - Associative array
225 | * @return bool
226 | */
227 | private function empty_filter( $a ) {
228 | if ( $a == '' || $a == null ): // if $a is empty or null
229 | return false; // return false, else, return true
230 | else:
231 | return true;
232 | endif;
233 | }
234 |
235 | /**
236 | * Description:
237 | * Save values to a specified plist. If the first parameter is an associative
238 | * array, then the second parameter becomes the plist file to save to. If the
239 | * first parameter is string, then it is assumed that the first parameter is
240 | * the label, the second parameter is the value, and the third parameter is
241 | * the plist file to save the data to.
242 | *
243 | * @param $a - associative array of values to save
244 | * @param $b - the value of the setting
245 | * @param $c - the plist to save the values into
246 | * @return string - execution output
247 | */
248 | public function set( $a=null, $b=null, $c=null )
249 | {
250 | if ( is_array( $a ) ):
251 | if ( file_exists( $b ) ):
252 | if ( file_exists( $this->path.'/'.$b ) ):
253 | $b = $this->path.'/'.$b;
254 | endif;
255 | elseif ( file_exists( $this->data."/".$b ) ):
256 | $b = $this->data."/".$b;
257 | elseif ( file_exists( $this->cache."/".$b ) ):
258 | $b = $this->cache."/".$b;
259 | else:
260 | $b = $this->data."/".$b;
261 | endif;
262 | else:
263 | if ( file_exists( $c ) ):
264 | if ( file_exists( $this->path.'/'.$c ) ):
265 | $c = $this->path.'/'.$c;
266 | endif;
267 | elseif ( file_exists( $this->data."/".$c ) ):
268 | $c = $this->data."/".$c;
269 | elseif ( file_exists( $this->cache."/".$c ) ):
270 | $c = $this->cache."/".$c;
271 | else:
272 | $c = $this->data."/".$c;
273 | endif;
274 | endif;
275 |
276 | if ( is_array( $a ) ):
277 | foreach( $a as $k => $v ):
278 | exec( 'defaults write "'. $b .'" '. $k .' "'. $v .'"');
279 | endforeach;
280 | else:
281 | exec( 'defaults write "'. $c .'" '. $a .' "'. $b .'"');
282 | endif;
283 | }
284 |
285 | /**
286 | * Description:
287 | * Read a value from the specified plist
288 | *
289 | * @param $a - the value to read
290 | * @param $b - plist to read the values from
291 | * @return bool false if not found, string if found
292 | */
293 | public function get( $a, $b ) {
294 |
295 | if ( file_exists( $b ) ):
296 | if ( file_exists( $this->path.'/'.$b ) ):
297 | $b = $this->path.'/'.$b;
298 | endif;
299 | elseif ( file_exists( $this->data."/".$b ) ):
300 | $b = $this->data."/".$b;
301 | elseif ( file_exists( $this->cache."/".$b ) ):
302 | $b = $this->cache."/".$b;
303 | else:
304 | return false;
305 | endif;
306 |
307 | exec( 'defaults read "'. $b .'" '.$a, $out ); // Execute system call to read plist value
308 |
309 | if ( $out == "" ):
310 | return false;
311 | endif;
312 |
313 | $out = $out[0];
314 | return $out; // Return item value
315 | }
316 |
317 | /**
318 | * Description:
319 | * Read data from a remote file/url, essentially a shortcut for curl
320 | *
321 | * @param $url - URL to request
322 | * @param $options - Array of curl options
323 | * @return result from curl_exec
324 | */
325 | public function request( $url=null, $options=null )
326 | {
327 | if ( is_null( $url ) ):
328 | return false;
329 | endif;
330 |
331 | $defaults = array( // Create a list of default curl options
332 | CURLOPT_RETURNTRANSFER => true, // Returns the result as a string
333 | CURLOPT_URL => $url, // Sets the url to request
334 | CURLOPT_FRESH_CONNECT => true
335 | );
336 |
337 | if ( $options ):
338 | foreach( $options as $k => $v ):
339 | $defaults[$k] = $v;
340 | endforeach;
341 | endif;
342 |
343 | array_filter( $defaults, // Filter out empty options from the array
344 | array( $this, 'empty_filter' ) );
345 |
346 | $ch = curl_init(); // Init new curl object
347 | curl_setopt_array( $ch, $defaults ); // Set curl options
348 | $out = curl_exec( $ch ); // Request remote data
349 | $err = curl_error( $ch );
350 | curl_close( $ch ); // End curl request
351 |
352 | if ( $err ):
353 | return $err;
354 | else:
355 | return $out;
356 | endif;
357 | }
358 |
359 | /**
360 | * Description:
361 | * Allows searching the local hard drive using mdfind
362 | *
363 | * @param $query - search string
364 | * @return array - array of search results
365 | */
366 | public function mdfind( $query )
367 | {
368 | exec('mdfind "'.$query.'"', $results);
369 | return $results;
370 | }
371 |
372 | public function delete( $a )
373 | {
374 | if ( file_exists( $a ) ):
375 | if ( file_exists( $this->path.'/'.$a ) ):
376 | unlink($this->path.'/'.$a);
377 | endif;
378 | elseif ( file_exists( $this->data."/".$a ) ):
379 | unlink($this->data."/".$a);
380 | elseif ( file_exists( $this->cache."/".$a ) ):
381 | unlink($this->cache."/".$a);
382 | endif;
383 | }
384 |
385 | /**
386 | * Description:
387 | * Accepts data and a string file name to store data to local file as cache
388 | *
389 | * @param array - data to save to file
390 | * @param file - filename to write the cache data to
391 | * @return none
392 | */
393 | public function write( $a, $b )
394 | {
395 | if ( file_exists( $b ) ):
396 | if ( file_exists( $this->path.'/'.$b ) ):
397 | $b = $this->path.'/'.$b;
398 | endif;
399 | elseif ( file_exists( $this->data."/".$b ) ):
400 | $b = $this->data."/".$b;
401 | elseif ( file_exists( $this->cache."/".$b ) ):
402 | $b = $this->cache."/".$b;
403 | else:
404 | $b = $this->data."/".$b;
405 | endif;
406 |
407 | if ( is_array( $a ) ):
408 | $a = json_encode( $a );
409 | file_put_contents( $b, $a );
410 | return true;
411 | elseif ( is_string( $a ) ):
412 | file_put_contents( $b, $a );
413 | return true;
414 | else:
415 | return false;
416 | endif;
417 | }
418 |
419 | /**
420 | * Description:
421 | * Returns data from a local cache file
422 | *
423 | * @param file - filename to read the cache data from
424 | * @return false if the file cannot be found, the file data if found. If the file
425 | * format is json encoded, then a json object is returned.
426 | */
427 | public function read( $a )
428 | {
429 | if ( file_exists( $a ) ):
430 | if ( file_exists( $this->path.'/'.$a ) ):
431 | $a = $this->path.'/'.$a;
432 | endif;
433 | elseif ( file_exists( $this->data."/".$a ) ):
434 | $a = $this->data."/".$a;
435 | elseif ( file_exists( $this->cache."/".$a ) ):
436 | $a = $this->cache."/".$a;
437 | else:
438 | return false;
439 | endif;
440 |
441 | $out = file_get_contents( $a );
442 | if ( !is_null( json_decode( $out ) ) ):
443 | $out = json_decode( $out );
444 | endif;
445 |
446 | return $out;
447 | }
448 |
449 | public function filetime( $a )
450 | {
451 | if ( file_exists( $a ) ):
452 | if ( file_exists( $this->path.'/'.$a ) ):
453 | return filemtime($this->path.'/'.$a);
454 | endif;
455 | elseif ( file_exists( $this->data."/".$a ) ):
456 | return filemtime($this->data.'/'.$a);
457 | elseif ( file_exists( $this->cache."/".$a ) ):
458 | return filemtime($this->cache.'/'.$a);
459 | endif;
460 |
461 | return false;
462 | }
463 |
464 | /**
465 | * Description:
466 | * Helper function that just makes it easier to pass values into a function
467 | * and create an array result to be passed back to Alfred
468 | *
469 | * @param $uid - the uid of the result, should be unique
470 | * @param $arg - the argument that will be passed on
471 | * @param $title - The title of the result item
472 | * @param $sub - The subtitle text for the result item
473 | * @param $icon - the icon to use for the result item
474 | * @param $valid - sets whether the result item can be actioned
475 | * @param $auto - the autocomplete value for the result item
476 | * @return array - array item to be passed back to Alfred
477 | */
478 | public function result( $uid, $arg, $title, $sub, $icon, $valid='yes', $auto=null, $type=null )
479 | {
480 | $temp = array(
481 | 'uid' => $uid,
482 | 'arg' => $arg,
483 | 'title' => $title,
484 | 'subtitle' => $sub,
485 | 'icon' => $icon,
486 | 'valid' => $valid,
487 | 'autocomplete' => $auto,
488 | 'type' => $type
489 | );
490 |
491 | if ( is_null( $type ) ):
492 | unset( $temp['type'] );
493 | endif;
494 |
495 | array_push( $this->results, $temp );
496 |
497 | return $temp;
498 | }
499 |
500 | }
--------------------------------------------------------------------------------