Skip to content

Commit

Permalink
Merge pull request #19 from ssssota/migrate-to-biome
Browse files Browse the repository at this point in the history
chore: migrate to biome from rome
  • Loading branch information
ssssota authored Sep 12, 2023
2 parents 53971bf + 1a96109 commit 925c5e7
Show file tree
Hide file tree
Showing 23 changed files with 415 additions and 422 deletions.
21 changes: 12 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "ssssota/typedotenv" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "ssssota/typedotenv" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 1 addition & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"recommendations": [
"rome.rome",
"svelte.svelte-vscode"
]
"recommendations": ["biomejs.biome", "svelte.svelte-vscode"]
}
19 changes: 10 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"editor.defaultFormatter": "rome.rome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"files.associations": {
".env.*": "properties"
}
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports.biome": true,
"quickfix.biome": true
},
"files.associations": {
".env.*": "properties"
}
}
15 changes: 15 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true
},
"files": {
"ignore": ["./**/dist/**/*", "./www/src/env.ts", "./**/node_modules/**/*"]
}
}
66 changes: 31 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
{
"name": "typedotenv",
"private": true,
"version": "0.1.0",
"description": "All in One typedotenv (dotenv utility for TypeScript)",
"type": "module",
"scripts": {
"test": "pnpm -r test",
"fmt": "rome format .",
"check": "rome ci .",
"build": "pnpm -r build",
"changeset": "changeset",
"changeset:release": "pnpm build && changeset publish",
"changeset:version": "changeset version && pnpm install --lockfile-only"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ssssota/typedotenv.git"
},
"keywords": [
"dotenv",
"typescript",
"code-generator"
],
"author": "TOMIKAWA Sotaro",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/ssssota/typedotenv/issues"
},
"homepage": "https://github.com/ssssota/typedotenv#readme",
"packageManager": "[email protected]",
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0",
"rome": "^11.0.0"
}
"name": "typedotenv",
"private": true,
"version": "0.1.0",
"description": "All in One typedotenv (dotenv utility for TypeScript)",
"type": "module",
"scripts": {
"test": "pnpm -r test",
"fmt": "biome format --write .",
"check": "biome ci .",
"build": "pnpm -r build",
"changeset": "changeset",
"changeset:release": "pnpm build && changeset publish",
"changeset:version": "changeset version && pnpm install --lockfile-only"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ssssota/typedotenv.git"
},
"keywords": ["dotenv", "typescript", "code-generator"],
"author": "TOMIKAWA Sotaro",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/ssssota/typedotenv/issues"
},
"homepage": "https://github.com/ssssota/typedotenv#readme",
"packageManager": "[email protected]",
"devDependencies": {
"@biomejs/biome": "^1.1.2",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0"
}
}
90 changes: 41 additions & 49 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
{
"name": "@typedotenv/cli",
"version": "0.3.0",
"description": "CLI tool for typedotenv (dotenv utility for TypeScript)",
"type": "module",
"bin": {
"typedotenv": "dist/index.cjs"
},
"files": [
"dist"
],
"scripts": {
"dev": "tsx src/index.ts",
"build": "tsx build.ts",
"test": "pnpm build && vitest run",
"watch": "pnpm build && vitest",
"fmt": "pnpm -w fmt",
"check": "pnpm -w check && tsc --noEmit",
"prepack": "pnpm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ssssota/typedotenv.git"
},
"keywords": [
"dotenv",
"typescript",
"code-generator",
"cli",
"tool"
],
"author": "TOMIKAWA Sotaro",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/ssssota/typedotenv/issues"
},
"homepage": "https://github.com/ssssota/typedotenv#readme",
"packageManager": "[email protected]",
"devDependencies": {
"@types/node": "^18.13.0",
"@commander-js/extra-typings": "^10.0.2",
"@typedotenv/core": "workspace:*",
"commander": "^10.0.0",
"esbuild": "^0.17.8",
"rome": "^11.0.0",
"tsx": "^3.12.3",
"typescript": "^4.9.5",
"vitest": "^0.28.5",
"dotenv": "^16.0.3"
}
"name": "@typedotenv/cli",
"version": "0.3.0",
"description": "CLI tool for typedotenv (dotenv utility for TypeScript)",
"type": "module",
"bin": {
"typedotenv": "dist/index.cjs"
},
"files": ["dist"],
"scripts": {
"dev": "tsx src/index.ts",
"build": "tsx build.ts",
"test": "pnpm build && vitest run",
"watch": "pnpm build && vitest",
"fmt": "pnpm -w fmt",
"check": "pnpm -w check && tsc --noEmit",
"prepack": "pnpm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ssssota/typedotenv.git"
},
"keywords": ["dotenv", "typescript", "code-generator", "cli", "tool"],
"author": "TOMIKAWA Sotaro",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/ssssota/typedotenv/issues"
},
"homepage": "https://github.com/ssssota/typedotenv#readme",
"packageManager": "[email protected]",
"devDependencies": {
"@biomejs/biome": "^1.1.2",
"@commander-js/extra-typings": "^10.0.2",
"@typedotenv/core": "workspace:*",
"@types/node": "^18.13.0",
"commander": "^10.0.0",
"dotenv": "^16.0.3",
"esbuild": "^0.17.8",
"tsx": "^3.12.3",
"typescript": "^5.2.2",
"vitest": "^0.28.5"
}
}
8 changes: 5 additions & 3 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as path from "path";
import {
createCommand,
type Command,
type OptionValues,
createCommand,
} from "@commander-js/extra-typings";
import { generate } from "@typedotenv/core";
import * as fs from "fs/promises";
import * as path from "path";
import * as process from "process";

type Options = {
Expand Down Expand Up @@ -87,7 +87,7 @@ const generateCodeFromOptions = async ({
envObject,
enableTypeAssertion,
disableRuntimeTypeCheck: disableTypeCheck,
accessFromIndexSignature
accessFromIndexSignature,
});
};

Expand Down Expand Up @@ -136,7 +136,9 @@ const checkCommand = applyGenerateOptions(
});

const command = createCommand("typedotenv")
// biome-ignore lint/style/noNonNullAssertion: <explanation>
.version(process.env.npm_package_version!)
// biome-ignore lint/style/noNonNullAssertion: <explanation>
.description(process.env.npm_package_description!)
.addCommand(generateCommand)
.addCommand(checkCommand)
Expand Down
104 changes: 49 additions & 55 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,51 @@
{
"name": "@typedotenv/core",
"version": "0.2.0",
"description": "typedotenv core library (dotenv utility for TypeScript)",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js"
},
"./*": "./*"
},
"files": [
"dist"
],
"scripts": {
"clean": "node -e 'fs.rmSync(`dist`, {recursive:true, force:true})'",
"build": "tsup && tsx postbuild.ts",
"test": "vitest run",
"watch": "vitest",
"fmt": "pnpm -w fmt",
"check": "pnpm -w check && tsc --noEmit",
"prepack": "pnpm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ssssota/typedotenv.git"
},
"keywords": [
"dotenv",
"typescript",
"code-generator"
],
"author": "TOMIKAWA Sotaro",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/ssssota/typedotenv/issues"
},
"homepage": "https://github.com/ssssota/typedotenv#readme",
"packageManager": "[email protected]",
"devDependencies": {
"dotenv": "^16.0.3",
"fast-glob": "^3.2.12",
"rome": "^11.0.0",
"tsup": "^6.6.3",
"tsx": "^3.12.3",
"typescript": "^4.9.5",
"vitest": "^0.28.5"
},
"peerDependencies": {
"dotenv": "^16.0.0"
}
"name": "@typedotenv/core",
"version": "0.2.0",
"description": "typedotenv core library (dotenv utility for TypeScript)",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.js"
},
"./*": "./*"
},
"files": ["dist"],
"scripts": {
"clean": "node -e 'fs.rmSync(`dist`, {recursive:true, force:true})'",
"build": "tsup && tsx postbuild.ts",
"test": "vitest run",
"watch": "vitest",
"fmt": "pnpm -w fmt",
"check": "pnpm -w check && tsc --noEmit",
"prepack": "pnpm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ssssota/typedotenv.git"
},
"keywords": ["dotenv", "typescript", "code-generator"],
"author": "TOMIKAWA Sotaro",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/ssssota/typedotenv/issues"
},
"homepage": "https://github.com/ssssota/typedotenv#readme",
"packageManager": "[email protected]",
"devDependencies": {
"@biomejs/biome": "^1.1.2",
"dotenv": "^16.0.3",
"fast-glob": "^3.2.12",
"tsup": "^6.6.3",
"tsx": "^3.12.3",
"typescript": "^5.2.2",
"vitest": "^0.28.5"
},
"peerDependencies": {
"dotenv": "^16.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/core/postbuild.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fg from "fast-glob";
import { promises as fs } from "fs";
import { resolve } from "path";
import { basename } from "path/posix";
import { fileURLToPath } from "url";
import fg from "fast-glob";
import { basename } from "path/posix";

async function run() {
// fix cjs exports
Expand Down
Loading

0 comments on commit 925c5e7

Please sign in to comment.