-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from inversify/chore/add-inversify-docs-site-…
…package Add inversify docs site package
- Loading branch information
Showing
29 changed files
with
917 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"*.js": [ | ||
"prettier --write" | ||
], | ||
"*.ts": [ | ||
"prettier --write", | ||
"eslint" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/.turbo | ||
/coverage | ||
/reports | ||
|
||
**/*.spec.js | ||
**/*.spec.js.map | ||
**/*.ts | ||
!lib/cjs/**/*.d.ts | ||
lib/esm/**/*.d.ts.map | ||
!lib/esm/index.d.ts | ||
!lib/esm/index.d.ts.map | ||
|
||
.lintstagedrc.json | ||
eslint.config.mjs | ||
jest.config.mjs | ||
jest.config.stryker.mjs | ||
jest.js.config.mjs | ||
prettier.config.mjs | ||
rollup.config.mjs | ||
stryker.config.mjs | ||
tsconfig.cjs.json | ||
tsconfig.cjs.tsbuildinfo | ||
tsconfig.esm.json | ||
tsconfig.esm.tsbuildinfo | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @inversifyjs/inversify-docs-site | ||
|
||
Inversify documentation site package. |
Binary file added
BIN
+93.9 KB
.../services/inversify-site/blog/2024-12-24-welcome/docusaurus-plushie-banner.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
packages/docs/services/inversify-site/blog/2024-12-24-welcome/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
slug: welcome | ||
title: Welcome | ||
authors: [notaphplover] | ||
tags: [] | ||
--- | ||
|
||
Welcome to the new documentation pages! We are rebuilding our docs on top of [Docusaurus](https://docusaurus.io/) to provide a better developer experience. | ||
|
||
<!-- truncate --> | ||
|
||
![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg) | ||
|
||
This docs will include the latest released version of `inversify`. Major Pre releases will be documented as well so you can learn about them and discuss then in the prerelease discussion thread. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
notaphplover: | ||
name: Roberto Pintos López | ||
title: InversifyJS maintainer | ||
url: https://github.com/notaphplover | ||
image_url: https://github.com/notaphplover.png | ||
page: true | ||
socials: | ||
github: notaphplover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
releases: | ||
label: Releases | ||
permalink: /releases | ||
description: InversifyJS releases related posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
declare module '*.png' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.jpg' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.jpeg' { | ||
const src: string; | ||
export default src; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Getting started | ||
|
||
Initialize your first container and add some bindings: | ||
|
||
:::warning | ||
|
||
[Experimental decorators](https://www.typescriptlang.org/tsconfig/#experimentalDecorators) and [Emit Decorator Metadata](https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata) options must be enabled in order to use this library. | ||
|
||
::: | ||
|
||
```ts | ||
import { Container, injectable, inject } from 'inversify'; | ||
|
||
interface Weapon { | ||
damage: number | ||
} | ||
|
||
@injectable() | ||
class Katana { | ||
public readonly damage: number = 10; | ||
} | ||
|
||
@injectable() | ||
class Ninja { | ||
constructor ( | ||
@inject(Katana) | ||
public readonly weapon: Weapon | ||
) {} | ||
} | ||
|
||
const container: Container = new Container(); | ||
|
||
container.bind(Ninja).toSelf(); | ||
container.bind(Katana).toSelf(); | ||
|
||
const ninja: Ninja = container.get(Ninja); | ||
|
||
console.log(ninja.weapon.damage); // Prints 10 | ||
``` | ||
|
||
`@injectable` allows both `Katana` and `Ninja` classes to be used as container bindings. `@inject` provides metadata with `Ninja` dependencies so the container is aware a `Katana` should be provided as the first argument of `Ninja`'s constructor. | ||
|
||
Bindings are provided through the `Container` API. | ||
|
||
Whith these two steps, we are ready to initialize our very first ninja! |
111 changes: 111 additions & 0 deletions
111
packages/docs/services/inversify-site/docusaurus.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import type * as Preset from '@docusaurus/preset-classic'; | ||
import type { Config } from '@docusaurus/types'; | ||
import { themes as prismThemes } from 'prism-react-renderer'; | ||
|
||
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) | ||
|
||
const config: Config = { | ||
baseUrl: '/monorepo', | ||
deploymentBranch: 'gh-pages', | ||
favicon: 'img/favicon.ico', | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: ['en'], | ||
}, | ||
onBrokenLinks: 'throw', | ||
onBrokenMarkdownLinks: 'warn', | ||
organizationName: 'inversify', | ||
presets: [ | ||
[ | ||
'classic', | ||
{ | ||
blog: { | ||
feedOptions: { | ||
type: ['rss', 'atom'], | ||
xslt: true, | ||
}, | ||
onInlineAuthors: 'warn', | ||
onInlineTags: 'warn', | ||
onUntruncatedBlogPosts: 'warn', | ||
showReadingTime: true, | ||
}, | ||
docs: { | ||
sidebarPath: './sidebars.ts', | ||
}, | ||
theme: { | ||
customCss: './src/css/custom.css', | ||
}, | ||
} satisfies Preset.Options, | ||
], | ||
], | ||
projectName: 'monorepo', | ||
tagline: | ||
'A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript', | ||
themeConfig: { | ||
footer: { | ||
links: [ | ||
{ | ||
items: [ | ||
{ | ||
label: 'Tutorial', | ||
to: '/docs/intro', | ||
}, | ||
], | ||
title: 'Docs', | ||
}, | ||
{ | ||
items: [ | ||
{ | ||
href: 'https://discord.gg/jXcMagAPnm', | ||
label: 'Discord', | ||
}, | ||
], | ||
title: 'Community', | ||
}, | ||
{ | ||
items: [ | ||
{ | ||
label: 'Blog', | ||
to: '/blog', | ||
}, | ||
{ | ||
href: 'https://github.com/inversify/monorepo', | ||
label: 'GitHub', | ||
}, | ||
], | ||
title: 'More', | ||
}, | ||
], | ||
style: 'dark', | ||
}, | ||
navbar: { | ||
items: [ | ||
{ | ||
label: 'Tutorial', | ||
position: 'left', | ||
sidebarId: 'tutorialSidebar', | ||
type: 'docSidebar', | ||
}, | ||
{ label: 'Blog', position: 'left', to: '/blog' }, | ||
{ | ||
href: 'https://github.com/inversify/monorepo', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
logo: { | ||
alt: 'InversifyJS', | ||
src: 'img/logo.svg', | ||
}, | ||
title: 'InversifyJS', | ||
}, | ||
prism: { | ||
darkTheme: prismThemes.dracula, | ||
theme: prismThemes.github, | ||
}, | ||
} satisfies Preset.ThemeConfig, | ||
title: 'InversifyJS', | ||
url: 'https://inversify.github.io', | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.