Skip to content

Commit 63fad93

Browse files
committed
Back to JS
1 parent a8dcde5 commit 63fad93

7 files changed

Lines changed: 27 additions & 26 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src
2+
copyUntypedFiles.js
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
const path = require('path');
9+
const fs = require('fs-extra');
10+
11+
/**
12+
* Copy all untyped and static assets files to lib.
13+
*/
14+
const srcDir = path.resolve(__dirname, 'src');
15+
const libDir = path.resolve(__dirname, 'lib');
16+
fs.copySync(srcDir, libDir, {
17+
filter(filepath) {
18+
return !/__tests__/.test(filepath) && !/\.ts$/.test(filepath);
19+
},
20+
});

packages/docusaurus-plugin-ideal-image/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
"version": "2.0.0-beta.6",
44
"description": "Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder).",
55
"main": "lib/index.js",
6-
"types": "src/plugin-ideal-image.d.ts",
76
"scripts": {
8-
"build": "tsc",
9-
"watch": "tsc --watch"
7+
"build": "tsc && node copyUntypedFiles.js",
8+
"watch": "node copyUntypedFiles.js && tsc --watch"
109
},
1110
"publishConfig": {
1211
"access": "public"

packages/docusaurus-plugin-ideal-image/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function (
1818
name: 'docusaurus-plugin-ideal-image',
1919

2020
getThemePath() {
21-
return path.resolve(__dirname, '../lib/theme');
21+
return path.resolve(__dirname, './theme');
2222
},
2323

2424
configureWebpack(_config: Configuration, isServer: boolean) {

packages/docusaurus-plugin-ideal-image/src/plugin-ideal-image.d.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/docusaurus-plugin-ideal-image/src/theme/IdealImage.tsx renamed to packages/docusaurus-plugin-ideal-image/src/theme/IdealImage.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
import React from 'react';
99
import IdealImage from '@endiliey/react-ideal-image';
10-
import type {Props} from '@theme/IdealImage';
1110

12-
function Image(props: Props): JSX.Element {
11+
function Image(props) {
1312
const {alt, className, img} = props;
1413

1514
// In dev env just use regular img with original file

packages/docusaurus-plugin-ideal-image/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"incremental": true,
55
"tsBuildInfoFile": "./lib/.tsbuildinfo",
66
"rootDir": "src",
7-
"outDir": "lib",
8-
"noImplicitAny": false
7+
"outDir": "lib"
98
}
109
}

0 commit comments

Comments
 (0)