@tywalk/pcf-helper 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Command line helper for building and publishing PCF controls to Dataverse.",
5
5
  "main": "dist/index.js",
6
6
  "types": "./types/",
@@ -15,7 +15,7 @@
15
15
  "test": "jest",
16
16
  "build": "tsc",
17
17
  "upgrade": "npm version patch --no-git-tag-version",
18
- "ready": "npm run upgrade"
18
+ "ready": "npm run upgrade && npm run build && npm publish --access public"
19
19
  },
20
20
  "keywords": [
21
21
  "pcf"
@@ -21,14 +21,17 @@ const playwright_1 = require("playwright");
21
21
  function loadConfig(config) {
22
22
  // Load file config if exists
23
23
  let fileConfig = {};
24
- const configPath = path_1.default.join(__dirname, config || 'dev-config.json');
25
- console.log(`📁 Looking for config file at: ${configPath}`);
24
+ const configPath = path_1.default.join(process.cwd(), config || 'dev-config.json');
25
+ color_logger_1.default.log(`📁 Looking for config file at: ${configPath}`);
26
26
  if (fs_1.default.existsSync(configPath)) {
27
27
  fileConfig = JSON.parse(fs_1.default.readFileSync(configPath, 'utf8'));
28
- console.log(`✅ Loaded config file: ${JSON.stringify(fileConfig, null, 2)}`);
28
+ color_logger_1.default.log(`✅ Loaded config file: ${JSON.stringify(fileConfig, null, 2)}`);
29
+ }
30
+ else if (process.env.REMOTE_ENVIRONMENT_URL) {
31
+ color_logger_1.default.warn(`⚠️ Config file not found, using defaults or CLI/env options.`);
29
32
  }
30
33
  else {
31
- console.log(`⚠️ Config file not found, using defaults or CLI/env options.`);
34
+ return {}; // No config file and no env vars, return empty config to use defaults
32
35
  }
33
36
  // Get the base URL first
34
37
  const remoteEnvironmentUrl = process.env.REMOTE_ENVIRONMENT_URL ||
@@ -75,6 +78,10 @@ function loadConfig(config) {
75
78
  };
76
79
  }
77
80
  function runSession(remoteEnvironmentUrl, remoteScriptToIntercept, remoteStylesheetToIntercept, localBundlePath, localCssPath) {
81
+ if (!remoteEnvironmentUrl) {
82
+ color_logger_1.default.error('❌ Remote environment URL is required. Please provide it via CLI, config file, or environment variable.');
83
+ process.exit(1);
84
+ }
78
85
  const REMOTE_ENVIRONMENT_URL = remoteEnvironmentUrl;
79
86
  const REMOTE_SCRIPT_TO_INTERCEPT = remoteScriptToIntercept;
80
87
  const REMOTE_STYLESHEET_TO_INTERCEPT = remoteStylesheetToIntercept;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Command line helper for building and publishing PCF controls to Dataverse.",
5
5
  "main": "dist/index.js",
6
6
  "types": "./types/",
@@ -15,7 +15,7 @@
15
15
  "test": "jest",
16
16
  "build": "tsc",
17
17
  "upgrade": "npm version patch --no-git-tag-version",
18
- "ready": "npm run upgrade"
18
+ "ready": "npm run upgrade && npm run build && npm publish --access public"
19
19
  },
20
20
  "keywords": [
21
21
  "pcf"
@@ -1,4 +1,10 @@
1
1
  declare function loadConfig(config?: string): {
2
+ remoteEnvironmentUrl?: undefined;
3
+ remoteScriptToIntercept?: undefined;
4
+ remoteStylesheetToIntercept?: undefined;
5
+ localCssPath?: undefined;
6
+ localBundlePath?: undefined;
7
+ } | {
2
8
  remoteEnvironmentUrl: any;
3
9
  remoteScriptToIntercept: any;
4
10
  remoteStylesheetToIntercept: any;