Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
*: bump to v0.4.4; scripts: fix windows spawning
Browse files Browse the repository at this point in the history
  • Loading branch information
Cretezy committed Mar 20, 2018
1 parent 11f54a0 commit 0f6a90f
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 33 deletions.
4 changes: 2 additions & 2 deletions packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/Cretezy/Noderize.git"
},
"version": "0.4.3",
"version": "0.4.4",
"license": "MIT",
"bin": "dist/index.js",
"files": ["src", "dist", "template"],
Expand All @@ -22,7 +22,7 @@
"prepack": "npm run clean && npm run build -- --env production"
},
"dependencies": {
"@noderize/runtime": "^0.4.3",
"@noderize/runtime": "^0.4.4",
"chalk": "^2.3.1",
"fs-extra": "^5.0.0",
"minimist": "^1.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/Cretezy/Noderize.git"
},
"version": "0.4.3",
"version": "0.4.4",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.0.0-beta.40"
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(process.argv)
11 changes: 7 additions & 4 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"type": "git",
"url": "https://github.com/Cretezy/Noderize.git"
},
"version": "0.4.3",
"version": "0.4.4",
"license": "MIT",
"bin": { "noderize-scripts": "dist/index.js" },
"bin": {
"noderize-scripts": "dist/index.js"
},
"files": ["src", "dist"],
"scripts": {
"scripts": "node -r source-map-support/register dist/index.js",
Expand All @@ -23,20 +25,21 @@
"rm -rf dist && noderize-scripts build --env production && npm run build -- --env production"
},
"dependencies": {
"@noderize/runtime": "^0.4.3",
"@babel/core": "^7.0.0-beta.40",
"@babel/plugin-proposal-decorators": "^7.0.0-beta.40",
"@babel/plugin-transform-runtime": "^7.0.0-beta.40",
"@babel/polyfill": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/preset-flow": "^7.0.0-beta.40",
"@babel/preset-stage-2": "^7.0.0-beta.40",
"@noderize/runtime": "^0.4.4",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^22.2.2",
"babel-loader": "^8.0.0-beta.0",
"chalk": "^2.3.1",
"chokidar": "^2.0.2",
"cosmiconfig": "^4.0.0",
"cross-spawn": "^6.0.5",
"fork-ts-checker-webpack-plugin": "^0.3.0",
"fs-extra": "^5.0.0",
"happypack": "^4.0.1",
Expand All @@ -55,7 +58,7 @@
"webpack-node-externals": "^1.6.0"
},
"devDependencies": {
"@noderize/scripts": "0.4.2"
"@noderize/scripts": "0.4.3"
},
"noderize": {
"bundles": [
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ if (!Object.keys(commands).includes(script)) {
printWarn(`Unknown script.`);
process.exit(1);
} else {
commands[script](args);
commands[script](args, process.argv);
}
15 changes: 10 additions & 5 deletions packages/scripts/src/scripts/format.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import path from "path";
import { getOptions } from "../options";
import { appDirectory } from "../utils/path";
import { fork } from "child_process";
import spawn from "cross-spawn";
import { printInfo, printWarn, printDone } from "../utils/print";

export default async args => {
export default async (args, fullArgs) => {
printInfo("Formatting...");

const options = getOptions(null);
Expand All @@ -22,9 +22,14 @@ export default async args => {
"prettier"
);

const child = fork(prettierPath, ["--write", ...files, ...args], {
cwd: appDirectory
});
const child = spawn(
fullArgs[0],
[prettierPath, "--write", ...files, ...args],
{
cwd: appDirectory,
stdio: "inherit"
}
);

child.on("exit", code => {
const message = "Done formatting!";
Expand Down
10 changes: 6 additions & 4 deletions packages/scripts/src/scripts/start.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fork } from "child_process";
import spawn from "cross-spawn";
import { getOptions } from "../options";
import { printError, printInfo, printWarn } from "../utils/print";
import fs from "fs-extra";
Expand All @@ -7,7 +7,7 @@ export default async args => {
await start(getOptions(args));
};

export async function start(options) {
export async function start(options, nodePath = process.argv[0]) {
printInfo("Starting...");
console.log(); // Padding

Expand All @@ -17,8 +17,10 @@ export async function start(options) {
return;
}

const child = fork(options.startFile, options.args._, {
execArgv: ["-r", "source-map-support/register"]
const child = spawn(nodePath, [options.startFile, ...options.args._], {
execArgv: ["-r", "source-map-support/register"],
cwd: appDirectory,
stdio: "inherit"
});

child.on("exit", (code, signal) => {
Expand Down
9 changes: 5 additions & 4 deletions packages/scripts/src/scripts/test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import path from "path";
import { appDirectory } from "../utils/path";
import { execSync } from "child_process";
import { fork } from "child_process";
import spawn from "cross-spawn";
import { getOptions } from "../options";
import cosmiconfig from "cosmiconfig";
import merge from "lodash.merge";
import { printError, printInfo } from "../utils/print";

export default async args => {
export default async (args, fullArgs) => {
printInfo("Testing...");

const options = getOptions(null, "test");
Expand Down Expand Up @@ -81,7 +81,8 @@ export default async args => {
);

// Run Jest
fork(jestPath, args, {
cwd: appDirectory
spawn(fullArgs[0], [jestPath, ...args], {
cwd: appDirectory,
stdio: "inherit"
});
};
32 changes: 20 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,9 @@
lodash "^4.2.0"
to-fast-properties "^2.0.0"

"@noderize/runtime@^0.3.16":
version "0.3.16"
resolved "https://registry.yarnpkg.com/@noderize/runtime/-/runtime-0.3.16.tgz#651169c72b750373e29d421782fd6e48f8de044f"
dependencies:
"@babel/runtime" "^7.0.0-beta.40"

"@noderize/[email protected]":
version "0.3.16"
resolved "https://registry.yarnpkg.com/@noderize/scripts/-/scripts-0.3.16.tgz#4ad9dca90a19ff45884cec1ffb36db161f4a114e"
"@noderize/[email protected]":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@noderize/scripts/-/scripts-0.4.3.tgz#3b2dfcc8f726ff7ca9cc7c734dacfc12b5395eac"
dependencies:
"@babel/core" "^7.0.0-beta.40"
"@babel/plugin-proposal-decorators" "^7.0.0-beta.40"
Expand All @@ -580,7 +574,7 @@
"@babel/preset-env" "^7.0.0-beta.40"
"@babel/preset-flow" "^7.0.0-beta.40"
"@babel/preset-stage-2" "^7.0.0-beta.40"
"@noderize/runtime" "^0.3.16"
"@noderize/runtime" "^0.4.3"
babel-core "^7.0.0-bridge.0"
babel-jest "^22.2.2"
babel-loader "^8.0.0-beta.0"
Expand Down Expand Up @@ -1503,6 +1497,16 @@ cross-spawn@^5.0.1:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
dependencies:
nice-try "^1.0.4"
path-key "^2.0.1"
semver "^5.5.0"
shebang-command "^1.2.0"
which "^1.2.9"

[email protected]:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
Expand Down Expand Up @@ -3452,6 +3456,10 @@ natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"

nice-try@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"

node-int64@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
Expand Down Expand Up @@ -3755,7 +3763,7 @@ path-is-inside@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"

path-key@^2.0.0:
path-key@^2.0.0, path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"

Expand Down Expand Up @@ -4245,7 +4253,7 @@ schema-utils@^0.4.2:
ajv "^6.1.0"
ajv-keywords "^3.1.0"

"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.3.0, semver@^5.4.1:
"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"

Expand Down

0 comments on commit 0f6a90f

Please sign in to comment.