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
2 changes: 2 additions & 0 deletions .config/csharpier/.csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*
!**/*.cs
3 changes: 2 additions & 1 deletion .config/cspell/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"enableGlobDot": true,
"useGitignore": true,
"gitignoreRoot": ".",
"ignorePaths": ["LICENSE"],
"ignorePaths": ["LICENSE", "local.env"],
"words": [
"csharpierignore",
"csharpierrc",
"devcontainer",
"devcontainers",
Expand Down
4 changes: 2 additions & 2 deletions .config/dotnet/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.28.2",
"commands": ["dotnet-csharpier"],
"version": "1.0.0",
"commands": ["csharpier"],
"rollForward": false
}
}
Expand Down
1 change: 1 addition & 0 deletions .config/git/ignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ _*
!**/.devcontainer/**
!.config/
!**/.config/**
local.env

node_modules/

Expand Down
2 changes: 1 addition & 1 deletion .config/prettier/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"printWidth": 120,
"plugins": ["prettier-plugin-packagejson", "@prettier/plugin-xml", "prettier-plugin-ini"],
"plugins": ["prettier-plugin-packagejson", "prettier-plugin-sh", "@prettier/plugin-xml", "prettier-plugin-ini"],
"xmlWhitespaceSensitivity": "ignore",
"overrides": [
{ "files": "app.manifest", "options": { "parser": "xml" } },
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ services:
devcontainer:
env_file:
- .env
- path: local.env
required: false
build:
context: .
dockerfile: Dockerfile
Expand Down
3 changes: 0 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"cSpell.autoFormatConfigFile": true,
"cSpell.checkOnlyEnabledFileTypes": false,
"editor.codeActionsOnSave": {
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/dot-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"eslint.config.ts": "eslint.config.ts"
},
"csharpier": {
".csharpierrc.json": ".csharpierrc.json"
".csharpierrc.json": ".csharpierrc.json",
".csharpierignore": ".csharpierignore"
},
"dotnet": {
"tools.json": ".config/dotnet-tools.json"
Expand Down
59 changes: 28 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,53 @@
"lint": "pnpm node scripts/lint.ts",
"node": "vite-node scripts/node.ts",
"publish": "pnpm node scripts/publish.ts",
"push": "pnpm node scripts/push.ts",
"restore": "pnpm node scripts/restore.ts",
"test": "pnpm node scripts/test.ts",
"update": "pnpm node scripts/update.ts"
},
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
"@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.22.0",
"@commander-js/extra-typings": "^14.0.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.28.0",
"@prettier/plugin-xml": "^3.4.1",
"@tsconfig/node22": "^22.0.0",
"@vitest/eslint-plugin": "^1.1.37",
"commander": "~13.1.0",
"cspell": "^8.17.5",
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.1",
"@tsconfig/node22": "^22.0.2",
"@vitest/eslint-plugin": "^1.2.1",
"commander": "~14.0.0",
"cspell": "^9.0.2",
"eslint": "^9.28.0",
"eslint-config-prettier": "^10.1.5",
"eslint-flat-config-gitignore": "^3.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.16.2",
"eslint-plugin-n": "^17.19.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^57.0.0",
"execa": "^9.5.2",
"glob": "^11.0.1",
"globals": "^16.0.0",
"isomorphic-git": "1.29.0",
"eslint-plugin-unicorn": "^59.0.1",
"execa": "^9.6.0",
"glob": "^11.0.2",
"globals": "^16.2.0",
"isomorphic-git": "1.30.2",
"jiti": "^2.4.2",
"prettier": "^3.5.3",
"prettier-plugin-ini": "^1.3.0",
"prettier-plugin-packagejson": "^2.5.10",
"semver": "^7.7.1",
"syncpack": "^13.0.3",
"type-fest": "^4.37.0",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.2.2",
"vite-node": "^3.0.8",
"prettier-plugin-packagejson": "^2.5.15",
"prettier-plugin-sh": "^0.17.4",
"semver": "^7.7.2",
"syncpack": "^13.0.4",
"type-fest": "^4.41.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.33.1",
"vite": "^6.3.5",
"vite-node": "^3.2.1",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.8"
"vitest": "^3.2.1"
},
"devDependencies": {
"@types/eslint": "^9.6.1",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^22.13.10",
"@types/semver": "^7.5.8"
"@types/node": "^22.15.29",
"@types/semver": "^7.7.0"
},
"engines": {
"node": ">=22"
},
"pnpm": {
"overrides": {
"syncpack>@effect/schema": "npm:effect@^3.13.11"
}
}
}
1 change: 1 addition & 0 deletions scripts/installPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ process.env.NODE_ENV = "production";
const installPath = path.resolve(XDG_DATA_HOME, pkg.name);
await rm(installPath, { recursive: true, force: true });
const $$ = $({ stdio: "inherit", verbose: "full", cwd: tempPath });
await $$`pnpm install`;
await $$`pnpm deploy --filter=${packageName} --prod ${installPath}`;
await $$`npm uninstall --global ${packageName}`;
await $$`npm install --global ${installPath}`;
Expand Down
29 changes: 29 additions & 0 deletions scripts/push.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import fs from "node:fs";

import git from "isomorphic-git";
import http from "isomorphic-git/http/node";

import { projectRoot } from "@/scripts/project.js";

const currentBranch = await git.currentBranch({ fs, dir: projectRoot, fullname: false });
if (!currentBranch) throw new Error("Failed to determine current branch");

const remote = (await git.listRemotes({ fs, dir: projectRoot })).at(0);
if (remote === undefined) {
throw new Error("Git remote not found");
}
const token = process.env.GIT_REMOTE_TOKEN;
if (!token) throw new Error("GIT_REMOTE_TOKEN environment variable is not set");

await git.push({
fs,
http,
dir: projectRoot,
remote: remote.remote,
ref: currentBranch,
force: true,
onAuth: () => ({
username: "git",
password: token,
}),
});
7 changes: 6 additions & 1 deletion setup/configs/base/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export interface BaseWorkspaceConfigs {
}

export const createBaseWorkspaceConfigs = async (): Promise<BaseWorkspaceConfigs> => {
const dependencies = await getNpmLatestDependencies(["cspell", "prettier", "prettier-plugin-packagejson"]);
const dependencies = await getNpmLatestDependencies([
"cspell",
"prettier",
"prettier-plugin-packagejson",
"prettier-plugin-sh",
]);
return {
"package.json": JSON.stringify({
private: true,
Expand Down
2 changes: 1 addition & 1 deletion setup/configs/csharp/automation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const createCSharpAutomationConfigs = async (): Promise<CSharpAutomationC

const { "channel-version": dotnetVersion } = await getDotNetCoreLatestLtsRelease();
content[0].Project[0].PropertyGroup[1].TargetFramework[0]["#text"] = `net${dotnetVersion}`;
return new XMLBuilder(options).build(content) as string;
return new XMLBuilder(options).build(content);
})();

templates["Automation/Automation.csproj"] = csproj;
Expand Down
5 changes: 4 additions & 1 deletion setup/configs/csharp/dotConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { mergeArrayComposer } from "../composer.js";
import { loadTemplates } from "../templates.js";

export interface CSharpDotConfigs {
".config/csharpier/.csharpierignore": string;
".config/csharpier/.csharpierrc.json": string;
".config/cspell/cspell.json": string;
".config/dotnet/.globalconfig": string;
Expand All @@ -22,6 +23,7 @@ export interface CSharpDotConfigs {

export const createCSharpDotConfigs = async (baseConfig: BaseConfigs): Promise<CSharpDotConfigs> => {
const templates = await loadTemplates("csharp", [
".config/csharpier/.csharpierignore",
".config/csharpier/.csharpierrc.json",
".config/cspell/cspell.json",
".config/dotnet/.globalconfig",
Expand All @@ -48,7 +50,7 @@ export const createCSharpDotConfigs = async (baseConfig: BaseConfigs): Promise<C
throw new Error("Cake.Frosting package not found in .config/dotnet/Packages.props");
}
cakeFrostingPackage[":@"]["@_Version"] = cakeFrostingVersion;
return new XMLBuilder(options).build(content) as string;
return new XMLBuilder(options).build(content);
})();

const toolsJson = await (async () => {
Expand All @@ -61,6 +63,7 @@ export const createCSharpDotConfigs = async (baseConfig: BaseConfigs): Promise<C
})();

return {
".config/csharpier/.csharpierignore": templates[".config/csharpier/.csharpierignore"],
".config/csharpier/.csharpierrc.json": templates[".config/csharpier/.csharpierrc.json"],
".config/cspell/cspell.json": JSON.stringify(
mergeArrayComposer(
Expand Down
2 changes: 1 addition & 1 deletion setup/configs/csharp/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const createCSharpWorkspaceConfigs = async (baseConfig: BaseConfigs): Pro

const msbuildTraversalVersion = await getNugetPackageLatestVersion(content[0].Project[0][":@"]["@_Name"]);
content[0].Project[0][":@"]["@_Version"] = msbuildTraversalVersion;
return new XMLBuilder(options).build(content) as string;
return new XMLBuilder(options).build(content);
})();
return {
"Directory.Build.props": templates["Directory.Build.props"],
Expand Down
3 changes: 3 additions & 0 deletions setup/configs/typescript/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export const createTypeScriptWorkspaceConfigs = async (
devDependencies: {
...devDependencies,
},
engines: {
node: `>=${nodeVersion}`,
},
}),
),
"tsconfig.json": templates["tsconfig.json"],
Expand Down
21 changes: 10 additions & 11 deletions setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,29 @@
"create-devcontainer": "./index.js"
},
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
"@commander-js/extra-typings": "^14.0.0",
"@prettier/plugin-xml": "^3.4.1",
"commander": "~13.1.0",
"cspell-lib": "^8.17.5",
"dedent": "^1.5.3",
"commander": "~14.0.0",
"cspell-lib": "^9.0.2",
"dedent": "^1.6.0",
"default-composer": "^0.6.0",
"fast-xml-parser": "^5.0.9",
"fast-xml-parser": "^5.2.3",
"jsonc-parser": "^3.3.1",
"lodash-es": "^4.17.21",
"node-fetch": "^3.3.2",
"oci-registry-client": "^0.2.0",
"pacote": "^21.0.0",
"prettier": "^3.5.3",
"prettier-plugin-ini": "^1.3.0",
"prettier-plugin-packagejson": "^2.5.10",
"semver": "^7.7.1",
"type-fest": "^4.37.0",
"prettier-plugin-packagejson": "^2.5.15",
"semver": "^7.7.2",
"type-fest": "^4.41.0",
"write-file-atomic": "^6.0.0"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.13.10",
"@types/node": "^22.15.29",
"@types/pacote": "^11.1.8",
"@types/semver": "^7.5.8",
"@types/semver": "^7.7.0",
"@types/write-file-atomic": "^4.0.3"
},
"engines": {
Expand Down
2 changes: 2 additions & 0 deletions setup/templates/base/.config/git/ignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ _*
!**/.devcontainer/**
!.config/
!**/.config/**

node_modules/
2 changes: 1 addition & 1 deletion setup/templates/base/.config/prettier/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"printWidth": 120,
"plugins": ["prettier-plugin-packagejson"]
"plugins": ["prettier-plugin-packagejson", "prettier-plugin-sh"]
}
3 changes: 0 additions & 3 deletions setup/templates/base/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"cSpell.autoFormatConfigFile": true,
"cSpell.checkOnlyEnabledFileTypes": false
}
Expand Down
2 changes: 2 additions & 0 deletions setup/templates/csharp/.config/csharpier/.csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*
!**/*.cs
2 changes: 1 addition & 1 deletion setup/templates/csharp/.config/cspell/cspell.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"words": ["csharpierrc", "globalconfig", "msbuild"]
"words": ["csharpierignore", "csharpierrc", "globalconfig", "msbuild"]
}
4 changes: 2 additions & 2 deletions setup/templates/csharp/.config/dotnet/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.28.2",
"commands": ["dotnet-csharpier"],
"version": "1.0.0",
"commands": ["csharpier"],
"rollForward": false
}
}
Expand Down
3 changes: 2 additions & 1 deletion setup/templates/csharp/.devcontainer/dot-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"csharpier": {
".csharpierrc.json": ".csharpierrc.json"
".csharpierrc.json": ".csharpierrc.json",
".csharpierignore": ".csharpierignore"
},
"dotnet": {
"tools.json": ".config/dotnet-tools.json"
Expand Down
4 changes: 2 additions & 2 deletions setup/templates/csharp/Automation/Tasks/CSharpier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ public class CSharpierCheck : FrostingTask<Context>
{
public override void Run(Context context)
{
context.DotNetTool($"csharpier {Context.ProjectRoot} --check");
context.DotNetTool($"csharpier check {Context.ProjectRoot}");
}
}

public class CSharpierFormat : FrostingTask<Context>
{
public override void Run(Context context)
{
context.DotNetTool($"csharpier {Context.ProjectRoot}");
context.DotNetTool($"csharpier format {Context.ProjectRoot}");
}
}
Loading