-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge origin and fix conflicts
- Loading branch information
Showing
17 changed files
with
194 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,42 @@ orbs: | |
node: circleci/[email protected] | ||
|
||
jobs: | ||
install_tests: | ||
docker: | ||
- image: cimg/node:17.2.0 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: Restoring Modules Cache | ||
keys: | ||
- v1-modules-cache-{{ checksum "package-lock.json" }} | ||
- node/install-packages: | ||
pkg-manager: npm | ||
- run: | ||
command: | | ||
cd ./example-site/ | ||
node ./../src/cli.js install | ||
name: Run test - install projects | ||
- run: | ||
command: | | ||
cd ./example-site/ | ||
node ./../src/cli.js install -- --package-lock-only | ||
name: Run test - install projects with npm args | ||
- run: | ||
command: | | ||
cd ./example-site/ | ||
node ./../src/cli.js ci | ||
name: Run test - ci install projects | ||
- save_cache: | ||
name: Saving Modules Cache | ||
key: v1-modules-cache-{{ checksum "package-lock.json" }} | ||
paths: | ||
- ./node_modules | ||
- /home/circleci/.cache | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- . | ||
notify_slack: | ||
docker: | ||
- image: cimg/node:17.2.0 | ||
|
@@ -64,6 +100,11 @@ jobs: | |
cd ./example-site/ | ||
node ./../src/cli.js ci | ||
name: Run test - ci install projects | ||
- run: | ||
command: | | ||
cd ./example-site/ | ||
node ./../src/cli.js ci | ||
name: Run test - ci install projects | ||
- run: | ||
command: | | ||
cd ./example-site/ | ||
|
@@ -84,7 +125,10 @@ jobs: | |
paths: | ||
- . | ||
workflows: | ||
test_build_tools: | ||
test_install: | ||
jobs: | ||
- install_tests | ||
test_build: | ||
jobs: | ||
- install_tests | ||
- self_test | ||
|
4 changes: 4 additions & 0 deletions
4
example-site/client-mu-plugins/test-client-plugin/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"name": "test-client-plugin" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"name": "test-plugin" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('test frontend'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"name": "test-theme" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@bigbite/build-tools", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Provides configuration for the Big Bite Build Tools.", | ||
"author": "Paul Taylor <[email protected]> (https://github.com/ampersarnie)", | ||
"keywords": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const installer = require('./installer/installer'); | ||
|
||
exports.command = 'ci'; | ||
exports.desc = 'Run an npm ci install process.'; | ||
exports.builder = (yargs) => {}; | ||
|
||
exports.handler = async ({}) => { | ||
installer(exports.command); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const installer = require('./installer/installer'); | ||
|
||
exports.command = 'install'; | ||
exports.desc = 'Run an npm install process.'; | ||
exports.builder = (yargs) => {}; | ||
|
||
exports.handler = async ({}) => { | ||
installer(exports.command); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const { terminal } = require('terminal-kit'); | ||
const { execSync } = require('child_process'); | ||
const yargs = require('yargs'); | ||
const args = yargs.argv._; | ||
|
||
const { findAllProjectPaths } = require('./../../utils/projectpaths'); | ||
const { getPackage } = require('./../../utils/get-package'); | ||
const dirsExist = require('./../../utils/dirs-exist'); | ||
|
||
module.exports = (commandType) => { | ||
if (!['ci', 'install'].includes(commandType)) { | ||
throw new Error('Not a valid comment type.'); | ||
} | ||
|
||
const hasTargetDirs = dirsExist(targetDirs); | ||
|
||
if (!hasTargetDirs) { | ||
throw new Error('Recursive install only works from the site root directory.'); | ||
} | ||
|
||
let paths = findAllProjectPaths(targetDirs); | ||
|
||
let packages = []; | ||
|
||
try { | ||
packages = paths.map((item) => getPackage(item, false)).filter((item) => item); | ||
} catch (e) { | ||
terminal.red(e); | ||
process.exit(1); | ||
} | ||
|
||
terminal('Installing packages for the following projects:\n'); | ||
packages.forEach((package) => { | ||
terminal.defaultColor(` * %s `, package.name).dim(`[%s]\n`, package.relativePath); | ||
}); | ||
terminal('\n'); | ||
|
||
const gluedArgs = args.join(' '); | ||
|
||
packages.forEach((package) => { | ||
terminal | ||
.defaultColor(`Installing packages for `) | ||
.bold(`%s`, package.name) | ||
.dim(` [%s]\n`, package.relativePath); | ||
execSync(`npm ${gluedArgs}`, { cwd: package.path, stdio: 'inherit' }); | ||
terminal.defaultColor('\n\n----------------------\n\n'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
global.targetDirs = ['client-mu-plugins', 'plugins', 'themes']; | ||
global.packageList = {}; |
Oops, something went wrong.