Skip to content

Commit 6db5d8e

Browse files
committed
Remove depcreated sicp-prepare code
1 parent dd38f7b commit 6db5d8e

File tree

3 files changed

+10
-59
lines changed

3 files changed

+10
-59
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"docs": "node ./scripts/docs.mjs docs",
5656
"jsdoc": "node ./scripts/docs.mjs",
5757
"autocomplete": "node ./scripts/docs.mjs autocomplete",
58-
"build_sicp_package": "./scripts/build_sicp_package.sh",
58+
"build_sicp_package": "yarn build && node ./scripts/build_sicp_package.mjs",
5959
"publish_sicp_package": "./scripts/publish_sicp_package.sh",
6060
"benchmark": "jest --runInBand --testPathPattern='.*benchmark.*' --testPathIgnorePatterns='/dist/'",
6161
"prepare": "husky install"

scripts/build_sicp_package.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ import createContext from '../dist/createContext.js'
77
import { ACORN_PARSE_OPTIONS } from '../dist/constants.js'
88
import { Chapter } from '../dist/types.js'
99

10-
async function recursiveDirCopy(fromPath, dstPath) {
10+
async function recursiveDirCopy(srcPath, dstPath) {
1111
// Copy and keep only necessary files
12-
const files = await fsPromises.readdir(fromPath)
12+
const files = await fsPromises.readdir(srcPath)
1313

1414
return Promise.all(files.map(async fileName => {
15-
const fullFromPath = join(fromPath, fileName)
16-
const fullToPath = join(dstPath, fileName)
15+
const fullSrcPath = join(srcPath, fileName)
16+
const fullDstPath = join(dstPath, fileName)
1717

18-
const stats = await fsPromises.stat(fullFromPath)
18+
const stats = await fsPromises.stat(fullSrcPath)
1919

2020
if (stats.isFile()) {
2121
const extension = extname(fileName)
2222
if (extension !== '.js') return;
23-
await fsPromises.copyFile(fullFromPath, fullToPath)
23+
await fsPromises.copyFile(fullSrcPath, fullDstPath)
2424
} else if (stats.isDirectory()) {
25-
await fsPromises.mkdir(fullToPath)
26-
await recursiveDirCopy(fullFromPath, fullToPath)
25+
await fsPromises.mkdir(fullDstPath)
26+
await recursiveDirCopy(fullSrcPath, fullDstPath)
2727
}
2828
}))
2929
}
@@ -35,7 +35,7 @@ async function prepare() {
3535

3636
// Remove unnecessary dependencies
3737
await Promise.all([
38-
'finder.js', 'index.js', 'scope-refactoring.js', 'sicp-prepare.js'
38+
'finder.js', 'index.js', 'scope-refactoring.js'
3939
].map(fileName => fsPromises.rm(`sicp_publish/dist/${fileName}`)))
4040
}
4141

src/sicp-prepare.ts

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

0 commit comments

Comments
 (0)