Skip to content

Commit

Permalink
feat: implement caching of the setup target (disabled by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton authored Sep 29, 2024
2 parents f68e28b + 63079a9 commit f4479e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"cache": true,
"inputs": ["default", "^production"]
},
"pb-ve-env-setup": {
"cache": true
},
"nx-release-publish": {
"dependsOn": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const PROJECT_JSON_FILE_GLOB = '**/project.json';
export const createNodesV2: CreateNodesV2<BuildEnvPluginCreateNodeOptions> = [
PROJECT_JSON_FILE_GLOB,
async (configFiles, options, context) => {
const optionsHash = hashObject({ configFiles, options });
const optionsHash = hashObject({ options });
const nxVerdaccioEnvPluginCachePath = join(
workspaceDataDirectory,
`push-based--${PLUGIN_NAME}-${optionsHash}.hash`
Expand All @@ -45,7 +45,6 @@ export const createNodesV2: CreateNodesV2<BuildEnvPluginCreateNodeOptions> = [
const projectRoot = dirname(projectConfigurationFile);
const hashData = {
projectRoot,
projectConfigurationFile,
internalOptions,
};
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,13 @@ export function getEnvTargets(
},
// runs env-bootstrap-env, install-env and stop-verdaccio
[TARGET_ENVIRONMENT_SETUP]: {
outputs: ['{options.environmentRoot}'],
cache: false,
outputs: [
'{options.environmentRoot}/node_modules',
'{options.environmentRoot}/package.json',
'{options.environmentRoot}/.npmrc',
'{options.environmentRoot}/package-lock.json',
],
cache: false, // # @TODO enable by default after more research on cache size is done
executor: `${PACKAGE_NAME}:${EXECUTOR_ENVIRONMENT_SETUP}`,
options: {
environmentRoot,
Expand Down

0 comments on commit f4479e9

Please sign in to comment.