Skip to content

Commit

Permalink
update vars in package.json to prefix with VITE
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahlessner committed Dec 19, 2024
1 parent ca4afb4 commit a25abb6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/jira/jira-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"vitest": "^2.1.2"
},
"scripts": {
"start": "REACT_APP_NGROK_URL=${NGROK_URL} REACT_APP_ATLASSIAN_APP_CLIENT_ID=${ATLASSIAN_APP_CLIENT_ID} vite",
"start": "VITE_NGROK_URL=${NGROK_URL} VITE_ATLASSIAN_APP_CLIENT_ID=${ATLASSIAN_APP_CLIENT_ID} vite",
"build": "vite build",
"deploy": "aws s3 sync ./build ${STATIC_JIRA_S3_BASE} --acl public-read",
"deploy:test": "npm run deploy",
Expand Down
19 changes: 19 additions & 0 deletions apps/jira/jira-app/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@ let LAMBDA_URI = 'https://api.jira.ctfapps.net';
let CLIENT_ID = 'XD9k9QU9VT4Rt26u6lbO3NM0fOqvvXan';

if (import.meta.env.DEV) {
console.log('Running in development mode');
LAMBDA_URI = `${import.meta.env.VITE_NGROK_URL}/test`;
CLIENT_ID = import.meta.env.VITE_ATLASSIAN_APP_CLIENT_ID || '';
}

// interface ImportMetaValue extends ImportMeta {
// NODE_ENV?: string;
// VITE_NGROK_URL?: string;
// VITE_ATLASSIAN_APP_CLIENT_ID?: string;
// }

// if ((import.meta as ImportMetaValue).NODE_ENV === 'development') {
// console.log('development');
// LAMBDA_URI = `${(import.meta as ImportMetaValue).VITE_NGROK_URL}/test`;
// CLIENT_ID = (import.meta as ImportMetaValue).VITE_ATLASSIAN_APP_CLIENT_ID || '';
// }

// if (process.env.NODE_ENV === 'development') {
// console.log('development');
// LAMBDA_URI = `${process.env.REACT_APP_NGROK_URL}/test`;
// CLIENT_ID = process.env.REACT_APP_ATLASSIAN_APP_CLIENT_ID || '';
// }

const constants = {
OAUTH_REDIRECT_URI: `${LAMBDA_URI}/auth`,
CONNECT_URL: `${LAMBDA_URI}/connect.json`,
Expand Down

0 comments on commit a25abb6

Please sign in to comment.