Skip to content
Merged
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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
!/seed-salesforce-api.ts
!/seed.sh
!/tsconfig.base.json
!/webpack-server.config.js

# Ignore unnecessary files inside allowed directories
*#
Expand Down
62 changes: 22 additions & 40 deletions apps/cron-tasks/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,37 @@
"tags": ["scope:server"],
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"platform": "node",
"outputPath": "dist/apps/cron-tasks",
"main": "apps/cron-tasks/main.ts",
"format": ["cjs"],
"bundle": true,
"main": "apps/cron-tasks/src/main.ts",
"additionalEntryPoints": [
{
"entryName": "clean-up-user-sync-history",
"entryPath": "apps/cron-tasks/src/clean-up-user-sync-history.ts"
},
{
"entryName": "save-analytics-summary",
"entryPath": "apps/cron-tasks/src/save-analytics-summary.ts"
},
{
"entryName": "geo-ip-api-updater",
"entryPath": "apps/cron-tasks/src/geo-ip-api-updater.ts"
},
{
"entryName": "geo-ip-db-updater",
"entryPath": "apps/cron-tasks/src/geo-ip-db-updater.ts"
},
{
"entryName": "salesforce-org-expiration",
"entryPath": "apps/cron-tasks/src/salesforce-org-expiration.ts"
},
{
"entryName": "stats-summary",
"entryPath": "apps/cron-tasks/src/stats-summary.ts"
}
"apps/cron-tasks/src/clean-up-user-sync-history.ts",
"apps/cron-tasks/src/save-analytics-summary.ts",
"apps/cron-tasks/src/geo-ip-api-updater.ts",
"apps/cron-tasks/src/geo-ip-db-updater.ts",
"apps/cron-tasks/src/salesforce-org-expiration.ts",
"apps/cron-tasks/src/stats-summary.ts"
],
"tsConfig": "apps/cron-tasks/tsconfig.app.json",
"assets": [],
"target": "node",
"compiler": "tsc",
"webpackConfig": "apps/cron-tasks/webpack.config.js"
"generatePackageJson": true,
"sourcemap": true,
"esbuildOptions": {
"sourcemap": true,
"outExtension": {
".js": ".js"
}
}
},
"configurations": {
"production": {
"optimization": false,
"extractLicenses": false,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/cron-tasks/src/environments/environment.ts",
"with": "apps/cron-tasks/src/environments/environment.prod.ts"
}
]
}
"development": {},
"production": {}
}
},
"serve": {
Expand Down
3 changes: 0 additions & 3 deletions apps/cron-tasks/src/environments/environment.prod.ts

This file was deleted.

3 changes: 0 additions & 3 deletions apps/cron-tasks/src/environments/environment.ts

This file was deleted.

File renamed without changes.
8 changes: 0 additions & 8 deletions apps/cron-tasks/webpack.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions apps/jetstream-web-extension/.babelrc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<div id="root"></div>
<div id="modal-root"></div>
<div id="app-container"></div>
<script type="module" src="./src/pages/additional-settings/AdditionalSettings.tsx"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<div id="root"></div>
<div id="modal-root"></div>
<div id="app-container"></div>
<script type="module" src="./src/pages/app/App.tsx"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
</head>
<body>
<div id="app-container"></div>
<script type="module" src="./src/pages/popup/Popup.tsx"></script>
</body>
</html>
56 changes: 7 additions & 49 deletions apps/jetstream-web-extension/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,79 +6,37 @@
"tags": ["scope:browser"],
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/jetstream-web-extension",
"baseHref": "/",
"tsConfig": "apps/jetstream-web-extension/tsconfig.app.json",
"assets": ["apps/jetstream-web-extension/src/assets"],
"styles": [],
"scripts": [],
"webpackConfig": "apps/jetstream-web-extension/webpack.config.js"
"outputPath": "dist/apps/jetstream-web-extension"
},
"configurations": {
"development": {
"fileReplacements": [],
"optimization": true,
"outputHashing": "none",
"sourceMap": true,
"namedChunks": false,
"extractLicenses": false,
"vendorChunk": false
"mode": "development"
},
"staging": {
"mode": "staging",
"fileReplacements": [
{
"replace": "apps/jetstream-web-extension/src/environments/environment.ts",
"with": "apps/jetstream-web-extension/src/environments/environment.staging.ts"
}
],
"optimization": true,
"outputHashing": "none",
"sourceMap": true,
"namedChunks": false,
"extractLicenses": false,
"vendorChunk": false
]
},
"production": {
"fileReplacements": [
{
"replace": "apps/jetstream-web-extension/src/environments/environment.ts",
"with": "apps/jetstream-web-extension/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "none",
"sourceMap": true,
"namedChunks": false,
"extractLicenses": false,
"vendorChunk": false
]
}
}
},
"serve": {
"executor": "@nx/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "jetstream-web-extension:build",
"hmr": true
},
"configurations": {
"development": {
"buildTarget": "jetstream-web-extension:build:development"
},
"production": {
"buildTarget": "jetstream-web-extension:build:production",
"hmr": false
},
"staging": {
"buildTarget": "jetstream-web-extension:build:staging",
"hmr": false
}
}
"command": "nx build jetstream-web-extension --configuration=development --watch"
},
"test": {
"executor": "@nx/vitest:test",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const environment = {
production: true,
serverUrl: 'https://getjetstream.app',
rollbarClientAccessToken: process.env.NX_PUBLIC_ROLLBAR_KEY,
amplitudeToken: process.env.NX_PUBLIC_AMPLITUDE_KEY,
rollbarClientAccessToken: import.meta.env.NX_PUBLIC_ROLLBAR_KEY,
amplitudeToken: import.meta.env.NX_PUBLIC_AMPLITUDE_KEY,
isWebExtension: true,
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const environment = {
production: true,
serverUrl: 'https://staging.jetstream-app.com',
rollbarClientAccessToken: process.env.NX_PUBLIC_ROLLBAR_KEY,
amplitudeToken: process.env.NX_PUBLIC_AMPLITUDE_KEY,
rollbarClientAccessToken: import.meta.env.NX_PUBLIC_ROLLBAR_KEY,
amplitudeToken: import.meta.env.NX_PUBLIC_AMPLITUDE_KEY,
isWebExtension: true,
};
4 changes: 2 additions & 2 deletions apps/jetstream-web-extension/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export const environment = {
production: false,
serverUrl: 'http://localhost:3333',
rollbarClientAccessToken: process.env.NX_PUBLIC_ROLLBAR_KEY,
amplitudeToken: process.env.NX_PUBLIC_AMPLITUDE_KEY,
rollbarClientAccessToken: import.meta.env.NX_PUBLIC_ROLLBAR_KEY,
amplitudeToken: import.meta.env.NX_PUBLIC_AMPLITUDE_KEY,
isWebExtension: true,
};
2 changes: 0 additions & 2 deletions apps/jetstream-web-extension/src/pages/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable no-restricted-globals */
import '../../utils/extension-public-path';

import { AnonymousApex } from '@jetstream/feature/anon-apex';
import { AutomationControl, AutomationControlEditor, AutomationControlSelection } from '@jetstream/feature/automation-control';
import { CreateFields, CreateFieldsSelection, CreateObjectAndFields } from '@jetstream/feature/create-object-and-fields';
Expand Down
2 changes: 0 additions & 2 deletions apps/jetstream-web-extension/src/pages/popup/Popup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '../../utils/extension-public-path';

import { css } from '@emotion/react';
import { CheckboxToggle, FeedbackLink, Grid, ScopedNotification } from '@jetstream/ui';
import browser from 'webextension-polyfill';
Expand Down

This file was deleted.

This file was deleted.

46 changes: 44 additions & 2 deletions apps/jetstream-web-extension/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,54 @@
/// <reference types='vitest' />
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { extensionScriptsBuildPlugin, manifestTransformPlugin, placeholderHtmlPlugin } from './vite.plugins';

export default defineConfig(() => ({
export default defineConfig(({ mode }) => ({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/jetstream-web-extension',
plugins: [react(), nxViteTsPaths()],
envPrefix: 'NX',
base: '',

plugins: [
react({
jsxImportSource: '@emotion/react',
babel: {
plugins: ['@emotion/babel-plugin'],
},
}),
nxViteTsPaths(),
manifestTransformPlugin(mode),
placeholderHtmlPlugin(),
extensionScriptsBuildPlugin(mode),
],

define: {
'globalThis.__IS_BROWSER_EXTENSION__': 'true',
'import.meta.env.NX_PUBLIC_AMPLITUDE_KEY': JSON.stringify(process.env.NX_PUBLIC_AMPLITUDE_KEY || ''),
'process.env.NODE_ENV': JSON.stringify(mode === 'development' ? 'development' : 'production'),
},
Comment thread
paustint marked this conversation as resolved.

build: {
outDir: '../../dist/apps/jetstream-web-extension',
emptyOutDir: true,
sourcemap: mode === 'development' ? 'inline' : false,
minify: mode === 'development' ? false : 'esbuild',
rollupOptions: {
input: {
app: resolve(__dirname, 'app.html'),
popup: resolve(__dirname, 'popup.html'),
'additional-settings': resolve(__dirname, 'additional-settings.html'),
},
output: {
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
assetFileNames: '[name].[ext]',
},
},
},

test: {
name: 'jetstream-web-extension',
watch: false,
Expand Down
Loading
Loading