Skip to content

Commit

Permalink
fix: sass
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkycocho committed Oct 9, 2023
1 parent 015350a commit ddaae92
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 51 deletions.
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion development/build/sass-compiler.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const sass = require('sass');

const bridgeJson = (target) => JSON.parse(JSON.stringify(target))
const bridgeFn = (target) => ((...args) => target(...args))

module.exports = {
render: (opts, callback) => {
// sass wants its arguments to come from the same Realm as itself
// bridgeJson and bridgeFn are added via patch-package to make this possible
sass.render(sass.bridgeJson(opts), sass.bridgeFn(callback));
sass.render(bridgeJson(opts), bridgeFn(callback));
},
renderSync: () => {
throw new Error('sass-wrapper - renderSync not supported');
Expand Down
2 changes: 1 addition & 1 deletion development/build/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function createStyleTasks({ livereload }) {
async function buildScssPipeline(src, dest, devMode, rtl) {
if (!sass) {
// eslint-disable-next-line node/global-require
sass = require('gulp-sass');
sass = require('gulp-sass')(require('sass'));
// use our own compiler which runs sass in its own process
// in order to not pollute the intrinsics
// eslint-disable-next-line node/global-require
Expand Down
1 change: 1 addition & 0 deletions development/build/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function runInChildProcess(task) {
await new Promise((resolve, reject) => {
childProcess.once('close', (errCode) => {
if (errCode !== 0) {
console.log(errCode, 'erroce')
reject(
new Error(
`StarMask build: runInChildProcess for task "${taskName}" encountered an error ${errCode}`,
Expand Down
4 changes: 1 addition & 3 deletions lavamoat/node/policy-override.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"resources": {
"node-sass": {
"native": true
},

"module-deps": {
"packages": {
"loose-envify": true
Expand Down
40 changes: 0 additions & 40 deletions lavamoat/node/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2263,7 +2263,6 @@
"packages": {
"chalk": true,
"lodash": true,
"node-sass": true,
"plugin-error": true,
"replace-ext": true,
"strip-ansi": true,
Expand Down Expand Up @@ -2925,45 +2924,6 @@
"setTimeout": true
}
},
"node-sass": {
"builtin": {
"fs.existsSync": true,
"fs.readFileSync": true,
"fs.readdirSync": true,
"os.EOL": true,
"path.delimiter": true,
"path.join": true,
"path.resolve": true
},
"globals": {
"__dirname": true,
"console.log": true,
"process.arch": true,
"process.argv.slice": true,
"process.cwd": true,
"process.env.SASS_BINARY_DIR": true,
"process.env.SASS_BINARY_NAME": true,
"process.env.SASS_BINARY_PATH": true,
"process.env.SASS_BINARY_SITE": true,
"process.env.SASS_PATH.split": true,
"process.env.hasOwnProperty": true,
"process.env.npm_config_cache": true,
"process.env.npm_config_sass_binary_cache": true,
"process.env.npm_config_sass_binary_dir": true,
"process.env.npm_config_sass_binary_name": true,
"process.env.npm_config_sass_binary_path": true,
"process.env.npm_config_sass_binary_site": true,
"process.execPath": true,
"process.platform": true,
"process.sass": "write",
"process.versions.modules": true
},
"packages": {
"lodash": true,
"mkdirp": true,
"true-case-path": true
}
},
"normalize-path": {
"packages": {
"remove-trailing-separator": true
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"abortcontroller-polyfill": "^1.4.0",
"analytics-node": "^3.4.0-beta.3",
"await-semaphore": "^0.1.1",
"bignumber.js": "^4.1.0",
"bignumber.js": "^9.1.2",
"bn.js": "^4.11.7",
"classnames": "^2.2.6",
"content-hash": "^2.5.2",
Expand Down Expand Up @@ -105,7 +105,6 @@
"loglevel": "^1.4.1",
"luxon": "^1.24.1",
"nanoid": "^2.1.6",
"node-sass": "^9.0.0",
"nonce-tracker": "^1.0.0",
"obj-multiplex": "^1.0.0",
"pify": "^5.0.0",
Expand Down Expand Up @@ -142,7 +141,7 @@
"textarea-caret": "^3.0.1",
"unicode-confusables": "^0.1.1",
"valid-url": "^1.0.9",
"web3": "^0.20.7",
"web3": "^4.1.2",
"web3-stream-provider": "^4.0.0",
"webextension-polyfill": "^0.8.0"
},
Expand Down Expand Up @@ -205,7 +204,7 @@
"gulp-livereload": "^4.0.0",
"gulp-rename": "^2.0.0",
"gulp-rtlcss": "^1.4.0",
"gulp-sass": "^4.1.0",
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^2.6.0",
"gulp-stylelint": "^13.0.0",
"gulp-terser-js": "^5.2.2",
Expand All @@ -214,7 +213,7 @@
"jsdom": "^11.2.0",
"koa": "^2.7.0",
"lavamoat": "^5.1.4",
"lavamoat-viz": "^6.0.4",
"lavamoat-viz": "^6.2.1",
"lockfile-lint": "^4.0.0",
"loose-envify": "^1.4.0",
"mocha": "^7.2.0",
Expand Down Expand Up @@ -252,7 +251,6 @@
},
"lavamoat": {
"allowScripts": {
"node-sass": true,
"chromedriver": true,
"geckodriver": true,
"@sentry/cli": true,
Expand Down

0 comments on commit ddaae92

Please sign in to comment.