Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update packages #15

Closed
wants to merge 1 commit into from
Closed

Update packages #15

wants to merge 1 commit into from

Conversation

yvbeek
Copy link

@yvbeek yvbeek commented Jun 11, 2019

I've updated the dependencies and ran the tests.
This should fix the flatten dependency warning.

@yvbeek
Copy link
Author

yvbeek commented Jun 12, 2019

Hmmm, it turns out the tests fail.

I'm trying to upgrade the code for the newer postcss-values-parser version. But I have no clue why the test command keeps failing:

> postcss-color-gray@5.0.0 test:tape /Users/Z/Projects/PostCSS-Color-Gray
> postcss-tape

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! postcss-color-gray@5.0.0 test:tape: `postcss-tape`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the postcss-color-gray@5.0.0 test:tape script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Z/.npm/_logs/2019-06-12T01_27_09_403Z-debug.log

The log file contains:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/Cellar/node/12.4.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'test:tape'
1 verbose cli ]
2 info using npm@6.9.0
3 info using node@v12.4.0
4 verbose run-script [ 'pretest:tape', 'test:tape', 'posttest:tape' ]
5 info lifecycle postcss-color-gray@5.0.0~pretest:tape: postcss-color-gray@5.0.0
6 info lifecycle postcss-color-gray@5.0.0~test:tape: postcss-color-gray@5.0.0
7 verbose lifecycle postcss-color-gray@5.0.0~test:tape: unsafe-perm in lifecycle true
8 verbose lifecycle postcss-color-gray@5.0.0~test:tape: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Z/Projects/PostCSS-Color-Gray/node_modules/.bin:/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Z/Projects/PostCSS-Color-Gray/node_modules/.bin:/Users/Z/.rbenv/shims:/usr/local/opt/python/libexec/bin:/usr/local/sbin:/usr/local/bin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands
9 verbose lifecycle postcss-color-gray@5.0.0~test:tape: CWD: /Users/Z/Projects/PostCSS-Color-Gray
10 silly lifecycle postcss-color-gray@5.0.0~test:tape: Args: [ '-c', 'postcss-tape' ]
11 silly lifecycle postcss-color-gray@5.0.0~test:tape: Returned: code: 1  signal: null
12 info lifecycle postcss-color-gray@5.0.0~test:tape: Failed to exec test:tape script
13 verbose stack Error: postcss-color-gray@5.0.0 test:tape: `postcss-tape`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:200:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:200:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid postcss-color-gray@5.0.0
15 verbose cwd /Users/Z/Projects/PostCSS-Color-Gray
16 verbose Darwin 18.6.0
17 verbose argv "/usr/local/Cellar/node/12.4.0/bin/node" "/usr/local/bin/npm" "run" "test:tape"
18 verbose node v12.4.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error postcss-color-gray@5.0.0 test:tape: `postcss-tape`
22 error Exit status 1
23 error Failed at the postcss-color-gray@5.0.0 test:tape script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

The log seems to indicate that the tests exit with status 1, but it doesn't provide any useful information on what is going wrong 😒

The part of the code that is incompatible with the new version of postcss-values-parser is the appending of commas and numbers e.g. // replace the contents of rgb with (r,g,b)

Amongst a few other changes, I think the code can be changed from:

// replace the contents of rgb with `(r,g,b`
.append(openingSlash)
.append(parser.number({ value: r }))
.append(parser.comma({ value: ',' }))
.append(parser.number({ value: g }))
.append(parser.comma({ value: ',' }))
.append(parser.number({ value: b }))

to

import Numeric from 'postcss-values-parser/lib/nodes/Numeric';
import Punctuation from 'postcss-values-parser/lib/nodes/Punctuation';
// replace the contents of rgb with `(r,g,b`
.append(openingSlash)
.append(new Numeric({ value: r }))
.append(new Punctuation({ value: ',' }))
.append(new Numeric({ value: g }))
.append(new Punctuation({ value: ',' }))
.append(new Numeric({ value: b }));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant