Skip to content

Commit

Permalink
internal: Migrate from beemo to moon. (#74)
Browse files Browse the repository at this point in the history
* Migrate prettier.

* Remove beemo.

* Migrate typescript.

* Migrate eslint.

* Remove beemo.

* Dedupe.
  • Loading branch information
milesj authored Sep 27, 2022
1 parent 33aff5c commit d649407
Show file tree
Hide file tree
Showing 27 changed files with 573 additions and 2,999 deletions.
19 changes: 0 additions & 19 deletions .config/beemo.ts

This file was deleted.

9 changes: 0 additions & 9 deletions .config/beemo/typescript.ts

This file was deleted.

16 changes: 16 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules/
build/
cjs/
coverage/
dist/
dts/
esm/
lib/
mjs/
umd/
*.d.ts
*.d.cts
*.d.mts
*.min.js
*.map
*.snap
14 changes: 7 additions & 7 deletions .config/beemo/eslint.ts → .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export default {
module.exports = {
root: true,
extends: ['moon', 'moon/react', 'moon/node'],
parserOptions: {
project: ['packages/plugin/tsconfig.json', 'website/tsconfig.json'],
tsconfigRootDir: __dirname,
},
rules: {
// Our components rely on a ton of composition
'react/jsx-no-literals': 'off',
Expand All @@ -15,11 +21,5 @@ export default {

// We import from the default theme but its not a dep
'import/no-extraneous-dependencies': 'off',

// We import CSS modules that are any
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
};
11 changes: 1 addition & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,8 @@ tmp/
*.min.js
*.map

# Beemo configs
.babelrc
.eslintignore
.eslintrc.js
.flowconfig
.prettierignore
*.config.js
*.config.ts
# Configs
*.tsbuildinfo
!website/babel.config.js
!docusaurus.config.js

# Yarn
.yarn/*
Expand Down
20 changes: 20 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
node_modules/
build/
cjs/
coverage/
dist/
dts/
esm/
lib/
mjs/
umd/
CHANGELOG.md
*.d.ts
*.d.cts
*.d.mts
.yarn

# Misc
website/.docusaurus
website/versioned_docs
website/versioned_sidebars
2 changes: 1 addition & 1 deletion fixtures/monorepo/multi-imports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

```json
{
"foo": "bar"
"foo": "bar"
}
```
2 changes: 1 addition & 1 deletion fixtures/monorepo/standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

```ts
function foo(num: number) {
return 123;
return 123;
}
```
2 changes: 0 additions & 2 deletions fixtures/monorepo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Beemo",
"extends": "../../tsconfig.options.json",
"files": [],
"references": [
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@
"docs": "yarn run build && cd website && yarn run start",
"build": "packemon build --addEngines",
"pack": "NODE_ENV=production packemon pack --addEngines --declaration",
"format": "beemo prettier",
"lint": "beemo eslint",
"type": "beemo typescript --build",
"release": "yarn run pack && yarn run check && yarn beemo run-script lerna-release"
"format": "prettier --write .",
"lint": "eslint --cache --color --fix --ext .ts,.tsx ./packages/*/{src,tests} ./website/src",
"type": "tsc --build",
"release": "yarn run pack && yarn run check && lerna-release"
},
"devDependencies": {
"@beemo/cli": "^2.0.6",
"@beemo/core": "^2.1.4",
"@beemo/dev": "^2.1.2",
"@types/marked": "^4.0.7",
"@types/react": "^17.0.50",
"eslint": "^8.24.0",
"eslint-config-moon": "^1.0.2",
"lerna": "^5.5.2",
"packemon": "^2.4.1",
"react": "^17.0.2"
"prettier": "^2.7.1",
"prettier-config-moon": "^1.0.1",
"react": "^17.0.2",
"tsconfig-moon": "^1.0.1",
"typescript": "^4.8.3"
},
"workspaces": [
"packages/*",
Expand Down
160 changes: 80 additions & 80 deletions packages/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ Open your `docusaurus.config.js` and make the following changes:

```js
module.exports = {
// ...
themeConfig: {
// ...
navbar: {
// ...
items: [
// ...
{
to: 'api',
label: 'API',
position: 'left',
},
],
},
},
// ...
themeConfig: {
// ...
navbar: {
// ...
items: [
// ...
{
to: 'api',
label: 'API',
position: 'left',
},
],
},
},
};
```

Expand All @@ -56,19 +56,19 @@ module.exports = {

```js
module.exports = {
// ...
plugins: [
[
'docusaurus-plugin-typedoc-api',
{
projectRoot: path.join(__dirname, '..'),
// Monorepo
packages: ['packages/example', 'packages/other'],
// Polyrepo
packages: ['.'],
},
],
],
// ...
plugins: [
[
'docusaurus-plugin-typedoc-api',
{
projectRoot: path.join(__dirname, '..'),
// Monorepo
packages: ['packages/example', 'packages/other'],
// Polyrepo
packages: ['.'],
},
],
],
};
```

Expand Down Expand Up @@ -113,7 +113,7 @@ package folder, and a default entry point of `src/index.ts`.

```js
module.exports = {
packages: ['packages/core', 'packages/react'],
packages: ['packages/core', 'packages/react'],
};
```

Expand All @@ -128,18 +128,18 @@ relative to the package folder, and support 2 formats:

```js
module.exports = {
packages: [
'packages/core',
{
path: 'packages/react',
// Index only imports allowed
// import {} from 'package'
entry: 'src/index.tsx',
// Deep imports allowed
// import {} from 'package/some/nested/file'
entry: 'src/',
},
],
packages: [
'packages/core',
{
path: 'packages/react',
// Index only imports allowed
// import {} from 'package'
entry: 'src/index.tsx',
// Deep imports allowed
// import {} from 'package/some/nested/file'
entry: 'src/',
},
],
};
```

Expand All @@ -149,22 +149,22 @@ Each entry object requires a `path` and a `label`, which is used for categorizin

```js
module.exports = {
packages: [
'packages/core',
{
path: 'packages/react',
entry: {
// import {} from 'package'
index: 'src/index.tsx',
// import {} from 'package/client'
client: { file: 'src/client.tsx', label: 'Client' },
// import {} from 'package/server'
server: { file: 'src/server.tsx', label: 'Server' },
// import {} from 'package/server/test'
'server/test': { file: 'src/server/test-utils.tsx', label: 'Server test utils' },
},
},
],
packages: [
'packages/core',
{
path: 'packages/react',
entry: {
// import {} from 'package'
index: 'src/index.tsx',
// import {} from 'package/client'
client: { file: 'src/client.tsx', label: 'Client' },
// import {} from 'package/server'
server: { file: 'src/server.tsx', label: 'Server' },
// import {} from 'package/server/test'
'server/test': { file: 'src/server/test-utils.tsx', label: 'Server test utils' },
},
},
],
};
```

Expand Down Expand Up @@ -236,29 +236,29 @@ dropdown like so:
const versions = require('./versions.json');

module.exports = {
// ...
themeConfig: {
// ...
navbar: {
// ...
items: [
// ...
{
type: 'dropdown',
to: 'api',
label: 'API',
position: 'left',
items: [
{ label: 'Next', to: 'api/next' },
...versions.map((version, i) => ({
label: version,
to: i === 0 ? 'api' : `api/${version}`,
})),
],
},
],
},
},
// ...
themeConfig: {
// ...
navbar: {
// ...
items: [
// ...
{
type: 'dropdown',
to: 'api',
label: 'API',
position: 'left',
items: [
{ label: 'Next', to: 'api/next' },
...versions.map((version, i) => ({
label: version,
to: i === 0 ? 'api' : `api/${version}`,
})),
],
},
],
},
},
};
```

Expand Down
9 changes: 8 additions & 1 deletion packages/plugin/src/components/ApiDataContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ export const ApiDataContext = createContext<{
options: ApiOptions;
reflections: DeclarationReflectionMap;
}>({
options: { banner: '', breadcrumbs: true, gitRefName: 'master', minimal: false, pluginId: 'default', scopes: [] },
options: {
banner: '',
breadcrumbs: true,
gitRefName: 'master',
minimal: false,
pluginId: 'default',
scopes: [],
},
reflections: {},
});
3 changes: 1 addition & 2 deletions packages/plugin/src/components/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,13 @@ html[data-theme='light'] .tsd-panel-content {

.tsd-panel-header .badge-group {
display: inline-block;
margin-left: .25em;
margin-left: 0.25em;
}

.badge-group > span {
margin-right: 0.25rem;
}


/* SYNTAX */

.tsd-generics {
Expand Down
Loading

0 comments on commit d649407

Please sign in to comment.