Skip to content

Commit

Permalink
chore: up chalk to 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux authored and mgermerie committed May 25, 2022
1 parent 3dac8b9 commit 1a30d66
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 32 deletions.
18 changes: 11 additions & 7 deletions config/prepare.js → config/prepare.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const chalk = require('chalk');
const { execSync } = require('child_process');
import chalk from 'chalk';
import copyfiles from 'copyfiles';
// const chalk = require('chalk');
import { execSync } from 'child_process';
import threeExamples from './threeExamples.mjs';



// Verify Puppeteer configuration
const pupSkip = process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD;
Expand Down Expand Up @@ -29,12 +34,11 @@ if (npmVersion) {
console.log(chalk.green('Npm version :', npmVersion), '\n');
}

// Copy and patch THREE Examples Files
const copyfiles = require('copyfiles');
const { filesExamples, patchedPath } = require('./threeExamples.js');

const paths = filesExamples.map(f => f.replace('./', './node_modules/three/examples/jsm/'));

paths.push(patchedPath);
// Copy and patch THREE Examples Files
const paths = threeExamples.filesExamples.map(f => f.replace('./', './node_modules/three/examples/jsm/'));

paths.push(threeExamples.patchedPath);

copyfiles(paths, { up: 4 }, () => {});
10 changes: 5 additions & 5 deletions config/replace.config.js → config/replace.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const replace = require('replace-in-file');
const path = require('path');
const chalk = require('chalk');
const { patchedPath } = require('./threeExamples');
import chalk from 'chalk';
import replace from 'replace-in-file';
import path from 'path';
import threeExamples from './threeExamples.mjs';

const fileGLTFLoader = path.resolve(__dirname.replace('config', ''), patchedPath, './loaders/GLTFLoader.js');
const fileGLTFLoader = path.resolve(path.dirname('./').replace('config', ''), threeExamples.patchedPath, './loaders/GLTFLoader.js');

// Patch _BATCHID in GLTFLoader
const patchBatchID = /JOINTS_0: +'skinIndex',/g;
Expand Down
2 changes: 1 addition & 1 deletion config/threeExamples.js → config/threeExamples.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
patchedPath: './src/ThreeExtended/',
filesExamples: [
'./loaders/GLTFLoader.js',
Expand Down
134 changes: 117 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"start": "cross-env NODE_ENV=development webpack serve",
"debug": "cross-env noInline=true npm start",
"prepublishOnly": "npm run build && npm run transpile",
"prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.js && node ./config/replace.config.js",
"prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.mjs && node ./config/replace.config.mjs",
"watch": "cross-env BABEL_DISABLE_CACHE=1 babel --watch src --out-dir lib",
"changelog": "conventional-changelog -n ./config/conventionalChangelog/config.js -i changelog.md -s",
"bump": "if [ -z $npm_config_level ]; then grunt bump:minor; else grunt bump:$npm_config_level; fi && npm run changelog && git add -A && git commit --amend --no-edit"
Expand Down Expand Up @@ -79,7 +79,7 @@
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-minify-replace": "^0.5.0",
"babel-plugin-module-resolver": "^4.1.0",
"chalk": "^4.1.2",
"chalk": "^5.0.1",
"chart.js": "^3.7.1",
"compare-func": "^2.0.0",
"conventional-changelog-cli": "^2.2.2",
Expand Down

0 comments on commit 1a30d66

Please sign in to comment.