Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
LEMing committed Aug 20, 2024
1 parent 95a7f67 commit 527e03e
Show file tree
Hide file tree
Showing 29 changed files with 15,046 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
src/__tests__
src/__mocks__
__tests__
__mocks__
*.test.ts
*.test.tsx
jest.config.js
.gitignore
tsconfig.json
vite.config.ts
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Makefile

# Variables
SHELL := /bin/bash
PACKAGE_MANAGER := npm
NODE_MODULES := node_modules
DIST := dist

# Targets
.PHONY: all install clean build test dev preview help

all: install build test

install: $(NODE_MODULES)

$(NODE_MODULES): package.json
$(PACKAGE_MANAGER) install
@touch $(NODE_MODULES)

clean:
rm -rf $(NODE_MODULES) $(DIST)

build: install
$(PACKAGE_MANAGER) run build

test: install
$(PACKAGE_MANAGER) test

dev: install
$(PACKAGE_MANAGER) run dev

publish: build test
$(PACKAGE_MANAGER) publish

help:
@echo "Available commands:"
@echo " make install - Install dependencies"
@echo " make clean - Remove node_modules and dist directories"
@echo " make build - Build the project"
@echo " make test - Run tests"
@echo " make dev - Start development server"
@echo " make publish - Build, test, and publish to npm"
@echo " make help - Show this help message"
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

7 changes: 7 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
presets: [
'@babel/preset-env',
'@babel/preset-react',
'@babel/preset-typescript',
],
};
24 changes: 24 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SimpleViewer Test</title>
<style>
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
#root {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleNameMapper: {
'^three/examples/jsm/controls/OrbitControls$': '<rootDir>/src/__mocks__/OrbitControlsMock.ts'
},
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: true,
}],
},
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts']
};
Loading

0 comments on commit 527e03e

Please sign in to comment.