diff --git a/.changeset/fair-rockets-sneeze.md b/.changeset/fair-rockets-sneeze.md new file mode 100644 index 0000000..6851342 --- /dev/null +++ b/.changeset/fair-rockets-sneeze.md @@ -0,0 +1,5 @@ +--- +'pliny': patch +--- + +export modules from root and use only named exports diff --git a/.changeset/nine-impalas-approve.md b/.changeset/nine-impalas-approve.md new file mode 100644 index 0000000..2c846ef --- /dev/null +++ b/.changeset/nine-impalas-approve.md @@ -0,0 +1,7 @@ +--- +'@pliny/cli': patch +'@pliny/installer': patch +'pliny': patch +--- + +update dependencies diff --git a/.gitignore b/.gitignore index 0820bbf..623a3c8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,17 @@ package-lock.json build dist .rpt2_cache +packages/pliny/analytics +packages/pliny/comments +packages/pliny/config +packages/pliny/mdx-components +packages/pliny/mdx-plugins +packages/pliny/newsletter +packages/pliny/search +packages/pliny/seo +packages/pliny/ui +packages/pliny/utils +packages/pliny/chunk-* # misc .DS_Store diff --git a/package.json b/package.json index 3116dd5..db563c3 100644 --- a/package.json +++ b/package.json @@ -31,14 +31,13 @@ ] }, "devDependencies": { - "@changesets/cli": "^2.22.0", - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^8.0.0", - "@types/webpack": "^4.41.26", + "@changesets/cli": "^2.24.0", + "@commitlint/cli": "^17.0.0", + "@commitlint/config-conventional": "^17.1.0", "husky": "^8.0.0", - "lint-staged": "^11.0.0", - "prettier": "^2.2.1", - "turbo": "1.2.9", + "lint-staged": "^13.0.0", + "prettier": "^2.7.0", + "turbo": "1.4.6", "vitest": "0.12.6" }, "workspaces": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 4e752a1..d332afa 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -19,22 +19,22 @@ "/oclif.manifest.json" ], "dependencies": { - "@oclif/core": "1.9.0", + "@oclif/core": "1.16.1", "@oclif/plugin-autocomplete": "1.3.0", "@oclif/plugin-help": "5.1.12", "@oclif/plugin-not-found": "2.3.1", "@oclif/plugin-plugins": "2.1.0", - "@oclif/plugin-version": "1.0.4", + "@oclif/plugin-version": "1.1.2", "@pliny/installer": "^0.0.3", "camelcase": "^6.2.0", "chalk": "^4.1.0", - "console-table-printer": "^2.7.5", + "console-table-printer": "^2.11.1", "cross-spawn": "7.0.3", "dotenv-expand": "^5.1.0", "enquirer": "2.3.6", "esm": "3.2.25", "find-up": "5.0.0", - "fs-extra": "^9.1.0", + "fs-extra": "^10.1.0", "global-agent": "2.2.0", "got": "^11.8.1", "has-yarn": "2.1.0", @@ -47,17 +47,17 @@ "rimraf": "^3.0.2", "semver": "7.3.4", "tar": "^6.1.11", - "ts-node": "10.8.0", - "tsconfig-paths": "3.9.0", - "tslog": "^3.1.1", + "ts-node": "10.9.1", + "tsconfig-paths": "4.1.0", + "tslog": "^3.3.4", "v8-compile-cache": "2.3.0" }, "devDependencies": { "nock": "13.0.6", - "oclif": "^3", + "oclif": "3.2.1", "stdout-stderr": "0.1.13", - "tsup": "6.1.2", - "typescript": "^4.6.2" + "tsup": "6.2.3", + "typescript": "^4.8.3" }, "oclif": { "commands": "./dist/commands", diff --git a/packages/cli/test/commands/new.test.ts b/packages/cli/test/commands/new.test.ts index 8c309d2..e5e43eb 100644 --- a/packages/cli/test/commands/new.test.ts +++ b/packages/cli/test/commands/new.test.ts @@ -110,8 +110,7 @@ describe('`new` command', () => { 'pages/_app.tsx', 'tsconfig.json', 'next-env.d.ts', - '.eslintrc.json', - 'node_modules/next', + '.eslintrc.js', '.gitignore', ] diff --git a/packages/config/eslint.js b/packages/config/eslint.js index f976f5c..499a816 100644 --- a/packages/config/eslint.js +++ b/packages/config/eslint.js @@ -34,8 +34,7 @@ module.exports = { '@typescript-eslint/ban-ts-ignore': 0, '@typescript-eslint/ban-types': 0, '@typescript-eslint/no-var-requires': 0, - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars-experimental': ['warn'], + '@typescript-eslint/no-unused-vars': 'warn', '@typescript-eslint/no-use-before-define': ['error', { variables: false, functions: false }], 'space-before-function-paren': 0, 'no-plusplus': 0, diff --git a/packages/config/package.json b/packages/config/package.json index 7b79e93..562ea7f 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -4,12 +4,12 @@ "license": "MIT", "private": true, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.28.1", - "eslint": "^7.29.0", - "eslint-config-next": "12.1.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-prettier": "^3.3.1", - "typescript": "^4.6.2" + "@typescript-eslint/eslint-plugin": "^5.36.2", + "eslint": "^8.23.0", + "eslint-config-next": "12.3.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-jsx-a11y": "^6.6.1", + "eslint-plugin-prettier": "^4.2.1", + "typescript": "^4.8.3" } } diff --git a/packages/installer/package.json b/packages/installer/package.json index 18aa09f..9318fdf 100644 --- a/packages/installer/package.json +++ b/packages/installer/package.json @@ -22,8 +22,8 @@ "url": "git+https://github.com/timlrx/pliny.git" }, "dependencies": { - "@babel/core": "7.18.0", - "@babel/plugin-transform-typescript": "7.18.1", + "@babel/core": "7.19.0", + "@babel/plugin-transform-typescript": "7.19.0", "@types/jscodeshift": "0.11.5", "ast-types": "0.14.2", "console-table-printer": "^2.7.5", @@ -31,7 +31,7 @@ "diff": "5.0.0", "enquirer": "2.3.6", "execa": "6.1.0", - "fs-extra": "^9.1.0", + "fs-extra": "^10.1.0", "globby": "11.0.2", "ink": "3.2.0", "ink-spinner": "4.0.3", @@ -42,15 +42,15 @@ "ora": "5.4.1", "pluralize": "^8.0.0", "react": "17.0.2", - "recast": "0.20.5", + "recast": "0.21.2", "rimraf": "^3.0.2", - "tslog": "^3.1.1", + "tslog": "^3.3.4", "vinyl": "2.2.1" }, "devDependencies": { - "contentlayer": "0.2.5", - "tsup": "6.1.2", - "typescript": "^4.6.2" + "contentlayer": "0.2.8", + "tsup": "6.2.3", + "typescript": "^4.8.3" }, "publishConfig": { "access": "public" diff --git a/packages/installer/test/executors/executor.test.tsx b/packages/installer/test/executors/executor.test.tsx index d7e3c8a..aa25576 100644 --- a/packages/installer/test/executors/executor.test.tsx +++ b/packages/installer/test/executors/executor.test.tsx @@ -14,7 +14,7 @@ describe('Executor', () => { it('should render Frontmatter', () => { const { lastFrame } = render() - expect(stripAnsi(lastFrame())).toMatchSnapshot() + expect(stripAnsi(lastFrame() as string)).toMatchSnapshot() }) it('should contain a step name and explanation', () => { diff --git a/packages/installer/test/executors/print-message-executor.test.tsx b/packages/installer/test/executors/print-message-executor.test.tsx index 0212200..7e541cb 100644 --- a/packages/installer/test/executors/print-message-executor.test.tsx +++ b/packages/installer/test/executors/print-message-executor.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-function */ import { expect, describe, it } from 'vitest' import { render } from 'ink-testing-library' import React from 'react' @@ -15,20 +16,20 @@ describe('Executor', () => { it('should render PrintMessageExecutor', () => { const { lastFrame } = render( {}} step={executorConfig} /> ) - expect(stripAnsi(lastFrame())).toMatchSnapshot() + expect(stripAnsi(lastFrame() as string)).toMatchSnapshot() }) it('should contain a step name and explanation', () => { const { frames } = render( {}} step={executorConfig} diff --git a/packages/pliny/.eslintrc.js b/packages/pliny/.eslintrc.cjs similarity index 100% rename from packages/pliny/.eslintrc.js rename to packages/pliny/.eslintrc.cjs diff --git a/packages/pliny/package.json b/packages/pliny/package.json index 747b31c..bca0a3e 100644 --- a/packages/pliny/package.json +++ b/packages/pliny/package.json @@ -3,104 +3,48 @@ "description": "Main entry point for pliny components and CLI", "homepage": "https://github.com/timlrx/pliny", "version": "0.0.5", - "main": "./dist/index.mjs", + "type": "module", "exports": { - "./analytics": "./dist/analytics/index.mjs", - "./analytics/": "./dist/analytics/", - "./comments": "./dist/comments/index.mjs", - "./comments/": "./dist/comments/", - "./search": "./dist/search/index.mjs", - "./search/": "./dist/search/", - "./config": "./dist/config/index.mjs", - "./mdx-components": "./dist/mdx-components/index.mjs", - "./mdx-plugins": "./dist/mdx-plugins/index.mjs", - "./mdx-plugins/": "./dist/mdx-plugins/", - "./newsletter": "./dist/newsletter/index.mjs", - "./newsletter/": "./dist/newsletter/", - "./seo": "./dist/seo/index.mjs", - "./ui/": "./dist/ui/", - "./utils/": "./dist/utils/" + "./analytics": "./analytics/index.js", + "./comments": "./comments/index.js", + "./search": "./search/index.js", + "./config": "./config/index.js", + "./mdx-components": "./mdx-components/index.js", + "./mdx-plugins": "./mdx-plugins/index.js", + "./newsletter": "./newsletter/index.js", + "./seo": "./seo/index.js", + "./ui/*": "./ui/*", + "./utils/*": "./utils/*" }, - "source": "src/index.js", "files": [ - "/bin", - "/dist/**" + "**" ], - "typesVersions": { - "*": { - "analytics": [ - "dist/analytics" - ], - "analytics/*": [ - "dist/analytics/*" - ], - "comments": [ - "dist/comments" - ], - "comments/*": [ - "dist/comments/*" - ], - "search": [ - "dist/search" - ], - "search/*": [ - "dist/search/*" - ], - "config": [ - "dist/config" - ], - "mdx-components": [ - "dist/mdx-components" - ], - "mdx-plugins": [ - "dist/mdx-plugins" - ], - "mdx-plugins/*": [ - "dist/mdx-plugins/*" - ], - "newsletter": [ - "dist/newsletter" - ], - "newsletter/*": [ - "dist/newsletter/*" - ], - "seo": [ - "dist/seo" - ], - "ui/*": [ - "dist/ui/*" - ], - "utils/*": [ - "dist/utils/*" - ] - } - }, "scripts": { - "dev": "tsup-node src/**/* --watch --inject ./react-import.js --format esm --dts --silent", - "build": "rimraf dist && tsup-node src/**/* --inject ./react-import.js --format esm --dts --silent" + "dev": "tsup-node src/**/* --watch --inject ./react-import.js --format esm --splitting --treeshake --dts --silent && cp -fR dist/* && rimraf dist", + "build": "rimraf dist && tsup-node src/**/* --inject ./react-import.js --format esm --splitting --treeshake --dts --silent && cp -fR dist/* ./ && rimraf dist" }, "author": "Timothy Lin (https://timlrx.com)", "dependencies": { - "@docsearch/react": "^3.1.0", - "contentlayer": "0.2.5", - "github-slugger": "^1.3.0", + "@docsearch/react": "^3.2.0", + "contentlayer": "0.2.8", + "github-slugger": "^1.4.0", "image-size": "1.0.0", "js-yaml": "4.1.0", "kbar": "0.1.0-beta.36", - "next-contentlayer": "0.2.5", + "next-contentlayer": "0.2.8", "remark": "^14.0.2", - "unist-util-visit": "^4.0.0" + "unist-util-visit": "^4.1.0" }, "peerDependencies": { "next": ">=12.0.0", - "react": "17.0.2", - "react-dom": "17.0.2" + "react": "^17.0.2 || ^18.0.0", + "react-dom": "^17.0.2 || ^18.0.0" }, "devDependencies": { "@mailchimp/mailchimp_marketing": "^3.0.75", "rimraf": "^3.0.2", - "tsup": "6.1.2", - "typescript": "^4.6.2" + "tsup": "6.2.3", + "typescript": "^4.8.3" }, "lint-staged": { "*.+(js|jsx|ts|tsx)": [ diff --git a/packages/pliny/src/analytics/GoogleAnalytics.tsx b/packages/pliny/src/analytics/GoogleAnalytics.tsx index d68c2a5..4a93f87 100644 --- a/packages/pliny/src/analytics/GoogleAnalytics.tsx +++ b/packages/pliny/src/analytics/GoogleAnalytics.tsx @@ -4,7 +4,7 @@ export interface GoogleAnalyticsProps { googleAnalyticsId: string } -const GoogleAnalytics = ({ googleAnalyticsId }: GoogleAnalyticsProps) => { +export const GA = ({ googleAnalyticsId }: GoogleAnalyticsProps) => { return ( <>