Skip to content

Commit

Permalink
Merge pull request #102 from virtual-cast/alpha
Browse files Browse the repository at this point in the history
2.0.0 release
  • Loading branch information
il-masaru-yamagishi authored Jun 18, 2023
2 parents 31b5f8f + 2f24771 commit c2479bc
Show file tree
Hide file tree
Showing 26 changed files with 2,303 additions and 4,350 deletions.
24 changes: 21 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ workflows:
build_and_test:
jobs:
- build
- lint:
- format:
requires:
- build
- lint:
requires:
- format
- release:
requires:
- lint
filters:
branches:
only: master
only:
- master
- alpha

jobs:
build:
Expand All @@ -41,6 +46,19 @@ jobs:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}

format:
docker:
- image: circleci/node:14
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn format:check

lint:
docker:
- image: circleci/node:14
Expand All @@ -55,7 +73,7 @@ jobs:
- run:
command: |
mkdir -p ~/reports
yarn --silent lint --format junit --out ~/reports/lint.xml
yarn --silent lint:check --format junit --output-file ~/reports/lint.xml
when: always
- store_test_results:
path: ~/reports
Expand Down
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/*
node_modules/*
test/*
webpack*.js
209 changes: 209 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
// base: https://github.com/BabylonJS/Babylon.js/blob/129f56b538bab37d342ed2ba663fc89cb0ab3d1f/.eslintrc
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
// "ecmaFeatures": {
// "jsx": true
// }
},
// commented out to align rules with Babylon.js
// // Limit TypeScript linting to TS/TSX
// // https://github.com/typescript-eslint/typescript-eslint/issues/1928
// "overrides": [
// {
// "files": ["src/**/*.{ts,tsx}"],
// "extends": [
// "plugin:@typescript-eslint/eslint-recommended",
// "plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking"
// // "plugin:eslint-plugin-tsdoc/recommended"
// ],
// "rules": {
// "@typescript-eslint/ban-ts-comment": "off",
// "@typescript-eslint/explicit-function-return-type": "off",
// "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
// // All the @typescript-eslint/* rules here...
// "@typescript-eslint/no-unnecessary-type-arguments": "error",
// "@typescript-eslint/prefer-nullish-coalescing": "error",
// "@typescript-eslint/prefer-optional-chain": "error"
// },
// "parser": "@typescript-eslint/parser",
// "parserOptions": {
// "tsconfigRootDir": "./",
// "project": "./tsconfig.json"
// }
// }
// ],
"env": {
"browser": true,
"node": true
// "jest": true
},
"plugins": [
// // "react"
// // "prettier", // add this if we want to use prettier error reporting
// "jest",
"@typescript-eslint"
// "eslint-plugin-tsdoc",
// "jsdoc"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
// "plugin:jest/recommended",
// "plugin:jsdoc/recommended",
"prettier"
],
// "settings": {
// "react": {
// "pragma": "h",
// "createClass": ""
// }
// },
"rules": {
"block-spacing": "error",
// "capitalized-comments": ["error", "always"],
// ... All other rules (not @typescript-eslint/*)
// "react/no-adjacent-inline-elements": "error",
// "react/react-in-jsx-scope": "error",
// "react/self-closing-comp": "error",
// "import/no-unresolved": "off", // because of the way the repo is structured
// todo - make this work with external modules
"import/named": "error",
"import/no-cycle": [1, { "maxDepth": 1, "ignoreExternal": true }],
"import/no-internal-modules": [
"error",
{
// { "allow": ["**/*.ts", "**/*.tsx"]
"forbid": ["**/index", "**/"]
}
],
// Another way of implementing that:
// "no-restricted-imports": ["error", {
// "patterns": [{
// "group": ["index"],
// "message": "Do not import from index"
// }]
// }],
// "no-duplicate-imports": ["error", { "includeExports": true }],
// should be error, no?
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/consistent-type-imports": ["error", { "disallowTypeAnnotations": false }],
"@typescript-eslint/no-this-alias": "error",
// "@typescript-eslint/naming-convention": [
// "warn",
// {
// "selector": "default",
// "format": ["camelCase"]
// },
// {
// "selector": "variable",
// "format": ["camelCase", "UPPER_CASE", "snake_case"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "parameter",
// "format": ["camelCase"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "enumMember",
// "format": ["PascalCase", "UPPER_CASE"]
// },
// {
// "selector": "memberLike",
// "modifiers": ["public", "static"],
// "format": ["PascalCase", "UPPER_CASE"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "memberLike",
// "modifiers": ["private", "static"],
// "format": ["PascalCase", "UPPER_CASE"],
// "leadingUnderscore": "require"
// },
// {
// "selector": "memberLike",
// "modifiers": ["public"],
// "format": ["camelCase"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "memberLike",
// "modifiers": ["private"],
// "format": ["camelCase"],
// "leadingUnderscore": "require"
// },
// {
// "selector": "memberLike",
// "modifiers": ["protected"],
// "format": ["camelCase"],
// "leadingUnderscore": "require"
// },
// {
// "selector": "typeLike",
// "format": ["PascalCase"]
// },
// {
// "selector": "variable",
// "format": ["camelCase", "UPPER_CASE"]
// },
// {
// "selector": "variable",
// "modifiers": ["const", "global"],
// "format": ["PascalCase", "camelCase"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "function",
// "format": ["PascalCase", "camelCase"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "function",
// "modifiers": ["exported", "global"],
// "format": ["PascalCase", "camelCase"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "interface",
// "format": ["PascalCase"]
// },
// {
// "selector": "class",
// "format": ["PascalCase"],
// "leadingUnderscore": "allow"
// }
// ],
"no-unused-vars": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"space-infix-ops": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
// "jest/no-standalone-expect": ["error", { "additionalTestBlockFunctions": ["afterEach"] }],
// "jest/valid-expect": "off",
// "tsdoc/syntax": "error",
// "jsdoc/check-param-names": "warn",
// "jsdoc/check-property-names": "error",
// "jsdoc/require-param": "error",
// "jsdoc/require-param-name": "error",
// "jsdoc/require-returns": "warn",
// "jsdoc/require-returns-check": "error",
"import/export": "warn",
"no-useless-escape": "warn",
"no-case-declarations": "warn",
"no-prototype-builtins": "warn",
"no-loss-of-precision": "warn",
"prefer-spread": "off",
"prefer-rest-params": "off",
"no-fallthrough": "warn",
"no-async-promise-executor": "warn"
// "prettier/prettier": "error" // add this if we want to use prettier error reporting.
}
}
9 changes: 9 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"accessibility",
"progressive-web-apps"
],
"hints": {
"typescript-config/strict": "off"
}
}
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"printWidth": 180,
"singleQuote": true
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@

VRM porting to babylon.js.

This loader is used as [THE SEED ONLINE](https://seed.online) web VRM/VCI/glb viewer.
This loader is used as [VirtualCast](https://virtualcast.jp/) web VRM/VCI/glb viewer.

## Supported version table

|babylon.js version|babylon-vrm-loader version|
|---|---|
|~4.1.0|<1.5.0|
|~4.2.0|^1.5.0|
|~5.x|unreleased(will be ^2.0.0)|
|^5.19.0|^2.0.0|
|^6.0.0|will be ^3.0.0|

## Features

- Supports `.vrm` file loading
- Supports `.vrm` v0.x file loading
- with `extensions.VRM` glTF Extension
- TODO VRM v1.0 file loading
- Supports `.vci` file loading
- Supports [MToonMaterial](https://github.com/virtual-cast/babylon-mtoon-material)
- Get bone([TransformNode](https://doc.babylonjs.com/typedoc/classes/BABYLON.TransformNode)) from Unity Humanoid bone mapping name
Expand Down
56 changes: 34 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babylon-vrm-loader",
"version": "1.7.1",
"version": "2.0.0-alpha.3",
"description": "babylon.js VRM Loader",
"license": "MIT",
"author": {
Expand All @@ -23,35 +23,47 @@
"typings": "dist/index.d.ts",
"main": "dist/index.module.js",
"dependencies": {
"babylon-mtoon-material": "^3.0.0"
"babylon-mtoon-material": "^5.0.0"
},
"devDependencies": {
"@babylonjs/core": "~4.2.0",
"@babylonjs/inspector": "~4.2.0",
"@babylonjs/loaders": "~4.2.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.2.3",
"@semantic-release/npm": "^7.1.3",
"@semantic-release/release-notes-generator": "^9.0.2",
"@babylonjs/core": "^5.19.0",
"@babylonjs/gui": "^5.19.0",
"@babylonjs/gui-editor": "^5.19.0",
"@babylonjs/inspector": "^5.19.0",
"@babylonjs/loaders": "^5.19.0",
"@babylonjs/materials": "^5.19.0",
"@babylonjs/serializers": "^5.19.0",
"@semantic-release/git": "^10.0.1",
"@types/node": "^15.12.2",
"@typescript-eslint/eslint-plugin": "~5.16.0",
"@typescript-eslint/parser": "~5.16.0",
"babylonjs-gltf2interface": "^5.0.0",
"cz-conventional-changelog": "3.3.0",
"gh-pages": "^3.2.0",
"raw-loader": "^4.0.2",
"eslint": "^8.11.0",
"eslint-config-prettier": "~8.5.0",
"eslint-plugin-import": "~2.26.0",
"eslint-plugin-prettier": "~4.0.0",
"gh-pages": "^4.0.0",
"prettier": "^2.7.1",
"semantic-release": "^19.0.3",
"ts-loader": "^8.2.0",
"tslint": "^6.1.3",
"typescript": "^4.3.2",
"webpack": "^4.30.0",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.11.2",
"ts-loader": "^9.2.6",
"tslib": "^2.4.0",
"typescript": "~4.6.2",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-merge": "^5.8.0"
},
"scripts": {
"build": "webpack",
"build:gh-pages": "webpack --config webpack.test.config.js",
"lint": "tslint -p .",
"debug": "webpack-dev-server --config webpack.test.config.js",
"lint": "yarn lint:check && yarn lint:fix",
"lint:check": "eslint src",
"lint:fix": "eslint src --fix",
"format": "yarn format:check && yarn format:fix",
"format:check": "prettier --check src",
"format:fix": "prettier --write src",
"debug": "webpack serve --config webpack.test.config.js",
"release": "semantic-release",
"release:gh-pages": "gh-pages -d test -u \"Masaru Yamagishi <m-yamagishi@virtualcast.jp>\" -m \"ci(gh-pages): update gh-pages [skip ci]\""
},
Expand Down Expand Up @@ -87,7 +99,7 @@
]
},
"peerDependencies": {
"@babylonjs/core": "~4.2.0",
"@babylonjs/loaders": "~4.2.0"
"@babylonjs/core": "^5.19.0",
"@babylonjs/loaders": "^5.19.0"
}
}
Loading

0 comments on commit c2479bc

Please sign in to comment.