Skip to content

Commit

Permalink
help-beta: Create initial starlight project.
Browse files Browse the repository at this point in the history
We are adding MDX files to `.gitignore` for now since they are
just a result of a build process, once the migration is done,
we will not ignore them.
We're using PNPM workspaces to manage this project.
The new project's tsconfig.json has been copied from the current
root tsconfig.json while omitting some details that are only
relevant to that project.
`help-beta/src/env.d.ts` is a type declaration file auto-generated
by Astro. See withastro/astro#6013.
  • Loading branch information
shubham-padia committed Jun 28, 2024
1 parent a8440fe commit 7fc1636
Show file tree
Hide file tree
Showing 11 changed files with 3,880 additions and 12 deletions.
52 changes: 52 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ module.exports = {
},
{
files: ["**/*.ts"],
excludedFiles: "help-beta/**",
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
Expand Down Expand Up @@ -205,6 +206,57 @@ module.exports = {
"no-undef": "error",
},
},
{
files: ["help-beta/**.ts"],
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/typescript",
],
parserOptions: {
project: "help-beta/tsconfig.json",
},
settings: {
"import/resolver": {
node: {
extensions: [".ts", ".d.ts", ".js"], // https://github.com/import-js/eslint-plugin-import/issues/2267
},
},
},
globals: {
JQuery: false,
},
rules: {
// Disable base rule to avoid conflict
"no-use-before-define": "off",

"@typescript-eslint/consistent-type-assertions": [
"error",
{assertionStyle: "never"},
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{allowExpressions: true},
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/method-signature-style": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{args: "all", argsIgnorePattern: "^_", ignoreRestSiblings: true},
],
"@typescript-eslint/no-use-before-define": ["error", {functions: false}],
"@typescript-eslint/parameter-properties": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/restrict-plus-operands": ["error", {}],
"@typescript-eslint/restrict-template-expressions": ["error", {}],
"no-undef": "error",
},
},
{
files: ["**/*.d.ts"],
rules: {
Expand Down
23 changes: 23 additions & 0 deletions help-beta/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

*.mdx


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
12 changes: 12 additions & 0 deletions help-beta/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
base: 'help-beta',
integrations: [
starlight({
title: 'Zulip help center',
}),
],
});
19 changes: 19 additions & 0 deletions help-beta/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "help-beta",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.24.2",
"astro": "^4.10.2",
"sharp": "^0.32.5",
"@astrojs/check": "^0.7.0",
"typescript": "^5.4.5"
}
}
6 changes: 6 additions & 0 deletions help-beta/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {docsSchema} from "@astrojs/starlight/schema";
import {defineCollection} from "astro:content";

export const collections = {
docs: defineCollection({schema: docsSchema()}),
};
2 changes: 2 additions & 0 deletions help-beta/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
27 changes: 27 additions & 0 deletions help-beta/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
/* Type Checking */
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,

/* Emit */
"noEmit": true,

/* Interop Constraints */
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,

/* Language and Environment */
"target": "esnext",

/* Projects */
"composite": true,
},
}
Loading

0 comments on commit 7fc1636

Please sign in to comment.