Skip to content

Commit 4955e09

Browse files
authored
Shared configs/vite plus (#179)
* rolldown vite * update pnpm * biome -> OxC * lint root * update ignorepatterns * fix file name * use typeaware lint * add OxC as recommended extension * single attr per line true * use oxc and add associations * add fix-suggestions * update lint config * update documentation * use OxC instead of biome * update ignore rules to OxC * lint root * use side effect imports for types * use tsdown for libs * simplify core vite config * remove unused template * update deps * remove unused dev dependencies * fix typo * remove unused config * lint types * use oxc build * remove unused tsx copies. * lint * lint * build * lint * lint * lint * build * lint apps * update types * update deps * lint aiinfo * hoist typecheck * lint * prop typo * fix duplicate keys * typecheck tests * lint * sort imports * lint * merge objects * sort checksum keys * simplify objects * oxfmt * lint * sort return * lint * disable vitest lint plugin * lint * fmt before lint * use relative paths for ignore * lint * lint root * lint build.mts * lint * apply fixes to lint errors * declare type * lint * update linter config * update lint config * apply lint fixes * hoist commands * include scripts * update types * build aiinfo * update cvoerage * expect undefined * fix expected header * regenerate files * allow finding AiInfoProps in type destructure * update coverage * fix lint errors * omit trigger * update indexes * update test * lint * update deps * [email protected] * @instructure.ai/[email protected]
1 parent 9d07484 commit 4955e09

File tree

209 files changed

+17705
-17534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+17705
-17534
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Technologies Used
44

5-
This project is a monorepo with shared configs exported from the root package.json. It is built using modern technologies and follows best practices for accessibility, performance, and maintainability. The workspace root package (`@instructure.ai/shared-configs`) provides orchestration for the monorepo and handles creating packages. Each package in ./packages or ./apps and ./ (root package) should be treated in isolation. The project is set up with [Vite](https://vite.dev/guide/) for fast development and build times, [Biome](https://biomejs.dev/guides/getting-started/) for code quality and formatting, and [Vitest](https://vitest.dev/guide/) for testing. Do not try to install alternative versions of packages such as es-lint, prettier, or jest. Use the tools provided by the shared-configs package.
5+
This project is a monorepo with shared configs exported from the root package.json. It is built using modern technologies and follows best practices for accessibility, performance, and maintainability. The workspace root package (`@instructure.ai/shared-configs`) provides orchestration for the monorepo and handles creating packages. Each package in ./packages or ./apps and ./ (root package) should be treated in isolation. The project is set up with [Vite](https://vite.dev/guide/) for fast development and build times, [OxC](https://oxc.rs/docs/guide/introduction.html) for code quality and formatting, and [Vitest](https://vitest.dev/guide/) for testing. Do not try to install alternative versions of packages such as es-lint, prettier, or jest. Use the tools provided by the shared-configs package.
66

77
## Coding Standards
88

.oxfmtrc.jsonc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"files": {
4+
"include": [
5+
"scripts/**/*.{js,jsx,ts,tsx,mts,cts,css,scss,md,json}",
6+
"configs/**/*.{js,jsx,ts,tsx,mts,cts,css,scss,md,json}",
7+
"public/**/*.{js,jsx,ts,tsx,mts,cts,css,scss,md,json}",
8+
"*.{js,jsx,ts,tsx,mts,cts,css,scss,md,json}"
9+
],
10+
"exclude": [
11+
"packages/**",
12+
"apps/**",
13+
".template/**",
14+
".changeset/**",
15+
"**/*.grit",
16+
"**/dist/**",
17+
"**/build/**",
18+
"**/.turbo/**",
19+
"**/.next/**",
20+
"**/coverage/**",
21+
"**/node_modules/**"
22+
]
23+
},
24+
"options": {
25+
"useTabs": true,
26+
"tabWidth": 2,
27+
"singleQuote": false,
28+
"jsxSingleQuote": false,
29+
"semi": true,
30+
"singleAttributePerLine": true,
31+
}
32+
}

.oxlintrc.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"categories": {
4+
"correctness": "error",
5+
"suspicious": "warn",
6+
"style": "warn",
7+
"perf": "warn",
8+
"pedantic": "off"
9+
},
10+
"env": {
11+
"browser": true,
12+
"node": true,
13+
"vitest": true
14+
},
15+
"ignorePatterns": [
16+
"packages/**",
17+
"apps/**",
18+
".template/**",
19+
".changeset/**",
20+
"**/*.grit",
21+
"**/dist/**",
22+
"**/build/**",
23+
"**/.turbo/**",
24+
"**/.next/**",
25+
"**/coverage/**",
26+
"**/node_modules/**"
27+
],
28+
"plugins": [
29+
"eslint",
30+
"typescript",
31+
"unicorn",
32+
"oxc",
33+
// "vitest",
34+
"jsdoc",
35+
"import",
36+
"node",
37+
]
38+
}

.template/esm/.oxfmtrc.jsonc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../../node_modules/oxfmt/configuration_schema.json",
3+
"extends": [
4+
"../../.oxfmtrc.jsonc"
5+
],
6+
"files": {
7+
"exclude": [
8+
"./src/**"
9+
]
10+
}
11+
}

.template/esm/.oxlintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "../../node_modules/oxlint/configuration_schema.json",
3+
"extends": [
4+
"../../.oxlintrc.json"
5+
],
6+
"ignorePatterns": [
7+
"src/**",
8+
]
9+
}

.template/esm/node/index.mts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env node
22

33
const main = async () => {
4-
console.log('Hello World!');
4+
console.log("Hello World!");
55
};
66

7-
main().catch((e) => {throw new Error(e)});
7+
main().catch((e) => {
8+
throw new Error(e);
9+
});

.template/esm/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
"types": "./src/index.d.ts"
1111
}
1212
},
13-
"files": ["src"],
13+
"files": [
14+
"src"
15+
],
1416
"scripts": {
15-
"build": "vite build && pnpm pack --pack-destination ./src",
17+
"build": "tsdown && pnpm pack --pack-destination ./src",
1618
"typecheck": "tsgo --noEmit",
17-
"lint": "pnpm biome check",
19+
"lint": "oxfmt && oxlint --type-aware --fix --fix-suggestions",
1820
"test": "pnpm vitest run",
1921
"<<cliname>>": "vite-node ./src/index.mjs"
2022
},
@@ -24,9 +26,9 @@
2426
"devDependencies": {
2527
"@instructure.ai/shared-configs": "workspace:^"
2628
},
27-
"repository": {
29+
"repository": {
2830
"type": "git",
2931
"url": "https://github.com/instructure/instructure.ai",
3032
"directory": "packages/<<cliname>>"
31-
},
32-
}
33+
},
34+
}

.template/esm/tsdown.config.mts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
entry: "node/index.mts",
5+
format: ["esm", "cjs"],
6+
outDir: "src",
7+
clean: true,
8+
target: "node20",
9+
minify: true,
10+
dts: true,
11+
tsconfig: "./tsconfig.json",
12+
});

.template/esm/vite.config.mts

Lines changed: 0 additions & 4 deletions
This file was deleted.

.template/instui/.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Technologies Used
44

5-
This project is a web application that is deployed to GitHub Pages as a static site in a directory based on the package name. It is built using modern web technologies and follows best practices for accessibility, performance, and maintainability. The application is designed to be responsive and works well on a variety of devices and screen sizes. It does not have a database and does not require user authentication. It is built with [React 19](https://react.dev/reference/react), [Typescript Native](https://github.com/microsoft/typescript-go), and [InstUI](https://instructure.design/). The project is set up with [Vite](https://vite.dev/guide/) for fast development and build times, [Biome](https://biomejs.dev/guides/getting-started/) for code quality and formatting, and [Vitest](https://vitest.dev/guide/) for testing.
5+
This project is a web application that is deployed to GitHub Pages as a static site in a directory based on the package name. It is built using modern web technologies and follows best practices for accessibility, performance, and maintainability. The application is designed to be responsive and works well on a variety of devices and screen sizes. It does not have a database and does not require user authentication. It is built with [React 19](https://react.dev/reference/react), [Typescript Native](https://github.com/microsoft/typescript-go), and [InstUI](https://instructure.design/). The project is set up with [Vite](https://vite.dev/guide/) for fast development and build times, [OxC](https://oxc.rs/docs/guide/introduction.html) for code quality and formatting, and [Vitest](https://vitest.dev/guide/) for testing.
66

77
## Coding Standards
88

0 commit comments

Comments
 (0)