Allow storybook to use typescript source rather than transpiled js code
This commit is contained in:
parent
ad4cec2008
commit
db39282219
|
|
@ -1,4 +1,16 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
stories: ["../examples/**/*.stories.js"],
|
stories: ["../examples/**/*.stories.js"],
|
||||||
addons: ["@storybook/addon-knobs/register"],
|
addons: ["@storybook/addon-knobs/register"],
|
||||||
|
webpackFinal: (config) => {
|
||||||
|
config.module.rules.push({
|
||||||
|
test: /\.ts/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: require.resolve("ts-loader"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
config.resolve.extensions.push(".ts");
|
||||||
|
return config;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import * as skinview3d from "../../libs/skinview3d";
|
|
||||||
|
import * as skinview3d from "../../src/skinview3d";
|
||||||
import { withKnobs, radios, number } from "@storybook/addon-knobs";
|
import { withKnobs, radios, number } from "@storybook/addon-knobs";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -7,6 +8,7 @@ export default {
|
||||||
decorators: [withKnobs],
|
decorators: [withKnobs],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log("s", skinview3d);
|
||||||
let currentAnimation;
|
let currentAnimation;
|
||||||
|
|
||||||
const createViewer = () => {
|
const createViewer = () => {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -38,14 +38,14 @@
|
||||||
"bundles"
|
"bundles"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"skinview-utils": "^0.5.5",
|
"skinview-utils": "^0.5.6",
|
||||||
"three": "^0.117.1"
|
"three": "^0.117.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-knobs": "^5.3.19",
|
|
||||||
"@babel/core": "^7.10.4",
|
"@babel/core": "^7.10.4",
|
||||||
"@rollup/plugin-node-resolve": "^8.1.0",
|
"@rollup/plugin-node-resolve": "^8.1.0",
|
||||||
"@rollup/plugin-typescript": "^5.0.0",
|
"@rollup/plugin-typescript": "^5.0.0",
|
||||||
|
"@storybook/addon-knobs": "^5.3.19",
|
||||||
"@storybook/html": "^5.3.19",
|
"@storybook/html": "^5.3.19",
|
||||||
"@typescript-eslint/eslint-plugin": "^3.4.0",
|
"@typescript-eslint/eslint-plugin": "^3.4.0",
|
||||||
"@typescript-eslint/parser": "^3.4.0",
|
"@typescript-eslint/parser": "^3.4.0",
|
||||||
|
|
@ -56,6 +56,7 @@
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^2.18.0",
|
"rollup": "^2.18.0",
|
||||||
"rollup-plugin-terser": "^6.1.0",
|
"rollup-plugin-terser": "^6.1.0",
|
||||||
|
"ts-loader": "^8.0.0",
|
||||||
"typescript": "^3.9.5"
|
"typescript": "^3.9.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Clock } from "three";
|
import { Clock } from "three";
|
||||||
import { PlayerObject } from "./model.js";
|
import { PlayerObject } from "./model";
|
||||||
|
|
||||||
export interface IAnimation {
|
export interface IAnimation {
|
||||||
play(player: PlayerObject, time: number): void;
|
play(player: PlayerObject, time: number): void;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { SkinViewer } from "./viewer.js";
|
import { SkinViewer } from "./viewer";
|
||||||
import { Vector3 } from "three";
|
import { Vector3 } from "three";
|
||||||
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export * from "./model.js";
|
export * from "./model";
|
||||||
export * from "./viewer.js";
|
export * from "./viewer";
|
||||||
export * from "./orbit_controls.js";
|
export * from "./orbit_controls";
|
||||||
export * from "./animation.js";
|
export * from "./animation";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { applyMixins, CapeContainer, ModelType, SkinContainer, RemoteImage, TextureSource } from "skinview-utils";
|
import { applyMixins, CapeContainer, ModelType, SkinContainer, RemoteImage, TextureSource } from "skinview-utils";
|
||||||
import { NearestFilter, PerspectiveCamera, Scene, Texture, Vector2, WebGLRenderer } from "three";
|
import { NearestFilter, PerspectiveCamera, Scene, Texture, Vector2, WebGLRenderer } from "three";
|
||||||
import { RootAnimation } from "./animation.js";
|
import { RootAnimation } from "./animation";
|
||||||
import { PlayerObject } from "./model.js";
|
import { PlayerObject } from "./model";
|
||||||
|
|
||||||
export type LoadOptions = {
|
export type LoadOptions = {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue