Skip to content

Commit bf03dcf

Browse files
committed
prettier
1 parent bb58d45 commit bf03dcf

Some content is hidden

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

71 files changed

+19989
-20047
lines changed

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/docs.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.prettierrc.mjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** @type {import("prettier").Config} */
2+
export default {
3+
useTabs: true,
4+
tabWidth: 4,
5+
printWidth: 120,
6+
singleQuote: true,
7+
plugins: ['prettier-plugin-astro', 'prettier-plugin-organize-imports', 'prettier-plugin-tailwindcss'],
8+
overrides: [
9+
{
10+
files: '*.astro',
11+
options: {
12+
parser: 'astro',
13+
},
14+
},
15+
],
16+
};

.vscode/extensions.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"recommendations": ["astro-build.astro-vscode"],
3-
"unwantedRecommendations": []
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
44
}

.vscode/launch.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"command": "./node_modules/.bin/astro dev",
6-
"name": "Development server",
7-
"request": "launch",
8-
"type": "node-terminal"
9-
}
10-
]
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
1111
}

astro.config.mjs

+108-110
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,127 @@
1-
import analogjsangular from "@analogjs/astro-angular";
2-
import starlight from "@astrojs/starlight";
3-
import tailwind from "@astrojs/tailwind";
4-
import { defineConfig } from "astro/config";
5-
import { readFileSync } from "node:fs";
6-
import { ngtSidebar } from "./astro.sidebar.mjs";
7-
import glob from "fast-glob";
1+
import analogjsangular from '@analogjs/astro-angular';
2+
import starlight from '@astrojs/starlight';
3+
import tailwind from '@astrojs/tailwind';
4+
import { defineConfig } from 'astro/config';
5+
import glob from 'fast-glob';
6+
import { readFileSync } from 'node:fs';
7+
import { ngtSidebar } from './astro.sidebar.mjs';
88

99
// import starlightBlog from "starlight-blog";
1010

1111
function devServerFileWatcher(paths) {
12-
return {
13-
name: "dev-server-file-watcher",
14-
hooks: {
15-
async "astro:config:setup"({ addWatchFile, config }) {
16-
for (const path of paths) {
17-
const files = await glob(path);
18-
files.forEach((file) => addWatchFile(new URL(file, config.root)));
19-
}
20-
},
21-
},
22-
};
12+
return {
13+
name: 'dev-server-file-watcher',
14+
hooks: {
15+
async 'astro:config:setup'({ addWatchFile, config }) {
16+
for (const path of paths) {
17+
const files = await glob(path);
18+
files.forEach((file) => addWatchFile(new URL(file, config.root)));
19+
}
20+
},
21+
},
22+
};
2323
}
2424

2525
function includeContentPlugin() {
26-
const map = new Map();
26+
const map = new Map();
2727

28-
return [
29-
{
30-
name: "pre-include-content",
31-
enforce: "pre",
32-
transform(_, id) {
33-
if (!id.includes("?includeContent") || id.includes("astro-entry"))
34-
return;
28+
return [
29+
{
30+
name: 'pre-include-content',
31+
enforce: 'pre',
32+
transform(_, id) {
33+
if (!id.includes('?includeContent') || id.includes('astro-entry')) return;
3534

36-
const [filePath] = id.split("?");
37-
const fileContent = readFileSync(filePath, "utf-8");
35+
const [filePath] = id.split('?');
36+
const fileContent = readFileSync(filePath, 'utf-8');
3837

39-
if (map.has(filePath)) return;
40-
map.set(filePath, fileContent.replace(/\t/g, " "));
41-
},
42-
},
43-
{
44-
name: "post-include-content",
45-
enforce: "post",
46-
transform(code, id) {
47-
if (!id.includes("?includeContent") || id.includes("astro-entry"))
48-
return;
49-
const [filePath] = id.split("?");
50-
const fileContent = map.get(filePath);
38+
if (map.has(filePath)) return;
39+
map.set(filePath, fileContent.replace(/\t/g, ' '));
40+
},
41+
},
42+
{
43+
name: 'post-include-content',
44+
enforce: 'post',
45+
transform(code, id) {
46+
if (!id.includes('?includeContent') || id.includes('astro-entry')) return;
47+
const [filePath] = id.split('?');
48+
const fileContent = map.get(filePath);
5149

52-
return {
53-
code: `
50+
return {
51+
code: `
5452
${code}
5553
export const content = ${JSON.stringify(fileContent)};
5654
`,
57-
};
58-
},
59-
},
60-
];
55+
};
56+
},
57+
},
58+
];
6159
}
6260

6361
// https://astro.build/config
6462
export default defineConfig({
65-
vite: {
66-
esbuild: {
67-
jsxDev: true,
68-
},
69-
plugins: [includeContentPlugin()],
70-
ssr: {
71-
noExternal: [
72-
"angular-three-soba/**",
73-
"angular-three-cannon",
74-
"angular-three-cannon/**",
75-
"angular-three-rapier",
76-
"angular-three-rapier/**",
77-
"angular-three-postprocessing",
78-
"angular-three-postprocessing/**",
79-
"@pmndrs/vanilla",
80-
"@pmndrs/cannon-worker-api",
81-
"three-custom-shader-material",
82-
"postprocessing",
83-
"stats-gl",
84-
],
85-
},
86-
assetsInclude: ["**/*.gltf", "**/*.glb", "**/*.png", "**/*.CUBE"],
87-
},
88-
integrations: [
89-
devServerFileWatcher(["./astro.sidebar.mjs"]),
90-
analogjsangular({
91-
vite: {
92-
transformFilter: (_, id) => {
93-
// we only transform files in components/scenes
94-
return id.includes("components/scenes");
95-
},
96-
},
97-
}),
98-
starlight({
99-
title: "Angular Three",
100-
plugins: [
101-
ngtSidebar(),
102-
// TODO: reenable blog
103-
// starlightBlog({
104-
// authors: {
105-
// chau: {
106-
// name: "Chau Tran",
107-
// url: "https://nartc.me",
108-
// picture: "https://avatars.githubusercontent.com/u/25516557?v=4",
109-
// },
110-
// },
111-
// }),
112-
],
113-
favicon: "./src/assets/angular-three-dark.svg",
114-
tableOfContents: {
115-
minHeadingLevel: 2,
116-
maxHeadingLevel: 4,
117-
},
118-
logo: {
119-
light: "./src/assets/angular-three.svg",
120-
dark: "./src/assets/angular-three-dark.svg",
121-
},
122-
social: {
123-
github: "https://github.com/angular-threejs/angular-three",
124-
},
125-
customCss: ["./src/tailwind.css"],
126-
}),
127-
tailwind({ applyBaseStyles: false }),
128-
],
63+
vite: {
64+
esbuild: {
65+
jsxDev: true,
66+
},
67+
plugins: [includeContentPlugin()],
68+
ssr: {
69+
noExternal: [
70+
'angular-three-soba/**',
71+
'angular-three-cannon',
72+
'angular-three-cannon/**',
73+
'angular-three-rapier',
74+
'angular-three-rapier/**',
75+
'angular-three-postprocessing',
76+
'angular-three-postprocessing/**',
77+
'@pmndrs/vanilla',
78+
'@pmndrs/cannon-worker-api',
79+
'three-custom-shader-material',
80+
'postprocessing',
81+
'stats-gl',
82+
],
83+
},
84+
assetsInclude: ['**/*.gltf', '**/*.glb', '**/*.png', '**/*.CUBE'],
85+
},
86+
integrations: [
87+
devServerFileWatcher(['./astro.sidebar.mjs']),
88+
analogjsangular({
89+
vite: {
90+
transformFilter: (_, id) => {
91+
// we only transform files in components/scenes
92+
return id.includes('components/scenes');
93+
},
94+
},
95+
}),
96+
starlight({
97+
title: 'Angular Three',
98+
plugins: [
99+
ngtSidebar(),
100+
// TODO: reenable blog
101+
// starlightBlog({
102+
// authors: {
103+
// chau: {
104+
// name: "Chau Tran",
105+
// url: "https://nartc.me",
106+
// picture: "https://avatars.githubusercontent.com/u/25516557?v=4",
107+
// },
108+
// },
109+
// }),
110+
],
111+
favicon: './src/assets/angular-three-dark.svg',
112+
tableOfContents: {
113+
minHeadingLevel: 2,
114+
maxHeadingLevel: 4,
115+
},
116+
logo: {
117+
light: './src/assets/angular-three.svg',
118+
dark: './src/assets/angular-three-dark.svg',
119+
},
120+
social: {
121+
github: 'https://github.com/angular-threejs/angular-three',
122+
},
123+
customCss: ['./src/tailwind.css'],
124+
}),
125+
tailwind({ applyBaseStyles: false }),
126+
],
129127
});

0 commit comments

Comments
 (0)