Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cli issues #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"postinstall": "node scripts/installScript.js",
"cleanup": "node scripts/cleanup.js"
},
"cpu": [
"!arm64"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you may need to update the README here to reflect the change in arm support?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikemahony yes, I am working on fixing these.

],
"jest": {
"transform": {
"^.+\\.jsx?$": "babel-jest"
Expand Down
23 changes: 11 additions & 12 deletions packages/uxp-devtools-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "@adobe/uxp-devtools-cli",
"version": "1.5.1",
"version": "1.6.4",
"description": "Command line interface for rapid UXP plugin development",
"main": "src/uxp.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"uxp": "src/uxp.js",
"postinstall": "node scripts/setupInspectApp.js"

},
"bin": {
"uxp": "src/uxp.js"
Expand All @@ -26,16 +25,16 @@
"author": "Adobe Inc",
"license": "Apache-2.0",
"dependencies": {
"@adobe/uxp-devtools-core": "^1.5.0",
"@adobe/uxp-inspect-frontend": "^1.5.1",
"@adobe/uxp-template-ps-starter": "^1.0.0",
"@adobe/uxp-template-default-starter": "^1.0.0",
"@adobe/uxp-template-default-starter-xd": "^1.0.0",
"@adobe/uxp-template-default-starter-ps": "^1.0.0",
"@adobe/uxp-template-ps-react-starter": "^1.0.0",
"@adobe/uxp-template-ps-react-typescript": "^1.0.0",
"@adobe/uxp-template-xd-starter": "^1.0.0",
"@adobe/uxp-wdio-automation-template": "^1.0.0",
"@adobe/uxp-devtools-core": "1.6.0",
"@adobe/uxp-inspect-frontend": "1.6.1",
"@adobe/uxp-template-default-starter": "1.0.0",
"@adobe/uxp-template-default-starter-ps": "1.0.0",
"@adobe/uxp-template-default-starter-xd": "1.0.0",
"@adobe/uxp-template-ps-react-starter": "1.0.0",
"@adobe/uxp-template-ps-react-typescript": "1.0.0",
"@adobe/uxp-template-ps-starter": "1.0.0",
"@adobe/uxp-template-xd-starter": "1.0.0",
"@adobe/uxp-wdio-automation-template": "1.0.0",
"@adobe/uxp_web_driver": "2.2.1",
"chalk": "^3.0.0",
"cli-table3": "^0.6.0",
Expand Down
16 changes: 12 additions & 4 deletions packages/uxp-devtools-cli/scripts/setupInspectApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@ governing permissions and limitations under the License.
*/

const path = require("path");
const os = require("os");
const { execSync } = require("child_process");

function generateDevtoolsAppPacakge() {
let uxpDevtoolAppDir = require.resolve("@adobe/uxp-inspect-frontend/package.json");
uxpDevtoolAppDir = path.dirname(uxpDevtoolAppDir);

execSync("yarn package", {
cwd: uxpDevtoolAppDir,
stdio: [ "inherit", "inherit", "inherit" ]
});
if(os.arch() === "arm64") {
execSync("yarn package-arm64", {
cwd: uxpDevtoolAppDir,
stdio: [ "inherit", "inherit", "inherit" ]
});
}else {
execSync("yarn package", {
cwd: uxpDevtoolAppDir,
stdio: [ "inherit", "inherit", "inherit" ]
});
}
}

generateDevtoolsAppPacakge();
4 changes: 3 additions & 1 deletion packages/uxp-devtools-cli/src/cli/utils/CLICDTInspectMgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const path = require("path");
const child_process = require("child_process");
const process = require("process");
const { createDeferredPromise } = require("./common");
const os = require('os');

function getDevtoolsAppExecutablePath() {
let uxpDevtoolAppDir = require.resolve("@adobe/uxp-inspect-frontend/package.json");
Expand All @@ -23,8 +24,9 @@ function getDevtoolsAppExecutablePath() {
const baseFolder = path.resolve(uxpDevtoolAppDir, "dist");

let executablePath = "";
const arch = os.arch();
if (process.platform === "darwin") {
executablePath = `${baseFolder}/mac/${productName}.app/Contents/MacOS/${productName}`;
executablePath = arch === 'arm64'?`${baseFolder}/mac-arm64/${productName}.app/Contents/MacOS/${productName}`:`${baseFolder}/mac/${productName}.app/Contents/MacOS/${productName}`;
}
else if (process.platform === "win32") {
executablePath = `${baseFolder}/win-unpacked/${productName}.exe`;
Expand Down
4 changes: 2 additions & 2 deletions packages/uxp-devtools-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/uxp-devtools-core",
"version": "1.5.0",
"version": "1.6.0",
"description": "UXP Devtools Core Module",
"main": "src/index.js",
"scripts": {
Expand All @@ -21,7 +21,7 @@
"author": "Adobe Inc",
"license": "Apache-2.0",
"dependencies": {
"@adobe/uxp-devtools-helper": "^1.5.0",
"@adobe/uxp-devtools-helper": "1.6.0",
"chalk": "^3.0.0",
"chokidar": "^3.4.2",
"express": "^4.17.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CliClientController {
_connectToServiceAtPort(port) {
this._createConnection();
this._port = port;
const url = `ws://localhost:${port}/socket/cli`;
const url = `ws://127.0.0.1:${port}/socket/cli`;
this._callerPromise = createDeferredPromise();
this._connection.connect(this, url);
return this._callerPromise.promise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BrowserCDTClient extends Client {

static create(server, socket, url) {
// url is of form "/socket/browser_cdt/?uxp-app-id=PS" hence added a baseURL
let cliUrl = new URL(url, "http://localhost:14001");
let cliUrl = new URL(url, "http://127.0.0.1:14001");
const searchParams = cliUrl.searchParams;
const uxpAppID = searchParams.get("adobe-uxp-app-id");
let browserCDTClient = new BrowserCDTClient(server, socket, uxpAppID);
Expand Down
6 changes: 2 additions & 4 deletions packages/uxp-devtools-helper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/uxp-devtools-helper",
"version": "1.5.0",
"version": "1.6.0",
"description": "Adobe Devtools helper package used by uxp cli",
"main": "src/DevToolsHelper.js",
"scripts": {
Expand All @@ -20,9 +20,7 @@
"dependencies": {
"fs-extra": "^9.0.0",
"node-gyp-build": "^4.2.3",
"@adobe/uxp-devtools-feature": "^1.0.0"
},
"devDependencies": {
"@adobe/uxp-devtools-feature": "^1.0.0",
"tar": "^6.0.1"
}
}
46 changes: 3 additions & 43 deletions packages/uxp-devtools-helper/scripts/devtools_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const path = require("path");
const fs = require("fs-extra");
const process = require("process");
const tar = require("tar");
const os = require("os");

function extractdevToolsTarLib(tarPath, dest) {
return tar.extract({
Expand All @@ -32,55 +33,14 @@ function setupTargetFolder() {
return destDir;
}

function postSetupInstallStep() {
if (process.platform === "darwin") {
// npm install strips the symlinks from the adobe_caps framework, so we need to recreate them

const cwd = process.cwd();
process.chdir(`${__dirname}/../build/Release/adobe_caps.framework`);

try {
fs.symlinkSync("Versions/A/adobe_caps", "./adobe_caps", "file");
}
catch (e) {
if (e.code !== "EEXIST") {
process.exit(1);
}
}

try {
fs.symlinkSync("Versions/A/Resources", "./Resources", "dir");
}
catch (e) {
if (e.code !== "EEXIST") {
process.exit(1);
}
}

process.chdir("./Versions");
fs.chmodSync("./A/adobe_caps", "755");

try {
fs.symlinkSync("A", "./Current", "dir");
}
catch (e) {
if (e.code !== "EEXIST") {
process.exit(1);
}
}
process.chdir(cwd);
}
}

function setupDevtoolsNativeAddOn() {
console.log("Setting up Adobe devTools node native add-on library... ");
const arch = process.env.build_arch;
const arch = os.arch();
const targetFolder = setupTargetFolder();
const fileName = arch !== "arm64" ? `DevtoolsHelper-v1.0.0-node-${process.platform}.tar.gz` : `DevtoolsHelper-v1.0.0-node-${process.platform}-arm64.tar.gz`;
const fileName = arch !== "arm64" ? `DevtoolsHelper-v1.1.0-node-${process.platform}.tar.gz` : `DevtoolsHelper-v1.1.0-node-${process.platform}-arm64.tar.gz`;
const devToolsTarPath = path.resolve(__dirname, `./native-libs/${fileName}`);
const prom = extractdevToolsTarLib(devToolsTarPath, targetFolder);
prom.then(() => {
postSetupInstallStep();
console.log("Adobe devToolsJS native add-on setup successfull.");
}).catch((err) => {
throw new Error(`Adobe devTools-JS native add-on setup failed with error ${err}`);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions packages/uxp-inspect-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@adobe/uxp-inspect-frontend",
"productName": "Adobe UXP Developer Tool",
"appMenuName": "Adobe UXP Developer Tool",
"version": "1.5.1",
"version": "1.6.1",
"main": "main/index.js",
"repository": {
"type": "git",
Expand All @@ -13,8 +13,8 @@
"license": "Apache-2.0",
"scripts": {
"cleanup": "rimraf dist/",
"package": "yarn cleanup && electron-builder --dir",
"package-arm64": "export build_arch=arm64 && yarn cleanup && electron-builder --dir --arm64",
"package": "electron-builder --dir --x64",
"package-arm64": "electron-builder --dir --arm64",
"postinstall": "node scripts/setup.js"
},
"build": {
Expand Down Expand Up @@ -43,12 +43,12 @@
"npmRebuild": true
},
"devDependencies": {
"tar": "^6.0.1",
"electron": "11.2.0",
"electron-builder": "22.10.5",
"electron": "23.0.0",
"electron-builder": "23.6.0",
"rimraf": "^3.0.2"
},
"dependencies": {
"tar": "^6.0.1",
"@babel/plugin-proposal-decorators": "^7.10.5",
"fs-extra": "^9.0.1",
"minimist": "^1.2.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exports.config = {
"goog:chromeOptions": {
args: [ `--adobe-uxp-app-id=${uxpAppId}`,
`--adobe-uxp-plugin-id=${uxpPluginId}` ],
debuggerAddress: `http://localhost:${servicePort}`,
debuggerAddress: `http://127.0.0.1:${servicePort}`,
}
} ],
hostname: "localhost",
Expand Down
Loading