html-flip-book-react 0.0.0-alpha.1 → 0.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FlipBook.d.ts +26 -0
- package/dist/FlipBook.d.ts.map +1 -0
- package/dist/assets/html-flip-book.css +1 -0
- package/dist/flip-book.js +47 -1405
- package/dist/flip-book.js.map +1 -1
- package/dist/toolbar/FirstPageButton.d.ts +9 -0
- package/dist/toolbar/FirstPageButton.d.ts.map +1 -0
- package/dist/toolbar/FullscreenButton.d.ts +11 -0
- package/dist/toolbar/FullscreenButton.d.ts.map +1 -0
- package/dist/toolbar/LastPageButton.d.ts +9 -0
- package/dist/toolbar/LastPageButton.d.ts.map +1 -0
- package/dist/toolbar/NextButton.d.ts +9 -0
- package/dist/toolbar/NextButton.d.ts.map +1 -0
- package/dist/toolbar/PageIndicator.d.ts +9 -0
- package/dist/toolbar/PageIndicator.d.ts.map +1 -0
- package/dist/toolbar/PrevButton.d.ts +9 -0
- package/dist/toolbar/PrevButton.d.ts.map +1 -0
- package/dist/toolbar/Toolbar.d.ts +13 -0
- package/dist/toolbar/Toolbar.d.ts.map +1 -0
- package/dist/toolbar/ToolbarButton.d.ts +13 -0
- package/dist/toolbar/ToolbarButton.d.ts.map +1 -0
- package/dist/toolbar/ToolbarContext.d.ts +15 -0
- package/dist/toolbar/ToolbarContext.d.ts.map +1 -0
- package/dist/toolbar/index.d.ts +19 -0
- package/dist/toolbar/index.d.ts.map +1 -0
- package/dist/toolbar/index.js +174 -0
- package/dist/toolbar/index.js.map +1 -0
- package/package.json +45 -43
- package/dist/flip-book.d.ts +0 -14
- package/dist/flip-book.d.ts.map +0 -1
- package/example/.vscode/settings.json +0 -3
- package/example/README.md +0 -47
- package/example/assets/pages_data/en/assets/cover.jpg +0 -0
- package/example/assets/pages_data/en/assets/sql-command.png +0 -0
- package/example/assets/pages_data/en/content/000-introduction.md +0 -85
- package/example/assets/pages_data/en/content/001-databases.md +0 -39
- package/example/assets/pages_data/en/content/002-install-mysql.md +0 -162
- package/example/assets/pages_data/en/content/003-creating-tables.md +0 -304
- package/example/assets/pages_data/en/content/004-basic-syntax.md +0 -145
- package/example/assets/pages_data/en/content/005-select.md +0 -359
- package/example/assets/pages_data/en/content/006-where.md +0 -225
- package/example/assets/pages_data/en/content/007-order-and-group-by.md +0 -142
- package/example/assets/pages_data/en/content/008-insert.md +0 -86
- package/example/assets/pages_data/en/content/009-update.md +0 -92
- package/example/assets/pages_data/en/content/010-delete.md +0 -28
- package/example/assets/pages_data/en/content/011-join.md +0 -297
- package/example/assets/pages_data/en/content/012-sql-command-categories.md +0 -121
- package/example/assets/pages_data/en/content/013-sub-queries.md +0 -112
- package/example/assets/pages_data/en/content/014-unions.md +0 -124
- package/example/assets/pages_data/en/content/015-Keys-in-a-Relational Database.md +0 -51
- package/example/assets/pages_data/en/content/016-Logical-operator-keywords.md +0 -17
- package/example/assets/pages_data/en/content/017-having-clause_aggregate-functions.md +0 -184
- package/example/assets/pages_data/en/content/018-essential-mysql-functions.md +0 -190
- package/example/assets/pages_data/en/content/019-triggers-in-sql.md +0 -133
- package/example/assets/pages_data/en/content/020-TCL-commands.md +0 -154
- package/example/assets/pages_data/en/content/021-DCL-commands.md +0 -126
- package/example/assets/pages_data/en/content/100-mysqldump.md +0 -109
- package/example/assets/pages_data/en/content/101-learn-materialize.md +0 -267
- package/example/assets/pages_data/en/content/999-conclusion.md +0 -24
- package/example/assets/pages_data/he/4.txt +0 -2
- package/example/assets/pages_data/he/5.txt +0 -4
- package/example/assets/pages_data/he/6.txt +0 -4
- package/example/index.html +0 -21
- package/example/package-lock.json +0 -5324
- package/example/package.json +0 -39
- package/example/src/App.css +0 -52
- package/example/src/App.tsx +0 -25
- package/example/src/EnBook.tsx +0 -55
- package/example/src/HeBook.tsx +0 -44
- package/example/src/index.tsx +0 -12
- package/example/vite-env.d.ts +0 -1
- package/example/vite.config.js +0 -84
- package/src/FlipBook.tsx +0 -45
- package/vite.config.js +0 -66
package/example/package.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "html-flip-book-react-example",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Flipbook component for HTML",
|
|
5
|
-
"homepage": "https://doradsoft.github.io/html-flip-book/",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": "^22.x.x"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"dev": "vite",
|
|
12
|
-
"predeploy": "npm run build",
|
|
13
|
-
"deploy": "gh-pages -d dist -r https://github.com/doradsoft/html-flip-book.git",
|
|
14
|
-
"build": "vite build --mode development"
|
|
15
|
-
},
|
|
16
|
-
"author": "DoradSoft",
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"html-flip-book-react": "file:../",
|
|
20
|
-
"react": "^18.3.1",
|
|
21
|
-
"react-dom": "^18.3.1",
|
|
22
|
-
"react-markdown": "^9.0.1"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@actions/core": "^1.10.1",
|
|
26
|
-
"@types/react": "^18.3.3",
|
|
27
|
-
"@types/react-dom": "^18.3.0",
|
|
28
|
-
"@vitejs/plugin-react-refresh": "^1.3.6",
|
|
29
|
-
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
30
|
-
"react-refresh": "^0.14.2",
|
|
31
|
-
"rimraf": "^5.0.8",
|
|
32
|
-
"typescript": "^5.5.3",
|
|
33
|
-
"vite": "^5.3.3",
|
|
34
|
-
"vite-plugin-checker": "^0.7.1",
|
|
35
|
-
"vite-tsconfig-paths": "^4.3.2",
|
|
36
|
-
"vitest": "^1.6.0",
|
|
37
|
-
"gh-pages": "6.1.1"
|
|
38
|
-
}
|
|
39
|
-
}
|
package/example/src/App.css
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
html,
|
|
2
|
-
body {
|
|
3
|
-
margin: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.app {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
height: 100vh;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
header {
|
|
13
|
-
/* your styles */
|
|
14
|
-
flex-shrink: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.books-container {
|
|
18
|
-
flex-grow: 1;
|
|
19
|
-
overflow: auto;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
padding: 20px;
|
|
23
|
-
gap: 20px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.he-book-container,
|
|
27
|
-
.en-book-container {
|
|
28
|
-
flex-basis: 50%;
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.he-book-container {
|
|
33
|
-
direction: rtl;
|
|
34
|
-
text-align: right;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.en-page,
|
|
38
|
-
.he-page {
|
|
39
|
-
background-color: white;
|
|
40
|
-
overflow-y: scroll;
|
|
41
|
-
overflow-x: hidden;
|
|
42
|
-
border: 1px solid #00000056;
|
|
43
|
-
padding: 2%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.en-page img {
|
|
47
|
-
max-width: 100%;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.en-page * {
|
|
51
|
-
overflow: auto;
|
|
52
|
-
}
|
package/example/src/App.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// App.tsx
|
|
2
|
-
import type { FC } from "react";
|
|
3
|
-
import "./App.css"; // Import the CSS file
|
|
4
|
-
import EnBook from "./EnBook";
|
|
5
|
-
import HeBook from "./HeBook";
|
|
6
|
-
|
|
7
|
-
export const App: FC = () => {
|
|
8
|
-
return (
|
|
9
|
-
<div className="app">
|
|
10
|
-
<header>
|
|
11
|
-
<h1>HTML Flip Book Example</h1>
|
|
12
|
-
</header>
|
|
13
|
-
<section className="books-container">
|
|
14
|
-
<section className="en-book-container">
|
|
15
|
-
<EnBook />
|
|
16
|
-
</section>
|
|
17
|
-
<section className="he-book-container">
|
|
18
|
-
<HeBook />
|
|
19
|
-
</section>
|
|
20
|
-
</section>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default App;
|
package/example/src/EnBook.tsx
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// EnBook.tsx
|
|
2
|
-
import { useEffect, useState } from 'react'
|
|
3
|
-
import { FlipBook } from 'html-flip-book-react'
|
|
4
|
-
import Markdown from 'react-markdown'
|
|
5
|
-
|
|
6
|
-
const markdownFiles = import.meta.glob('/assets/pages_data/en/content/*.md')
|
|
7
|
-
|
|
8
|
-
interface MarkdownModule {
|
|
9
|
-
default: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const EnBook = () => {
|
|
13
|
-
const [enPages, setEnPages] = useState<JSX.Element[]>([])
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
const loadMarkdownFiles = async () => {
|
|
17
|
-
const files = await Promise.all(
|
|
18
|
-
Object.entries(markdownFiles).map(async ([path, resolver]) => {
|
|
19
|
-
const content = await resolver()
|
|
20
|
-
assertIsMarkdownModule(content)
|
|
21
|
-
return {
|
|
22
|
-
path,
|
|
23
|
-
content: content.default
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
)
|
|
27
|
-
const pages = files
|
|
28
|
-
// To avoid having an empty page at the end
|
|
29
|
-
.concat([{ path: '', content: '' }])
|
|
30
|
-
.map(({ content }, index) => (
|
|
31
|
-
<div key={index} className="en-page">
|
|
32
|
-
<Markdown>{content}</Markdown>
|
|
33
|
-
</div>
|
|
34
|
-
))
|
|
35
|
-
|
|
36
|
-
setEnPages(pages)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
loadMarkdownFiles()
|
|
40
|
-
}, [])
|
|
41
|
-
|
|
42
|
-
function assertIsMarkdownModule(
|
|
43
|
-
module: unknown
|
|
44
|
-
): asserts module is MarkdownModule {
|
|
45
|
-
if (typeof (module as MarkdownModule).default !== 'string') {
|
|
46
|
-
throw new Error('Invalid markdown module')
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return enPages.length ? (
|
|
51
|
-
<FlipBook className="en-book" pages={enPages} debug={true} />
|
|
52
|
-
) : null
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default EnBook
|
package/example/src/HeBook.tsx
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// HeBook.tsx
|
|
2
|
-
import { FlipBook, PageSemantics } from 'html-flip-book-react'
|
|
3
|
-
|
|
4
|
-
const hePages = Array.from({ length: 10 }, (_, index) => (
|
|
5
|
-
<div key={index}>
|
|
6
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
7
|
-
</div>
|
|
8
|
-
))
|
|
9
|
-
|
|
10
|
-
const hePageSemanticsDict: Record<number, string> = {
|
|
11
|
-
4: 'א',
|
|
12
|
-
5: 'ב',
|
|
13
|
-
6: 'ג'
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const hePageSemantics: PageSemantics = {
|
|
17
|
-
indexToSemanticName(pageIndex: number): string {
|
|
18
|
-
return hePageSemanticsDict[pageIndex] ?? ''
|
|
19
|
-
},
|
|
20
|
-
semanticNameToIndex(semanticPageName: string): number | null {
|
|
21
|
-
const entry = Object.entries(hePageSemanticsDict).find(
|
|
22
|
-
([, value]) => value === semanticPageName
|
|
23
|
-
)
|
|
24
|
-
return entry ? parseInt(entry[0]) : null
|
|
25
|
-
},
|
|
26
|
-
indexToTitle(pageIndex: number): string {
|
|
27
|
-
const chapter = hePageSemanticsDict[pageIndex]
|
|
28
|
-
return chapter ? `פרק ${chapter}` : ''
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const HeBook = () => {
|
|
33
|
-
return (
|
|
34
|
-
<FlipBook
|
|
35
|
-
className="he-book"
|
|
36
|
-
pages={hePages}
|
|
37
|
-
pageSemantics={hePageSemantics}
|
|
38
|
-
debug={true}
|
|
39
|
-
direction="rtl"
|
|
40
|
-
/>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default HeBook
|
package/example/src/index.tsx
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ReactDOM from 'react-dom/client';
|
|
3
|
-
import { App } from './App';
|
|
4
|
-
|
|
5
|
-
const root = ReactDOM.createRoot(
|
|
6
|
-
document.getElementById('root') as HTMLElement,
|
|
7
|
-
);
|
|
8
|
-
root.render(
|
|
9
|
-
<React.StrictMode>
|
|
10
|
-
<App />
|
|
11
|
-
</React.StrictMode>,
|
|
12
|
-
);
|
package/example/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module "*.md";
|
package/example/vite.config.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import reactRefresh from '@vitejs/plugin-react-refresh'
|
|
4
|
-
import react from '@vitejs/plugin-react-swc'
|
|
5
|
-
import { defineConfig } from 'vite'
|
|
6
|
-
import checker from 'vite-plugin-checker'
|
|
7
|
-
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
8
|
-
import packageJson from './package.json'
|
|
9
|
-
|
|
10
|
-
export default defineConfig(({ mode }) => {
|
|
11
|
-
const isProd = mode === 'production'
|
|
12
|
-
return {
|
|
13
|
-
mode,
|
|
14
|
-
assetsInclude: ['**/*.md'],
|
|
15
|
-
base: '',
|
|
16
|
-
build: {
|
|
17
|
-
sourcemap: !isProd,
|
|
18
|
-
emptyOutDir: true,
|
|
19
|
-
rollupOptions: {
|
|
20
|
-
external: ['react', 'react-dom'],
|
|
21
|
-
makeAbsoluteExternalsRelative: true
|
|
22
|
-
},
|
|
23
|
-
terserOptions: {
|
|
24
|
-
module: true,
|
|
25
|
-
output: {
|
|
26
|
-
comments: () => false
|
|
27
|
-
},
|
|
28
|
-
compress: {
|
|
29
|
-
drop_console: true
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
esbuild: { legalComments: 'none' },
|
|
34
|
-
server: {
|
|
35
|
-
open: true
|
|
36
|
-
},
|
|
37
|
-
plugins: [
|
|
38
|
-
react(),
|
|
39
|
-
{
|
|
40
|
-
name: 'markdown-loader',
|
|
41
|
-
transform (_export, id) {
|
|
42
|
-
if (id.endsWith('.md')) {
|
|
43
|
-
const mdContent = fs.readFileSync(id, 'utf-8')
|
|
44
|
-
return {
|
|
45
|
-
code: `export default ${JSON.stringify(mdContent)}`,
|
|
46
|
-
map: null // provide source map if available
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
reactRefresh(),
|
|
52
|
-
tsconfigPaths(),
|
|
53
|
-
checker({
|
|
54
|
-
typescript: true
|
|
55
|
-
}),
|
|
56
|
-
{
|
|
57
|
-
name: 'update-esm-package-props',
|
|
58
|
-
generateBundle: (options, bundle) => {
|
|
59
|
-
if (isProd) {
|
|
60
|
-
for (const fileName in bundle) {
|
|
61
|
-
if (fileName.startsWith('index-')) {
|
|
62
|
-
fs.writeFile(
|
|
63
|
-
path.resolve(__dirname, './package.json'),
|
|
64
|
-
JSON.stringify(
|
|
65
|
-
{ ...packageJson, main: `dist/${fileName}` },
|
|
66
|
-
null,
|
|
67
|
-
2
|
|
68
|
-
),
|
|
69
|
-
err => {
|
|
70
|
-
if (err) throw err
|
|
71
|
-
console.log(
|
|
72
|
-
'\x1b[36m%s\x1b[0m',
|
|
73
|
-
'\nPackage ESM main entrypoint updated!\n\r'
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
})
|
package/src/FlipBook.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react'
|
|
2
|
-
import { FlipBook as FlipBookBase, PageSemantics } from 'html-flip-book-base'
|
|
3
|
-
|
|
4
|
-
interface FlipBookWrapperProps {
|
|
5
|
-
pages: React.ReactNode[]
|
|
6
|
-
className: string
|
|
7
|
-
pageSemantics?: PageSemantics
|
|
8
|
-
debug?: boolean
|
|
9
|
-
direction?: 'rtl' | 'ltr' // Add the direction property to the interface
|
|
10
|
-
// Add any other props that the wrapper might need
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const FlipBookReact: React.FC<FlipBookWrapperProps> = ({
|
|
14
|
-
pages,
|
|
15
|
-
className,
|
|
16
|
-
debug = false,
|
|
17
|
-
direction = 'ltr', // Add the direction prop
|
|
18
|
-
pageSemantics = undefined
|
|
19
|
-
}) => {
|
|
20
|
-
const flipBook = useRef(
|
|
21
|
-
new FlipBookBase({
|
|
22
|
-
pageSemantics: pageSemantics,
|
|
23
|
-
pagesCount: pages.length,
|
|
24
|
-
direction: direction
|
|
25
|
-
})
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
flipBook.current.render(`.${className}`, debug)
|
|
30
|
-
// Do any other necessary setup here
|
|
31
|
-
}, [])
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div className={className}>
|
|
35
|
-
{pages.map((page, index) => (
|
|
36
|
-
<div key={index} className="page">
|
|
37
|
-
{page}
|
|
38
|
-
</div>
|
|
39
|
-
))}
|
|
40
|
-
</div>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { FlipBookReact as FlipBook }
|
|
45
|
-
export type { PageSemantics }
|
package/vite.config.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import reactRefresh from '@vitejs/plugin-react-refresh'
|
|
2
|
-
import react from '@vitejs/plugin-react-swc'
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
4
|
-
import checker from 'vite-plugin-checker'
|
|
5
|
-
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
6
|
-
import dts from 'vite-plugin-dts'
|
|
7
|
-
import fs from 'fs'
|
|
8
|
-
import path from 'path'
|
|
9
|
-
|
|
10
|
-
export default defineConfig(({ mode }) => {
|
|
11
|
-
return {
|
|
12
|
-
mode,
|
|
13
|
-
base: '',
|
|
14
|
-
build: {
|
|
15
|
-
sourcemap: true,
|
|
16
|
-
emptyOutDir: true,
|
|
17
|
-
lib: {
|
|
18
|
-
entry: 'src/FlipBook.tsx',
|
|
19
|
-
formats: ['es'],
|
|
20
|
-
fileName: 'flip-book'
|
|
21
|
-
},
|
|
22
|
-
rollupOptions: {
|
|
23
|
-
external: ['react', 'react-dom'],
|
|
24
|
-
makeAbsoluteExternalsRelative: true
|
|
25
|
-
},
|
|
26
|
-
terserOptions: {
|
|
27
|
-
module: true,
|
|
28
|
-
output: {
|
|
29
|
-
comments: () => false
|
|
30
|
-
},
|
|
31
|
-
compress: {
|
|
32
|
-
drop_console: true
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
esbuild: { legalComments: 'none' },
|
|
37
|
-
plugins: [
|
|
38
|
-
react(),
|
|
39
|
-
reactRefresh(),
|
|
40
|
-
tsconfigPaths(),
|
|
41
|
-
checker({
|
|
42
|
-
typescript: true
|
|
43
|
-
}),
|
|
44
|
-
dts({
|
|
45
|
-
afterBuild: emittedFiles => {
|
|
46
|
-
emittedFiles.forEach((content, filePath) => {
|
|
47
|
-
if (filePath.includes('FlipBook')) {
|
|
48
|
-
const newFilePath = filePath.replace(/FlipBook/g, 'flip-book')
|
|
49
|
-
const newDir = path.dirname(newFilePath)
|
|
50
|
-
|
|
51
|
-
// Ensure the directory exists
|
|
52
|
-
if (!fs.existsSync(newDir)) {
|
|
53
|
-
fs.mkdirSync(newDir, { recursive: true })
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
fs.renameSync(filePath, newFilePath)
|
|
57
|
-
fs.writeFileSync(newFilePath, content)
|
|
58
|
-
console.log(`Renamed ${filePath} to ${newFilePath}`)
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
|