Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dependents/node-precinct
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 369047d1390b42d5b14ae1942a0a1631cb05eb8a
Choose a base ref
...
head repository: dependents/node-precinct
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 26d7a4c449f7d321621bc1742643f6e2725dc88e
Choose a head ref
  • 11 commits
  • 7 files changed
  • 3 contributors

Commits on Jan 7, 2018

  1. Bump TS

    mrjoelkemp committed Jan 7, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    hyoban Stephen Zhou
    Copy the full SHA
    3b18d6b View commit details
  2. Copy the full SHA
    34cd9a7 View commit details
  3. Merge pull request #38 from dependents/bump_typescript

    Bump TS to 2
    mrjoelkemp authored Jan 7, 2018

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    7251ccd View commit details
  4. 4.0.0

    mrjoelkemp committed Jan 7, 2018
    Copy the full SHA
    e886f1d View commit details

Commits on Jan 21, 2018

  1. chore: update devDependencies and detective-less to 1.0.1. check in p…

    …ackage-lock
    Karthik K committed Jan 21, 2018
    Copy the full SHA
    599bde7 View commit details
  2. Merge pull request #39 from akkumar/update_versions

    chore: update devDependencies.
    mrjoelkemp authored Jan 21, 2018
    Copy the full SHA
    ab7f601 View commit details

Commits on Apr 12, 2018

  1. Copy the full SHA
    c93a1a8 View commit details
  2. add CSS to list

    joscha committed Apr 12, 2018
    Copy the full SHA
    bec9b5e View commit details
  3. paperwork test

    joscha committed Apr 12, 2018
    Copy the full SHA
    5068a88 View commit details
  4. Merge pull request #40 from joscha/joscha/postcss

    feat: add CSS (PostCSS dialect)
    mrjoelkemp authored Apr 12, 2018
    Copy the full SHA
    6553f16 View commit details
  5. 4.1.0

    mrjoelkemp committed Apr 12, 2018
    Copy the full SHA
    26d7a4c View commit details
Showing with 1,786 additions and 11 deletions.
  1. +3 −1 .travis.yml
  2. +1 −0 Readme.md
  3. +5 −1 index.js
  4. +1,754 −0 package-lock.json
  5. +12 −8 package.json
  6. +7 −1 test/index.js
  7. +4 −0 test/styles.css
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- "0.10"
- 6
- 7
- 8

notifications:
email: false
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ Supports:
* JavaScript modules: AMD, CommonJS, and ES6.
* Typescript
* CSS Preprocessors: Sass, Stylus, and Less
* CSS (PostCSS)

### Usage

6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ var detectiveCjs = require('detective-cjs');
var detectiveAmd = require('detective-amd');
var detectiveEs6 = require('detective-es6');
var detectiveLess = require('detective-less');
var detectivePostcss = require('detective-postcss');
var detectiveSass = require('detective-sass');
var detectiveScss = require('detective-scss');
var detectiveStylus = require('detective-stylus');
@@ -71,6 +72,9 @@ function precinct(content, options) {
case 'commonjs':
theDetective = mixedMode ? detectiveEs6Cjs : detectiveCjs;
break;
case 'css':
theDetective = detectivePostcss;
break;
case 'amd':
theDetective = detectiveAmd;
break;
@@ -137,7 +141,7 @@ precinct.paperwork = function(filename, options) {
var ext = path.extname(filename);
var type;

if (ext === '.scss' || ext === '.sass' || ext === '.less' || ext === '.ts') {
if (ext === '.css' || ext === '.scss' || ext === '.sass' || ext === '.less' || ext === '.ts') {
type = ext.replace('.', '');

} else if (ext === '.styl') {
1,754 changes: 1,754 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "precinct",
"version": "3.8.0",
"version": "4.1.0",
"description": "Unleash the detectives",
"main": "index.js",
"scripts": {
@@ -28,26 +28,30 @@
"bugs": {
"url": "https://github.com/mrjoelkemp/node-precinct/issues"
},
"engines": {
"node": ">=6.0.0"
},
"homepage": "https://github.com/mrjoelkemp/node-precinct",
"dependencies": {
"commander": "^2.11.0",
"debug": "^3.0.1",
"detective-amd": "^2.4.0",
"detective-cjs": "^2.0.0",
"detective-es6": "^1.2.0",
"detective-less": "1.0.0",
"detective-less": "^1.0.1",
"detective-postcss": "^2.0.0",
"detective-sass": "^2.0.0",
"detective-scss": "^1.0.0",
"detective-stylus": "^1.0.0",
"detective-typescript": "^1.0.0",
"detective-typescript": "^2.0.0",
"module-definition": "^2.2.4",
"node-source-walk": "^3.3.0"
},
"devDependencies": {
"jscs": "~2.11.0",
"jscs-preset-mrjoelkemp": "~1.0.0",
"mocha": "~2.0.1",
"rewire": "~2.5.2",
"sinon": "^1.17.6"
"jscs": "~3.0.7",
"jscs-preset-mrjoelkemp": "~2.0.0",
"mocha": "~5.0.0",
"rewire": "~3.0.2",
"sinon": "^4.1.6"
}
}
8 changes: 7 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -74,12 +74,17 @@ describe('node-precinct', function() {
assert(cjs.length === 0);
});

it('grabs dependencies of css files', function() {
var css = precinct(read('styles.css'), 'css');
assert.deepEqual(css, ['foo.css', 'baz.css', 'bla.css', 'another.css']);
});

it('grabs dependencies of scss files', function() {
var scss = precinct(read('styles.scss'), 'scss');
assert.deepEqual(scss, ['_foo', 'baz.scss']);
});

it('grabs dependencies of scss files', function() {
it('grabs dependencies of sass files', function() {
var sass = precinct(read('styles.sass'), 'sass');
assert.deepEqual(sass, ['_foo']);
});
@@ -151,6 +156,7 @@ describe('node-precinct', function() {
assert.ok(precinct.paperwork(__dirname + '/es6.js').length);
assert.ok(precinct.paperwork(__dirname + '/styles.scss').length);
assert.ok(precinct.paperwork(__dirname + '/typescript.ts').length);
assert.ok(precinct.paperwork(__dirname + '/styles.css').length);
});

it('throws if the file cannot be found', function() {
4 changes: 4 additions & 0 deletions test/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "foo.css";
@import url("baz.css");
@value a from 'bla.css';
@value a, b as x from url(another.css);