Skip to content

Commit

Permalink
chore(project): migrate home for project maintainability (#782)
Browse files Browse the repository at this point in the history
As per title.
  • Loading branch information
fuxingloh authored Feb 13, 2024
1 parent a4c3fde commit 7ed1810
Show file tree
Hide file tree
Showing 23 changed files with 113 additions and 110 deletions.
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/1-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ about: Report a bug encountered with this project
labels: kind/bug
---

<!--
Please use this template while reporting a bug and provide as much info as possible.
If the matter is security related, please disclose it privately via [email protected]
-->
<!-- Please use this template while reporting a bug and provide as much info as possible.
If the matter is security related, please disclose it privately. -->

#### What happened:

Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/3-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ about: General question about this project
labels: kind/question
---

<!--
If the matter is security related, please disclose it privately via [email protected]
-->
<!--If the matter is security related, please disclose it privately.-->
10 changes: 5 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ labels:
- label: kind/feature
sync: true
matcher:
title: "^feat\\(.+\\): .+"
title: "^feat\\(.+\\)?: .+"

- label: kind/fix
sync: true
matcher:
title: "^fix\\(.+\\): .+"
title: "^fix\\(.+\\)?: .+"

- label: kind/chore
sync: true
matcher:
title: "^chore\\(.+\\): .+"
title: "^chore\\(.+\\)?: .+"

- label: kind/refactor
sync: true
matcher:
title: "^refactor\\(.+\\): .+"
title: "^refactor\\(.+\\)?: .+"

- label: kind/docs
sync: true
matcher:
title: "^docs\\(.+\\): .+"
title: "^docs\\(.+\\)?: .+"

- label: kind/dependencies
sync: true
Expand Down
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MIT License

Copyright (c) 2022 Fuxing Loh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
# Contented

[Contented](https://contented.dev) is a prose bundler for your documentation with pipeline driven
authoring-oriented workflow to encourage developers authoring within its contextual Git repository.
[Contented](https://contented.fuxing.dev) is a prose bundler for your documentation with pipeline driven authoring-oriented workflow to encourage developers authoring within its contextual Git repository.

With a headless design of 1 config file `contented.config.mjs`, developers can start writing
their [markdown content](./04-markdown.md) and preview it on their localhost `contented generate --watch`.
With a headless design of 1 config file `contented.config.mjs`,
developers can start writing their [markdown content](./04-markdown.md)
and preview it on their localhost `contented generate --watch`.
Choosing convention over configuration reduces HTML/UI clutter, allowing developers to focus on authoring.

Authored content can be continuously delivered (CD) into a hosted static site (e.g., GitHub Pages/Netlify/Vercel) for
preview `contented generate`. As code drift, so does documentation; this allows each pull request to have an
accompanying sharable preview of the documentation. With CD, it effectively shift-left your documentation workflow and
checks it is compilable and presentable.
Authored content can be continuously delivered (CD) into a hosted static site
(e.g., GitHub Pages/Netlify/Vercel) for preview `contented generate`.
As code drift, so does documentation;
this allows each pull request to have an accompanying sharable preview of the documentation.
With CD, it effectively shift-left your documentation workflow and checks it is compilable and presentable.

By encouraging authoring next to the source (in the same git repo), developers can contextually document changes as they
develop. All domain-specific changes will go into the `main` branch with one Git Pull Request.
By encouraging authoring next to the source (in the same git repo),
developers can contextually document changes as they develop.
All domain-specific changes will go into the `main` branch with one Git Pull Request.

With `contented build`, you can compile your prose into sources `index.js` and `*.json`. That output
into `./dist` to `npm publish` them into any registry of your choice, for you can
easily `npm i @your-scope/your-npm-package` and use the processed content on any of your downstream sites. Easily
pulling up-to-date content and prose from individual domain-specific repositories and re-presented. Think microservices,
but for your prose!
With `contented build`, you can compile your prose into sources `index.js` and `*.json`.
That output into `./dist` to `npm publish` them into any registry of your choice,
for you can easily `npm i @your-scope/your-npm-package` and use the processed content on any of your downstream sites.
Easily pulling up-to-date content and prose from individual domain-specific repositories and re-presented.
Think microservices, but for your prose!

## Motivation

If you don’t make it easy to get something done (authoring), nobody will go out of their way to get it done perfectly
every time. Turn it into a GitOps workflow and give people the necessary tools and power to get it done perfectly every
single time — everyone will get it done, as now there is no other way else to get it done. An efficient workflow
naturally satisfies.
If you don’t make it easy to get something done (authoring),
nobody will go out of their way to get it done perfectly every time.
Turn it into a GitOps workflow
and give people the necessary tools and power to get it done perfectly every single time —
everyone will get it done, as now there is no other way else to get it done.
An efficient workflow naturally satisfies.

### Just Another SSG?

**This is not a static site generator.** This is a prose processor workflow with a built-in static site generator.
The outcome we're trying to achieve is
this [@contentedjs/contented-example/dist](https://www.jsdelivr.com/package/npm/@contentedjs/contented-example)
**This is not a static site generator.**
This is a prose processor workflow with a built-in static site generator.
The outcome
we're trying to achieve is this [@contentedjs/contented-example/dist](https://www.jsdelivr.com/package/npm/@contentedjs/contented-example)

> [See Contented Limitations](./09-Others/02-limitations.md)
Expand Down Expand Up @@ -89,10 +94,10 @@ repo/
/** @type {import('@contentedjs/contented').ContentedConfig} */
export default {
preview: {
url: 'https://contented.dev',
url: 'https://contented.fuxing.dev',
name: 'Contented',
github: {
url: 'https://github.com/levaintech/contented',
url: 'https://github.com/fuxingloh/contented',
},
},
processor: {
Expand Down Expand Up @@ -128,6 +133,6 @@ export default {
### Examples
- [developer.levain.tech](https://developer.levain.tech) Website Built with Contented
- [levaintech/contented/packages/contented-example](https://github.com/levaintech/contented/tree/main/packages/contented-example)
- [fuxingloh/contented/packages/contented-example](https://github.com/fuxingloh/contented/tree/main/packages/contented-example)
- [levaintech/sticky/packages/docs](https://github.com/levaintech/sticky/tree/main/packages/docs)
- [fuxingloh/jellyfishsdk-docs](https://github.com/fuxingloh/jellyfishsdk-docs)
8 changes: 4 additions & 4 deletions example/contented.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @type {import('@contentedjs/contented').ContentedConfig} */
const config = {
preview: {
url: 'https://contented.dev',
url: 'https://contented.fuxing.dev',
name: 'Contented',
github: {
url: 'https://github.com/levaintech/contented',
url: 'https://github.com/fuxingloh/contented',
},
},
processor: {
Expand All @@ -18,7 +18,7 @@ const config = {
editOnGitHubLink: {
type: 'string',
resolve: () => {
return `https://github.com/levaintech/contented/edit/main/README.md`;
return `https://github.com/fuxingloh/contented/edit/main/README.md`;
},
},
},
Expand All @@ -45,7 +45,7 @@ const config = {
editOnGitHubLink: {
type: 'string',
resolve: (_, { file }) => {
return `https://github.com/levaintech/contented/edit/main/packages/contented-example/docs/${file.data.contented.filePath}`;
return `https://github.com/fuxingloh/contented/edit/main/packages/contented-example/docs/${file.data.contented.filePath}`;
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions example/docs/03-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ configure your `package.json` with these fields:
/** @type {import('@contentedjs/contented').ContentedConfig} */
const config = {
preview: {
url: 'https://contented.dev',
url: 'https://contented.fuxing.dev',
name: 'Contented',
github: {
url: 'https://github.com/levaintech/contented',
url: 'https://github.com/fuxingloh/contented',
},
},
processor: {
Expand Down Expand Up @@ -145,10 +145,10 @@ export interface Pipeline {
/** @type {import('@contentedjs/contented').ContentedConfig} */
module.exports = {
preview: {
url: 'https://contented.dev',
url: 'https://contented.fuxing.dev',
name: 'Contented',
github: {
url: 'https://github.com/levaintech/contented',
url: 'https://github.com/fuxingloh/contented',
},
},
processor: {
Expand Down
10 changes: 5 additions & 5 deletions example/docs/04-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ For example:
/** @type {import('@contentedjs/contented').ContentedConfig} */
const config = {
preview: {
url: 'https://preview.contented.dev',
url: 'https://preview.contented.fuxing.dev',
name: 'Preview Contented',
},
processor: {
Expand Down Expand Up @@ -127,10 +127,10 @@ Pipeline Processed: -> /[path] (note docs/example-docs/ is remov
/docs/example-docs/page-2 -> /page-2
/docs/example-docs/folder/page-3 -> /folder/page-3
Preview: -> https://preview.contented.dev/[type]/[path]
/page-1 -> https://preview.contented.dev/example/page-1
/page-2 -> https://preview.contented.dev/example/page-2
/folder/page-3 -> https://preview.contented.dev/example/folder/page-3
Preview: -> https://preview.contented.fuxing.dev/[type]/[path]
/page-1 -> https://preview.contented.fuxing.dev/example/page-1
/page-2 -> https://preview.contented.fuxing.dev/example/page-2
/folder/page-3 -> https://preview.contented.fuxing.dev/example/folder/page-3
Another Site: -> https://developer-docs.com/product-example/docs/[path]
/page-1 -> https://developer-docs.com/product-example/docs/page-1
Expand Down
7 changes: 2 additions & 5 deletions example/docs/09-Others/99-contributing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Contributing Guidelines

> Taken
> from [levaintech/.github/CONTRIBUTING.md](https://github.com/levaintech/.github/edit/main/CONTRIBUTING.md)
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or
additional documentation, we greatly value feedback and contributions from our community.

Expand All @@ -11,8 +8,8 @@ information to effectively respond to your bug report or contribution.

## Security issue notifications

If you discover a potential security issue in this project we ask that you notify Levain OSS Team via our
email [[email protected]](mailto:[email protected]). Please do **not** create a public GitHub issue.
If you discover a potential security issue in this project, we ask that you notify us privately.
Please do **not** create a public GitHub issue.

## Reporting Bugs/Feature Requests

Expand Down
2 changes: 1 addition & 1 deletion example/docs/09-ballad.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ contented generate
```shell
github open pr
github click Netlify Preview
github click Vercel Preview
github lgtm
```
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"repository": {
"url": "git+https://github.com/levaintech/contented"
"url": "git+https://github.com/fuxingloh/contented"
},
"type": "module",
"main": "dist/index.js",
Expand Down
7 changes: 7 additions & 0 deletions example/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"installCommand": "pnpm install",
"buildCommand": "pnpm turbo run generate",
"outputDirectory": ".contented/.preview/out/",
"framework": "nextjs"
}
3 changes: 0 additions & 3 deletions netlify.toml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/node": "^18.19.14",
"@types/node": "^18.19.15",
"@workspace/eslint-config": "workspace:*",
"@workspace/prettier-config": "workspace:*",
"esbuild": "^0.20.0",
Expand All @@ -31,7 +31,7 @@
"turbo": "^1.12.3",
"typescript": "5.3.3"
},
"packageManager": "[email protected].1",
"packageManager": "[email protected].2",
"engines": {
"node": "^18 <19",
"pnpm": "^8 <9"
Expand Down
2 changes: 1 addition & 1 deletion packages/contented-pipeline-md/fixtures/RemarkLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- [20-Heading/100-RemarkLinked.md](20-Heading/100-RemarkLinked.md)
- [01-RemarkLinked.md](01-RemarkLinked.md)
- [RemarkLink.md](RemarkLink.md)
- [Contented](https://contented.dev)
- [Contented](https://contented.fuxing.dev)
- [20-Heading/100-RemarkLinked.md](./20-Heading/100-RemarkLinked.md)
- [20-Heading/40-Section Title/200-DeepLink.md](./20-Heading/40-Section%20Title/200-DeepLink.md)
- [01-RemarkLinked.md](./01-RemarkLinked.md)
2 changes: 1 addition & 1 deletion packages/contented-pipeline-md/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"repository": {
"url": "git+https://github.com/levaintech/contented"
"url": "git+https://github.com/fuxingloh/contented"
},
"type": "module",
"main": "./dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ it('should process RemarkLink.md', async () => {
path: '/remark-link',
fileId: expect.stringMatching(/[0-f]{64}/),
modifiedDate: expect.any(Number),
html: '<nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a class="toc-link toc-link-h1" href="#remarklinkts">RemarkLink.ts</a><ol class="toc-level toc-level-2"><li class="toc-item toc-item-h2"><a class="toc-link toc-link-h2" href="#test-links">Test Links</a></li></ol></li></ol></nav><h1 id="remarklinkts"><a aria-hidden="true" tabindex="-1" href="#remarklinkts"><span class="icon icon-link"></span></a><code>RemarkLink.ts</code></h1>\n<p><code>RemarkLink.ts</code> will automatically link to other markdown files in your repository.</p>\n<h2 id="test-links"><a aria-hidden="true" tabindex="-1" href="#test-links"><span class="icon icon-link"></span></a>Test Links</h2>\n<ul>\n<li><a href="heading/remark-linked">20-Heading/100-RemarkLinked.md</a></li>\n<li><a href="remark-linked">01-RemarkLinked.md</a></li>\n<li><a href="remark-link">RemarkLink.md</a></li>\n<li><a href="https://contented.dev" rel="nofollow" target="_blank">Contented</a></li>\n<li><a href="heading/remark-linked">20-Heading/100-RemarkLinked.md</a></li>\n<li><a href="heading/section-title/deep-link">20-Heading/40-Section Title/200-DeepLink.md</a></li>\n<li><a href="remark-linked">01-RemarkLinked.md</a></li>\n</ul>',
html: '<nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a class="toc-link toc-link-h1" href="#remarklinkts">RemarkLink.ts</a><ol class="toc-level toc-level-2"><li class="toc-item toc-item-h2"><a class="toc-link toc-link-h2" href="#test-links">Test Links</a></li></ol></li></ol></nav><h1 id="remarklinkts"><a aria-hidden="true" tabindex="-1" href="#remarklinkts"><span class="icon icon-link"></span></a><code>RemarkLink.ts</code></h1>\n<p><code>RemarkLink.ts</code> will automatically link to other markdown files in your repository.</p>\n<h2 id="test-links"><a aria-hidden="true" tabindex="-1" href="#test-links"><span class="icon icon-link"></span></a>Test Links</h2>\n<ul>\n<li><a href="heading/remark-linked">20-Heading/100-RemarkLinked.md</a></li>\n<li><a href="remark-linked">01-RemarkLinked.md</a></li>\n<li><a href="remark-link">RemarkLink.md</a></li>\n<li><a href="https://contented.fuxing.dev" rel="nofollow" target="_blank">Contented</a></li>\n<li><a href="heading/remark-linked">20-Heading/100-RemarkLinked.md</a></li>\n<li><a href="heading/section-title/deep-link">20-Heading/40-Section Title/200-DeepLink.md</a></li>\n<li><a href="remark-linked">01-RemarkLinked.md</a></li>\n</ul>',
},
]);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/contented-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"repository": {
"url": "git+https://github.com/levaintech/contented"
"url": "git+https://github.com/fuxingloh/contented"
},
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/contented-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"repository": {
"url": "git+https://github.com/levaintech/contented"
"url": "git+https://github.com/fuxingloh/contented"
},
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/contented-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"repository": {
"url": "git+https://github.com/levaintech/contented"
"url": "git+https://github.com/fuxingloh/contented"
},
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/contented/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"repository": {
"url": "git+https://github.com/levaintech/contented"
"url": "git+https://github.com/fuxingloh/contented"
},
"type": "module",
"main": "./dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/contented/src/commands/contented/ContentedPreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export class ContentedPreview {

function generateEnvData(preview: PreviewConfig): string {
return [
`CONTENTED_PREVIEW_SITE_URL=${preview.url ?? 'https://contented.dev'}`,
`CONTENTED_PREVIEW_SITE_URL=${preview.url ?? 'https://contented.fuxing.dev'}`,
`CONTENTED_PREVIEW_SITE_NAME=${preview?.name ?? 'Contented'}`,
`CONTENTED_PREVIEW_GITHUB_URL=${preview?.github?.url ?? 'https://github.com/levaintech/contented'}`,
`CONTENTED_PREVIEW_GITHUB_URL=${preview?.github?.url ?? 'https://github.com/fuxingloh/contented'}`,
].join('\n');
}
Loading

0 comments on commit 7ed1810

Please sign in to comment.