Skip to content

Commit

Permalink
fix(nx): create-nx-workspace cannot depend on typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Jul 16, 2019
1 parent 8271c76 commit 4022fe8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/create-nx-workspace/bin/create-nx-workspace.ts
@@ -1,6 +1,7 @@
#!/usr/bin/env node

import { output } from '@nrwl/workspace';
// we can import from '@nrwl/workspace' because it will require typescript
import { output } from '@nrwl/workspace/src/command-line/output';
import { execSync } from 'child_process';
import { writeFileSync } from 'fs';
import * as path from 'path';
Expand Down
3 changes: 2 additions & 1 deletion packages/workspace/src/command-line/dep-graph.ts
Expand Up @@ -254,8 +254,9 @@ function handleOutput({ data, shouldOpen, filename }: OutputOptions) {
opn(tmpFilename, {
wait: false
});
} else {
writeToFile(filename, data);
}
writeToFile(filename, data);
}

function applyHTMLTemplate(svg: string) {
Expand Down
8 changes: 4 additions & 4 deletions scripts/package.sh
Expand Up @@ -17,22 +17,22 @@ cd build/packages

if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i "" "s|exports.nxVersion = '\*';|exports.nxVersion = '$NX_VERSION';|g" {react,web,jest,node,express,nest,cypress,angular,workspace}/src/utils/versions.js
sed -i "" "s|\*|$NX_VERSION|g" {schematics,react,web,jest,node,express,nest,cypress,angular,workspace}/package.json
sed -i "" "s|\*|$NX_VERSION|g" {schematics,react,web,jest,node,express,nest,cypress,angular,workspace,create-nx-workspace}/package.json
sed -i "" "s|NX_VERSION|$NX_VERSION|g" create-nx-workspace/bin/create-nx-workspace.js
sed -i "" "s|ANGULAR_CLI_VERSION|$ANGULAR_CLI_VERSION|g" create-nx-workspace/bin/create-nx-workspace.js
sed -i "" "s|TYPESCRIPT_VERSION|$TYPESCRIPT_VERSION|g" create-nx-workspace/bin/create-nx-workspace.js
else
sed -i "s|exports.nxVersion = '\*';|exports.nxVersion = '$NX_VERSION';|g" {react,web,jest,node,express,nest,cypress,angular,workspace}/src/utils/versions.js
sed -i "s|\*|$NX_VERSION|g" {schematics,react,web,jest,node,express,nest,cypress,angular,workspace}/package.json
sed -i "s|\*|$NX_VERSION|g" {schematics,react,web,jest,node,express,nest,cypress,angular,workspace,create-nx-workspace}/package.json
sed -i "s|NX_VERSION|$NX_VERSION|g" create-nx-workspace/bin/create-nx-workspace.js
sed -i "s|ANGULAR_CLI_VERSION|$ANGULAR_CLI_VERSION|g" create-nx-workspace/bin/create-nx-workspace.js
sed -i "s|TYPESCRIPT_VERSION|$TYPESCRIPT_VERSION|g" create-nx-workspace/bin/create-nx-workspace.js
fi

if [[ $NX_VERSION == "*" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -E -i "" "s/\"@nrwl\/([^\"]+)\": \"\\*\"/\"@nrwl\/\1\": \"file:..\/\1\"/" {schematics,jest,web,react,node,express,nest,cypress,angular,workspace}/package.json
sed -E -i "" "s/\"@nrwl\/([^\"]+)\": \"\\*\"/\"@nrwl\/\1\": \"file:..\/\1\"/" {schematics,jest,web,react,node,express,nest,cypress,angular,workspace,create-nx-workspace}/package.json
else
sed -E -i "s/\"@nrwl\/([^\"]+)\": \"\\*\"/\"@nrwl\/\1\": \"file:..\/\1\"/" {schematics,jest,web,react,node,express,nest,cypress,angular,workspace}/package.json
sed -E -i "s/\"@nrwl\/([^\"]+)\": \"\\*\"/\"@nrwl\/\1\": \"file:..\/\1\"/" {schematics,jest,web,react,node,express,nest,cypress,angular,workspace,create-nx-workspace}/package.json
fi
fi

0 comments on commit 4022fe8

Please sign in to comment.