This repository contains the Argos SDK and Argos SalesLogix product in a monorepo structure managed by npm workspaces.
monorepo-root/
├── package.json # Root workspace configuration
├── package-lock.json # Single lock file for entire monorepo
├── node_modules/ # Hoisted shared dependencies
├── Jenkinsfile # CI/CD pipeline
├── argos-sdk/ # Argos SDK workspace package
│ ├── package.json
│ ├── Gruntfile.js
│ ├── src/
│ └── node_modules/ # Package-specific dependencies
└── products/
└── argos-saleslogix/ # Argos SalesLogix workspace package
├── package.json
├── Gruntfile.js
├── src/
└── node_modules/ # Package-specific dependencies
- Node.js 16+ (with npm 7+ for workspace support)
- Git
Install all dependencies for the entire monorepo from the root directory:
npm installThis single command installs dependencies for all workspace packages and hoists shared dependencies to the root node_modules directory.
You can run commands across all workspaces or target specific packages from the root:
Run commands in all workspaces:
npm run test --workspaces
npm run less --workspacesRun commands in a specific workspace:
npm run test -w argos-sdk
npm run less -w argos-sdk
npm run test -w products/argos-saleslogix
npm run less -w products/argos-saleslogixUse convenience scripts:
npm run test:all # Test all packages
npm run test:sdk # Test argos-sdk only
npm run test:saleslogix # Test argos-saleslogix onlyYou can also navigate into a specific package and run commands directly:
cd argos-sdk
npm run test
npm run less
npm run lintcd products/argos-saleslogix
npm run test
npm run e2e
npm run less
npm startnpm run test- Run Jasmine testsnpm run less- Compile LESS to CSSnpm run lint- Run ESLintnpm run lint-fix- Run ESLint with auto-fix
npm run test- Run Mocha testsnpm run e2e- Run Playwright end-to-end testsnpm run less- Compile LESS to CSSnpm run lint- Run ESLintnpm run lint-fix- Run ESLint with auto-fixnpm start- Start development server
Add a shared dependency (used by multiple packages):
Add to the root package.json:
npm install -D <package-name> -w rootOr manually add to root package.json devDependencies and run npm install.
Add a package-specific dependency:
npm install <package-name> -w argos-sdk
npm install <package-name> -w products/argos-saleslogixOr navigate to the package directory:
cd argos-sdk
npm install <package-name>Guidelines for dependency placement:
- Root devDependencies: Build tools, test frameworks, linters used by multiple packages (grunt, eslint, jasmine, mocha)
- Package dependencies/devDependencies: Package-specific tools or libraries used by only one package
The argos-saleslogix package depends on argos-sdk using the workspace protocol:
{
"dependencies": {
"argos-sdk": "workspace:*"
}
}This creates a symlink from products/argos-saleslogix/node_modules/argos-sdk to the local argos-sdk package, enabling:
- Live updates: Changes to argos-sdk are immediately available in argos-saleslogix without reinstalling
- Consistent versions: Always uses the local version during development
- Simplified workflow: No need to publish/link packages manually
- Make changes to
argos-sdk/src/ - Changes are immediately available to argos-saleslogix via the workspace symlink
- No build step required - source files use AMD format with modern JavaScript features
Source files are written in AMD (Asynchronous Module Definition) format and can be used directly by browsers without transpilation.
Run all tests:
npm run test:allRun tests for a specific package:
npm run test:sdk
npm run test:saleslogixRun end-to-end tests:
cd products/argos-saleslogix
npm run e2eCompile CSS from LESS stylesheets:
npm run less -w argos-sdk
npm run less -w products/argos-saleslogixSource files are in AMD format with modern JavaScript features and can be used directly by the browser. No transpilation or build step is required for JavaScript files.
The codebase uses AMD (Asynchronous Module Definition) modules with modern JavaScript features:
-
argos-sdk modules: Use
argos/prefixargos-sdk/src/Application.js→define('argos/Application', ...)argos-sdk/src/Fields/TextField.js→define('argos/Fields/TextField', ...)
-
argos-saleslogix modules: Use
crm/prefixproducts/argos-saleslogix/src/Application.js→define('crm/Application', ...)products/argos-saleslogix/src/Views/Account/List.js→define('crm/Views/Account/List', ...)
define('argos/Application', [
'./View',
'./I18n',
'./actions/connection'
], function(View, getResource, connectionActions) {
const { setConnectionState } = connectionActions;
class Application {
constructor() {
// Modern JavaScript features are preserved
this.views = [];
}
async initialize() {
// async/await, arrow functions, const/let all supported
const config = await this.loadConfig();
return config;
}
}
return Application;
});Source files use modern JavaScript features supported by current browsers:
constandletdeclarations- Arrow functions
- Template literals
- Class syntax
- Destructuring
- Spread operators
async/await- Object shorthand notation
No transpilation is required - browsers load AMD modules directly.
The Jenkins pipeline (defined in Jenkinsfile) uses npm workspaces:
// Install all dependencies once
sh 'npm install'
// Run tests
sh 'npm run test -w argos-sdk'
sh 'npm run test -w products/argos-saleslogix'
// Compile CSS
sh 'npm run less -w argos-sdk'
sh 'npm run less -w products/argos-saleslogix'Benefits:
- Single
npm installfor the entire monorepo - Faster builds due to dependency hoisting
- No transpilation step required
- Explicit workspace targeting
See MIGRATION-GUIDE.md for common issues and solutions.