help-beta: Create initial starlight project.

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 https://github.com/withastro/astro/issues/6013.
This commit is contained in:
Shubham Padia
2024-06-17 11:52:47 +00:00
committed by Tim Abbott
parent 25b480e5e0
commit 33ef160b06
11 changed files with 3939 additions and 71 deletions

View File

@@ -156,6 +156,7 @@ module.exports = {
},
{
files: ["**/*.ts"],
excludedFiles: "help-beta/**",
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
@@ -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: {

23
help-beta/.gitignore vendored Normal file
View File

@@ -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

View File

@@ -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
help-beta/package.json Normal file
View File

@@ -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"
}
}

View File

@@ -0,0 +1,6 @@
import {docsSchema} from "@astrojs/starlight/schema";
import {defineCollection} from "astro:content";
export const collections = {
docs: defineCollection({schema: docsSchema()}),
};

2
help-beta/src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

27
help-beta/tsconfig.json Normal file
View File

@@ -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,
},
}

3862
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,2 @@
packages:
- help-beta

View File

@@ -36,6 +36,9 @@
// Type stubs are not part of the top-level project.
"web/src/types",
// This is a separate package with its own TypeScript configuration.
"help-beta",
// Skip walking large generated directories.
"docs/_build",
"static/webpack-bundles",

View File

@@ -50,4 +50,4 @@ API_FEATURE_LEVEL = 280 # Last bumped for can_create_web_public_channel_group
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = (288, 0) # bumped 2024-08-01 to upgrade Python requirements
PROVISION_VERSION = (289, 0) # bumped 2024-08-02 for adding help-center starlight project