Skip to content

Commit

Permalink
chore(): update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Oct 10, 2019
1 parent 4991903 commit e45962d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 30 deletions.
38 changes: 15 additions & 23 deletions package.json
Expand Up @@ -25,18 +25,20 @@
},
"devDependencies": {
"@stencil/core": "1.0.2",
"@types/jest": "^24.0.15",
"@types/node": "^12.0.10",
"@types/sass": "^1.16.0",
"jest": "^24.7.1",
"np": "^5.0.3",
"rimraf": "^2.6.3",
"rollup": "^1.16.2",
"rollup-plugin-node-resolve": "^5.0.4",
"sass": "^1.19.0",
"tslint": "^5.16.0",
"tslint-ionic-rules": "0.0.19",
"typescript": "^3.5.2"
"@types/jest": "^24.0.18",
"@types/node": "12.7.12",
"@types/sass": "1.16.0",
"jest": "24.9.0",
"np": "5.1.1",
"rimraf": "^3.0.0",
"rollup": "^1.23.1",
"rollup-plugin-node-resolve": "^5.2.0",
"sass": "1.23.0",
"terser": "^4.3.8",
"ts-jest": "^24.1.0",
"tslint": "5.20.0",
"tslint-ionic-rules": "0.0.21",
"typescript": "3.6.4"
},
"repository": {
"type": "git",
Expand All @@ -50,17 +52,7 @@
"sass"
],
"jest": {
"transform": {
"^.+\\.(js|ts|tsx)$": "<rootDir>/test/jest.preprocessor.js"
},
"testRegex": "(\\.(test|spec))\\.(tsx?|jsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json",
"jsx"
],
"preset": "ts-jest",
"testURL": "http://localhost"
}
}
9 changes: 5 additions & 4 deletions rollup.plugin.sass.js
@@ -1,4 +1,5 @@
import * as path from 'path';
import { minify } from 'terser';

export default function() {
const sassFilePath = path.join(__dirname, 'node_modules', 'sass', 'sass.dart.js');
Expand Down Expand Up @@ -60,14 +61,14 @@ const render = Sass.render;
export { render };
`;

if (code.indexOf('!global.window') === -1) {
if (code.indexOf('dartNodePreambleSelf.window') === -1) {
// in jest environments, global.window DOES exist
// which messes with sass's file path resolving on node
// remove global.window check to force it to know we're on node
throw new Error('cannot find "!global.window" in sass.dart');
throw new Error('cannot find "dartNodePreambleSelf.window" in sass.dart');
}

code = code.replace('!global.window', 'true /** NODE ENVIRONMENT **/');

code = code.replace('dartNodePreambleSelf.window', 'false /** NODE ENVIRONMENT **/');
code = minify(code, {module: true}).code;
return code
}
2 changes: 1 addition & 1 deletion test/build.spec.ts
Expand Up @@ -53,7 +53,7 @@ describe('test build', () => {
const sourceText = fs.readFileSync(filePath, 'utf8');
const s = sass();

const results = await s.transform(sourceText, filePath, context);
await s.transform(sourceText, filePath, context);
expect(context.diagnostics).toHaveLength(1);
expect(context.diagnostics[0].level).toEqual('error');
expect(context.diagnostics[0].language).toEqual('scss');
Expand Down
4 changes: 2 additions & 2 deletions test/utils.spec.ts
Expand Up @@ -11,9 +11,9 @@ describe('getRenderOptions', () => {
rootDir: '/Users/my/app/',
srcDir: '/Users/my/app/src/',
},
fs: {},
fs: {} as any,
diagnostics: []
};
} as any;


it('should remove "file" config', () => {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -8,6 +8,7 @@
"es2015",
"dom"
],
"esModuleInterop": true,
"module": "es2015",
"moduleResolution": "node",
"noImplicitAny": true,
Expand Down

0 comments on commit e45962d

Please sign in to comment.