Skip to content

Commit

Permalink
fix(git-tools): Resovled issues with lock file versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Jan 19, 2024
1 parent 561401b commit 3740dc2
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 608 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@
},
"namespace": "@storm-software",
"nx": {
"includedScripts": ["lint", "format"]
"includedScripts": [
"lint",
"format"
]
},
"pnpm": {
"overrides": {
Expand Down
4 changes: 2 additions & 2 deletions packages/create-storm-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"create-storm-workspace": "./index.js"
},
"dependencies": {
"@nx/workspace": "17.0.3",
"create-nx-workspace": "17.0.3",
"@nx/workspace": "17.2.8",
"create-nx-workspace": "17.2.8",
"enquirer": "2.4.1"
},
"publishConfig": {
Expand Down
4 changes: 3 additions & 1 deletion packages/git-tools/bin/pre-push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ if (fs.existsSync(path.join(workspaceRoot, "yarn.lock"))) {
}

try {
const rawContent = await readFile("pnpm-lock.yaml", { encoding: "utf8" });
const rawContent = await readFile(path.join(workspaceRoot, "pnpm-lock.yaml"), {
encoding: "utf8"
});
const content = JSON.parse(rawContent);
if (content.match(/localhost:487/)) {
errors.push(
Expand Down
3 changes: 2 additions & 1 deletion packages/git-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
},
"devDependencies": {
"@types/inquirer": "9.0.6",
"@types/prettier": "3.0.0"
"@types/prettier": "3.0.0",
"nx": "17.2.8"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/testing-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"type": "commonjs",
"main": "./index.cjs",
"dependencies": {
"@nx/jest": "17.0.3"
"@nx/jest": "17.2.8"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/workspace-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"dependencies": {
"@anatine/esbuild-decorators": "^0.2.19",
"@microsoft/api-extractor": "^7.38.3",
"@nx/devkit": "17.0.3",
"@nx/esbuild": "17.0.3",
"@nx/devkit": "17.2.8",
"@nx/esbuild": "17.2.8",
"@nxkit/style-dictionary": "^4.0.0",
"@rollup/plugin-json": "^6.0.1",
"chalk": "4.1.0",
Expand Down
54 changes: 27 additions & 27 deletions packages/workspace-tools/src/generators/preset/generator.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import * as path from "path";
import * as path from "node:path";
import {
Tree,
type Tree,
addDependenciesToPackageJson,
addProjectConfiguration,
formatFiles,
generateFiles,
joinPathFragments,
updateJson,
updateJson
} from "@nx/devkit";
import { withRunGenerator } from "../../base/base-generator";
import { nodeVersion, pnpmVersion, typescriptVersion } from "../../utils/versions";
import { PresetGeneratorSchema } from "./schema";
import type { PresetGeneratorSchema } from "./schema";

export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSchema) {
const projectRoot = ".";
Expand All @@ -29,10 +29,10 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
options: {
port: 4873,
config: ".verdaccio/config.yml",
storage: "tmp/local-registry/storage",
},
},
},
storage: "tmp/local-registry/storage"
}
}
}
});

updateJson(tree, "package.json", (json) => {
Expand All @@ -58,25 +58,25 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
"strapi",
"graphql",
"sullivanpj",
"monorepo",
"monorepo"
];

json.homepage ??= "https://stormsoftware.org";
json.bugs ??= {
url: "https://stormsoftware.org/support",
email: "support@stormsoftware.org",
email: "support@stormsoftware.org"
};

json.license = "Apache License 2.0";
json.author ??= {
name: "Storm Software",
email: "contact@stormsoftware.org",
url: "https://stormsoftware.org",
url: "https://stormsoftware.org"
};

json.funding ??= {
type: "github",
url: "https://github.com/sponsors/storm-software",
url: "https://github.com/sponsors/storm-software"
};

json.namespace ??= `@${options.namespace}`;
Expand All @@ -85,7 +85,7 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
options.repositoryUrl ??= `https://github.com/${options.organization}/${options.name}}`;
json.repository ??= {
type: "github",
url: `${options.repositoryUrl}.git`,
url: `${options.repositoryUrl}.git`
};

// generate a start script into the package.json
Expand Down Expand Up @@ -156,7 +156,7 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
json.packageManager ??= `pnpm@${pnpmVersion}`;
json.engines = {
node: `>=${nodeVersion}`,
pnpm: `>=${pnpmVersion}`,
pnpm: `>=${pnpmVersion}`
};

json.prettier = "@storm-software/linting-tools/prettier/config.json";
Expand All @@ -166,21 +166,21 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
files: [
{
path: "dist/*/*.js",
maxSize: "200kB",
},
maxSize: "200kB"
}
],
ci: {
trackBranches: ["main", "alpha", "beta"],
},
trackBranches: ["main", "alpha", "beta"]
}
};

json.nextBundleAnalysis = {
buildOutputDirectory: "dist/apps/web/app/.next",
buildOutputDirectory: "dist/apps/web/app/.next"
};
}

json.nx = {
includedScripts: ["lint", "format"],
includedScripts: ["lint", "format"]
};

return json;
Expand All @@ -189,14 +189,14 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
generateFiles(tree, path.join(__dirname, "files"), projectRoot, {
...options,
pnpmVersion,
nodeVersion,
nodeVersion
});
await formatFiles(tree);

let dependencies: Record<string, string> = {
"@nx/devkit": "^17.0.3",
"@nx/jest": "^17.0.3",
"@nx/js": "^17.0.3",
"@nx/devkit": "^17.2.8",
"@nx/jest": "^17.2.8",
"@nx/js": "^17.2.8",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/exec": "^6.0.3",
Expand Down Expand Up @@ -230,7 +230,7 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
tslib: "^2.6.2",
terser: "^5.24.0",
typescript: typescriptVersion,
verdaccio: "^5.27.0",
verdaccio: "^5.27.0"
};
if (options.includeApps) {
dependencies = {
Expand All @@ -243,14 +243,14 @@ export async function presetGeneratorFn(tree: Tree, options: PresetGeneratorSche
"@nx/react": "latest",
"@nx/next": "latest",
"@nx/node": "latest",
"@nx/storybook": "latest",
"@nx/storybook": "latest"
};
}

if (options.nxCloud) {
dependencies = {
...dependencies,
"nx-cloud": "latest",
"nx-cloud": "latest"
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export const eslintVersion = "~8.53.0";
export const lintStagedVersion = "15.0.2";
export const semanticReleaseVersion = "22.0.7";

export const nxVersion = "^17.0.3";
export const nxVersion = "^17.2.8";
export const nodeVersion = "18.17.1";
export const pnpmVersion = "8.10.2";
Loading

0 comments on commit 3740dc2

Please sign in to comment.