@benjos/create-boilerplate 1.0.3 ā 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -12
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/template-react/.prettierignore +6 -0
- package/template-react/.prettierrc +10 -0
- package/template-react/assets_source/.gitkeep +0 -0
- package/template-react/eslint.config.js +23 -0
- package/template-react/index.html +17 -0
- package/template-react/package-lock.json +4492 -0
- package/template-react/package.json +47 -0
- package/template-react/public/assets/fonts/LICENSE +13 -0
- package/template-react/public/assets/fonts/template.typeface.json +1 -0
- package/template-react/public/assets/hdrs/template.hdr +0 -0
- package/template-react/public/assets/icons/benjosLogoBlack.svg +5 -0
- package/template-react/public/assets/loaders/draco/README.md +32 -0
- package/template-react/public/assets/loaders/draco/draco_decoder.js +34 -0
- package/template-react/public/assets/loaders/draco/draco_decoder.wasm +0 -0
- package/template-react/public/assets/loaders/draco/draco_encoder.js +33 -0
- package/template-react/public/assets/loaders/draco/draco_wasm_wrapper.js +117 -0
- package/template-react/public/assets/loaders/draco/gltf/draco_decoder.js +33 -0
- package/template-react/public/assets/loaders/draco/gltf/draco_decoder.wasm +0 -0
- package/template-react/public/assets/loaders/draco/gltf/draco_encoder.js +33 -0
- package/template-react/public/assets/loaders/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/template-react/public/assets/models/template.glb +0 -0
- package/template-react/public/assets/textures/template.jpg +0 -0
- package/template-react/readme.md +31 -0
- package/template-react/src/App.css +42 -0
- package/template-react/src/App.tsx +14 -0
- package/template-react/src/index.css +68 -0
- package/template-react/src/main.tsx +10 -0
- package/template-react/tsconfig.app.json +28 -0
- package/template-react/tsconfig.json +7 -0
- package/template-react/tsconfig.node.json +26 -0
- package/template-react/vite.config.ts +29 -0
- package/template-vanilla/eslint.config.js +11 -0
- package/template-vanilla/package-lock.json +3739 -3739
- package/template-vanilla/package.json +2 -2
- package/template-vanilla/readme.md +2 -20
- package/template-vanilla/src/experiences/Experience.ts +7 -0
- package/template-vanilla/src/experiences/constants/experiences/ViewType.ts +6 -0
- package/template-vanilla/src/experiences/proxies/ViewProxy.ts +15 -0
- package/template-vanilla/src/experiences/views/bases/ViewBase.ts +14 -3
- package/template-vanilla/src/experiences/views/htmls/bases/HTMLViewBase.ts +2 -1
- package/template-vanilla/src/experiences/views/threes/bases/ThreeViewBase.ts +2 -1
- package/template-vanilla/src/experiences/views/threes/loaders/LoaderThreeView.ts +1 -0
- package/template-vanilla/docs/PUBLISHING.md +0 -30
- package/template-vanilla/tsconfig.json +0 -24
package/README.md
CHANGED
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
# š¦ @benjos/create-boilerplate
|
|
2
2
|
|
|
3
|
-
CLI to scaffold Three.js projects.
|
|
3
|
+
CLI to scaffold Three.js projects with framework support.
|
|
4
4
|
|
|
5
|
-
## š
|
|
5
|
+
## š Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
# Interactive mode
|
|
9
|
+
npm create @benjos/boilerplate@latest
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
# With project name
|
|
12
|
+
npm create @benjos/boilerplate@latest my-threejs-app
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
cd boilerplate/packages/cli
|
|
16
|
-
npm install && npm run build && npm link
|
|
14
|
+
# In current directory
|
|
15
|
+
npm create @benjos/boilerplate@latest .
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
## ⨠Features
|
|
19
|
+
|
|
20
|
+
Choose your framework:
|
|
21
|
+
- **Vanilla** ā Three.js + TypeScript + HTML views
|
|
22
|
+
- **React** ā Three.js + TypeScript + React components
|
|
23
|
+
|
|
24
|
+
Both templates include:
|
|
25
|
+
- ā” Vite for fast development
|
|
26
|
+
- šØ GLSL shader support (vite-plugin-glsl)
|
|
27
|
+
- š Debug mode with lil-gui
|
|
28
|
+
- š¦ Manager-based architecture (Loader, Ticker, Keyboard, Mouse, etc.)
|
|
29
|
+
- šÆ ViewProxy system for managing views
|
|
30
|
+
- š Three.js scene management
|
|
31
|
+
- š TypeScript + ESLint + Prettier
|
|
20
32
|
|
|
21
|
-
##
|
|
33
|
+
## š§ Development
|
|
22
34
|
|
|
23
|
-
See [
|
|
35
|
+
See [MAINTENANCE.md](./MAINTENANCE.md) for contributing.
|
|
24
36
|
|
|
25
37
|
## š License
|
|
26
38
|
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,9 @@ import fs from 'fs-extra';
|
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
11
|
const __dirname = path.dirname(__filename);
|
|
10
12
|
async function createProject(projectNameArg) {
|
|
11
13
|
console.log(chalk.cyan.bold('\nš Welcome to @benjos/boilerplate!\n'));
|
|
@@ -14,7 +16,7 @@ async function createProject(projectNameArg) {
|
|
|
14
16
|
type: 'input',
|
|
15
17
|
name: 'projectName',
|
|
16
18
|
message: 'Project name:',
|
|
17
|
-
default: projectNameArg
|
|
19
|
+
default: projectNameArg ?? 'my-threejs-app',
|
|
18
20
|
when: !projectNameArg,
|
|
19
21
|
validate: (input) => {
|
|
20
22
|
if (input === '.')
|
|
@@ -31,17 +33,15 @@ async function createProject(projectNameArg) {
|
|
|
31
33
|
message: 'Choose a framework:',
|
|
32
34
|
choices: [
|
|
33
35
|
{ name: 'Vanilla (Three.js + TypeScript)', value: 'vanilla' },
|
|
34
|
-
{ name: 'React (
|
|
36
|
+
{ name: 'React (Three.js + TypeScript + React)', value: 'react' },
|
|
35
37
|
{ name: 'Vue (Coming soon)', value: 'vue', disabled: true },
|
|
36
38
|
],
|
|
37
39
|
},
|
|
38
40
|
]);
|
|
39
41
|
// Handle current directory case
|
|
40
|
-
const projectName = projectNameArg
|
|
42
|
+
const projectName = projectNameArg ?? answers.projectName ?? '.';
|
|
41
43
|
const isCurrentDir = projectName === '.';
|
|
42
|
-
const targetDir = isCurrentDir
|
|
43
|
-
? process.cwd()
|
|
44
|
-
: path.join(process.cwd(), projectName);
|
|
44
|
+
const targetDir = isCurrentDir ? process.cwd() : path.join(process.cwd(), projectName);
|
|
45
45
|
// Check if directory already exists (only for new directories)
|
|
46
46
|
if (!isCurrentDir && (await fs.pathExists(targetDir))) {
|
|
47
47
|
console.log(chalk.red(`\nā Directory "${projectName}" already exists!`));
|
|
@@ -62,7 +62,9 @@ async function createProject(projectNameArg) {
|
|
|
62
62
|
await fs.copy(templateDir, targetDir);
|
|
63
63
|
// Update package.json with project name
|
|
64
64
|
const packageJsonPath = path.join(targetDir, 'package.json');
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
65
66
|
const packageJson = await fs.readJson(packageJsonPath);
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
66
68
|
packageJson.name = finalProjectName;
|
|
67
69
|
await fs.writeJson(packageJsonPath, packageJson, { spaces: 4 });
|
|
68
70
|
console.log(chalk.green('ā
Project created successfully!\n'));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB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
+
"version": "1.3.2",
|
|
4
|
+
"description": "CLI to scaffold Three.js projects with framework support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-boilerplate": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
|
-
"template-vanilla"
|
|
11
|
+
"template-vanilla",
|
|
12
|
+
"template-react"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "tsc",
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(['dist']),
|
|
10
|
+
{
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
extends: [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
ecmaVersion: 2020,
|
|
20
|
+
globals: globals.browser,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
])
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="./assets/icons/benjosLogoBlack.svg" />
|
|
6
|
+
<meta
|
|
7
|
+
name="viewport"
|
|
8
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1, height=device-height, user-scalable=no, viewport-fit=cover, shrink-to-fit=no, minimal-ui"
|
|
9
|
+
/>
|
|
10
|
+
<title>Boilerplate</title>
|
|
11
|
+
</head>
|
|
12
|
+
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|