Skip to content

Commit

Permalink
Merge 60ee91e into 5e4387c
Browse files Browse the repository at this point in the history
  • Loading branch information
norskeld committed Oct 14, 2022
2 parents 5e4387c + 60ee91e commit 33a6371
Show file tree
Hide file tree
Showing 10 changed files with 9,093 additions and 7,315 deletions.
8 changes: 7 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [{ "scope": "no-release", "release": false }]
}
],
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }],
["@semantic-release/npm", { "pkgRoot": "dist" }],
Expand Down
16,229 changes: 9,034 additions & 7,195 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 18 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "@nrsk/shikigami",
"version": "1.1.2",
"description": "Opinionated syntax highlighting with shiki for markdown-it.",
"packageManager": "npm@8.10.0",
"sideEffects": false,
"type": "module",
"main": "./index.cjs",
"module": "./index.mjs",
"types": "./index.d.ts",
Expand All @@ -20,19 +22,16 @@
"*.mjs*"
],
"engines": {
"node": ">=14.17.0"
"node": "^14.16.0 || ^16.10.0 || ^18.0.0"
},
"scripts": {
"build": "npm run build:types && npm run build:rollup",
"build:types": "tsc -p tsconfig.types.json",
"build:rollup": "node --require tsm scripts/compile.ts",
"fmt:prettier": "prettier --write \"**/*.{js,ts,json}\"",
"build": "tsup",
"fmt:lint": "eslint --fix --ext .js,.ts .",
"postbuild": "rimraf dist/types",
"postversion": "node --require tsm ../scripts/release.ts restore",
"fmt:prettier": "prettier --write \"**/*.{js,ts,json}\"",
"postversion": "tsx ../scripts/release.ts restore",
"prebuild": "rimraf dist",
"prepare": "is-ci || husky install",
"prerelease": "node --require tsm scripts/release.ts prepare",
"prerelease": "tsx scripts/release.ts prepare",
"release": "npx semantic-release",
"release:dry": "npx semantic-release --dry-run",
"test": "jest",
Expand Down Expand Up @@ -67,29 +66,28 @@
"shiki": "^0.10.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.2",
"@commitlint/cli": "^17.1.2",
"@nrsk/config-conventional": "^1.0.0",
"@rollup/plugin-typescript": "^8.3.3",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/is-ci": "^3.0.0",
"@types/jest": "^28.1.1",
"@types/markdown-it": "^12.2.3",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"eslint": "^8.17.0",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"husky": "^8.0.1",
"is-ci": "^3.0.1",
"jest": "^28.1.1",
"lint-staged": "^13.0.1",
"prettier": "^2.6.2",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"rollup": "^2.75.6",
"rollup-plugin-dts": "^4.2.2",
"semantic-release": "^19.0.3",
"semantic-release": "^19.0.5",
"ts-jest": "^28.0.4",
"tsm": "^2.2.1",
"typescript": "^4.7.3"
"tsup": "^6.2.3",
"tsx": "^3.10.1",
"typescript": "^4.8.4"
},
"commitlint": {
"extends": [
Expand Down
83 changes: 0 additions & 83 deletions scripts/compile.ts

This file was deleted.

2 changes: 2 additions & 0 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async function main() {

// Copy necessary files.
await copyFile(`${cwd}/package.json`, `${cwd}/dist/package.json`)
await copyFile(`${cwd}/package-lock.json`, `${cwd}/dist/package-lock.json`)
await copyFile(`${cwd}/CHANGELOG.md`, `${cwd}/dist/CHANGELOG.md`)
await copyFile(`${cwd}/README.md`, `${cwd}/dist/README.md`)
await copyFile(`${cwd}/LICENSE`, `${cwd}/dist/LICENSE`)
Expand All @@ -81,6 +82,7 @@ async function main() {
try {
// Copy back.
await copyFile(`${cwd}/package.json`, resolve(cwd, '..', 'package.json'))
await copyFile(`${cwd}/package-lock.json`, resolve(cwd, '..', 'package-lock.json'))

return {
kind: 'success',
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function merge<T extends AnyObject, U extends AnyObject>(target: T, sourc
})
}

return output as U
return output as unknown as U
}

export function groupBy<T, K>(elements: Array<T>, getter: (element: T) => K): Map<K, Array<T>> {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src", "scripts"],
"exclude": ["dist", "node_modules", "**/*.spec.ts", "**/__tests__/**/*.ts"]
"include": ["scripts", "src"]
}
4 changes: 0 additions & 4 deletions tsconfig.rollup.json

This file was deleted.

9 changes: 0 additions & 9 deletions tsconfig.types.json

This file was deleted.

30 changes: 30 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import isCI from 'is-ci'
import { defineConfig, type Options } from 'tsup'

const entry = 'src/index.ts'

const sharedConfig = defineConfig({
splitting: false,
sourcemap: true,
format: ['esm', 'cjs'],
treeshake: true,
minify: isCI,
bundle: true
})

const mainConfig = defineConfig({
...sharedConfig,
entry: [entry],
dts: false
}) as Options

const dtsConfig = defineConfig({
...sharedConfig,
entry: [entry],
dts: {
entry,
only: true
}
}) as Options

export default defineConfig([mainConfig, dtsConfig])

0 comments on commit 33a6371

Please sign in to comment.