Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: bundle dts via api-extractor and move deps to dev only #1293

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
/packages/*/node_modules
/packages/*/docs
/packages/*/lib
/packages/*/ts*/
/packages/*/types
/packages/*/temp
tsdoc-metadata.json
*.log
457 changes: 457 additions & 0 deletions api-extractor.base.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
},
"devDependencies": {
"@gltf-transform/core": "^2.4.7",
"@microsoft/api-extractor": "^7.37.0",
"@rollup/plugin-typescript": "^11.0.0",
"@types/jest": "^26.0.15",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"cross-env": "^7.0.2",
"downlevel-dts": "^0.11.0",
"eslint": "^7.12.1",
"eslint-config-mdcs": "^5.0.0",
"eslint-config-prettier": "^8.3.0",
Expand Down
1 change: 1 addition & 0 deletions packages/three-vrm-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
types/
4 changes: 4 additions & 0 deletions packages/three-vrm-core/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../api-extractor.base.json"
}
18 changes: 4 additions & 14 deletions packages/three-vrm-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@
"files": [
"/lib/",
"/ts*/",
"/types/",
"LICENSE"
],
"main": "lib/three-vrm-core.js",
"module": "lib/three-vrm-core.module.js",
"types": "types/index.d.ts",
"typesVersions": {
"<3.9": {
"*": [
"ts3.4/*"
]
}
},
"types": "lib/three-vrm-core.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/pixiv/three-vrm.git",
Expand All @@ -33,7 +25,7 @@
"build": "yarn build-dev && yarn build-prod && yarn build-types",
"build-dev": "cross-env NODE_ENV=development rollup -c",
"build-prod": "cross-env NODE_ENV=production rollup -c",
"build-types": "tsc --declaration --declarationDir ./types --emitDeclarationOnly && downlevel-dts types ts3.4/types",
"build-types": "tsc --declaration --declarationDir ./types --emitDeclarationOnly && api-extractor run && rimraf types",
"docs": "typedoc --entryPoints ./src/index.ts --out docs",
"test": "jest",
"lint": "eslint \"src/**/*.{ts,tsx}\" && yarn lint-examples && prettier \"src/**/*.{ts,tsx}\" --check",
Expand All @@ -46,11 +38,9 @@
"prettier --write"
]
},
"dependencies": {
"@pixiv/types-vrm-0.0": "2.0.6-alpha.2",
"@pixiv/types-vrmc-vrm-1.0": "2.0.6-alpha.2"
},
"devDependencies": {
"@pixiv/types-vrm-0.0": "2.0.6-alpha.2",
"@pixiv/types-vrmc-vrm-1.0": "2.0.6-alpha.2",
"@types/three": "^0.154.0",
"lint-staged": "13.1.2",
"three": "^0.154.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/three-vrm-core/src/expressions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ export { VRMExpressionMorphTargetBind } from './VRMExpressionMorphTargetBind';
export { VRMExpressionOverrideType } from './VRMExpressionOverrideType';
export { VRMExpressionPresetName } from './VRMExpressionPresetName';
export { VRMExpressionTextureTransformBind } from './VRMExpressionTextureTransformBind';

import type * as V0VRM from '@pixiv/types-vrm-0.0';
export type { V0VRM };
Comment on lines +12 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, these two lines are needed to control whether we are going to expose V0VRM from three-vrm-core or not, right?

Why we need to have this in src/expressions/index.ts , not src/index.ts ?

8 changes: 1 addition & 7 deletions packages/three-vrm-core/src/lookAt/VRMLookAt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ export class VRMLookAt {
return this._yaw;
}

/**
* Its current angle around Y axis, in degree.
*/
public set yaw(value: number) {
this._yaw = value;
this._needsUpdate = true;
Expand All @@ -93,16 +90,13 @@ export class VRMLookAt {
return this._pitch;
}

/**
* Its current angle around X axis, in degree.
*/
public set pitch(value: number) {
this._pitch = value;
this._needsUpdate = true;
}

/**
* Specifies that angles need to be applied to its [@link applier].
* Specifies that angles need to be applied to its {@link applier}.
*/
protected _needsUpdate: boolean;

Expand Down
1 change: 1 addition & 0 deletions packages/three-vrm-core/src/lookAt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export type { VRMLookAtApplier } from './VRMLookAtApplier';
export { VRMLookAtBoneApplier } from './VRMLookAtBoneApplier';
export { VRMLookAtExpressionApplier } from './VRMLookAtExpressionApplier';
export { VRMLookAtLoaderPlugin } from './VRMLookAtLoaderPlugin';
export { VRMLookAtLoaderPluginOptions } from './VRMLookAtLoaderPluginOptions';
export { VRMLookAtRangeMap } from './VRMLookAtRangeMap';
export { VRMLookAtTypeName } from './VRMLookAtTypeName';
Loading