Skip to content

Commit

Permalink
Use SHX, a wrapper for shell commands, in package.json scripts to sup…
Browse files Browse the repository at this point in the history
…port cross-platform development (#134)
  • Loading branch information
fultonm authored Apr 20, 2024
1 parent 6a5a769 commit 697d4a7
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ npm install # from the extension directory

### Run the extension

Use the `Debug: Start Debugging Command` to launch the extension in a new vscode window.
Use the `Debug: Start Debugging` command to launch the extension in a new vscode window.

To inspect/debug the webview, use the `Developer: Open Webview Developer tools command`.
To inspect/debug the webview, use the `Developer: Open Webview Developer Tools` command.

### Package the extension to a vsix archive

Expand Down
55 changes: 55 additions & 0 deletions extension/package-lock.json

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

3 changes: 2 additions & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
"vscode:prepublish": "npm run package",
"package": "npm run build-webview && npm run copy-webview && webpack --mode production --devtool hidden-source-map",
"build": "npm run build-webview && npm run copy-webview && webpack --mode development",
"copy-webview": "rm -rf public && cp -r ../webview/build public",
"copy-webview": "shx rm -rf public && shx cp -r ../webview/build public",
"lint": "eslint --ext .ts src",
"build-webview": "cd ../webview && npm run build",
"start-webview": "cd ../webview && npm run start",
Expand All @@ -368,6 +368,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"shx": "^0.3.4",
"ts-loader": "^9.4.1",
"typescript": "^4.8.4",
"webpack": "^5.74.0",
Expand Down
57 changes: 56 additions & 1 deletion webview/package-lock.json

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

5 changes: 3 additions & 2 deletions webview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"start": "react-scripts start",
"refresh-assets": "rm -rf public/excalidraw-assets && cp -r node_modules/@excalidraw/excalidraw/dist/excalidraw-assets public/excalidraw-assets",
"refresh-assets": "shx rm -rf public/excalidraw-assets && shx cp -r node_modules/@excalidraw/excalidraw/dist/excalidraw-assets public/excalidraw-assets",
"build": "npm run refresh-assets && react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
Expand All @@ -35,6 +35,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"react-scripts": "5.0.1"
"react-scripts": "5.0.1",
"shx": "^0.3.4"
}
}

0 comments on commit 697d4a7

Please sign in to comment.