Skip to content

Commit 72381e8

Browse files
committed
Add core code
1 parent d4f9b82 commit 72381e8

File tree

9 files changed

+507
-168
lines changed

9 files changed

+507
-168
lines changed

.eslintrc.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
module.exports = {
22
root: true,
3-
parser: '@typescript-eslint/parser',
4-
plugins: ['@typescript-eslint', 'node', 'prettier'],
3+
parser: "@typescript-eslint/parser",
4+
plugins: ["@typescript-eslint", "node"],
55
parserOptions: {
66
tsconfigRootDir: __dirname,
7-
project: ['./tsconfig.json'],
7+
project: ["./tsconfig.json"],
88
},
99
extends: [
10-
'eslint:recommended',
11-
'plugin:node/recommended',
12-
'plugin:@typescript-eslint/eslint-recommended',
13-
'plugin:@typescript-eslint/recommended',
14-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
15-
'plugin:prettier/recommended',
10+
"eslint:recommended",
11+
"plugin:node/recommended",
12+
"plugin:@typescript-eslint/eslint-recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
1615
],
1716
rules: {
18-
'prettier/prettier': 'warn',
19-
'node/no-missing-import': 'off',
20-
'node/no-empty-function': 'off',
21-
'node/no-unsupported-features/es-syntax': 'off',
22-
'node/no-missing-require': 'off',
23-
'node/shebang': 'off',
24-
'@typescript-eslint/no-use-before-define': 'off',
25-
quotes: ['warn', 'single', { avoidEscape: true }],
26-
'node/no-unpublished-import': 'off',
27-
'@typescript-eslint/no-unsafe-assignment': 'off',
28-
'@typescript-eslint/no-var-requires': 'off',
29-
'@typescript-eslint/ban-ts-comment': 'off',
30-
'@typescript-eslint/no-explicit-any': 'off',
17+
"node/no-missing-import": "off",
18+
"node/no-empty-function": "off",
19+
"node/no-unsupported-features/es-syntax": "off",
20+
"node/no-missing-require": "off",
21+
"node/shebang": "off",
22+
"@typescript-eslint/no-use-before-define": "off",
23+
"node/no-unpublished-import": "off",
24+
"@typescript-eslint/no-unsafe-assignment": "off",
25+
"@typescript-eslint/no-unsafe-member-access": "off",
26+
"@typescript-eslint/no-var-requires": "off",
27+
"@typescript-eslint/ban-ts-comment": "off",
28+
"@typescript-eslint/no-explicit-any": "off",
3129
},
3230
};

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ jobs:
1717
with:
1818
node-version: lts/*
1919
- name: Install dependencies
20-
run: npm ci
21-
- name: Test
22-
run: npm test
20+
run: yarn
2321
- name: Build
24-
run: npm run build
22+
run: yarn build
2523
- name: Release
2624
env:
2725
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,4 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# Snowpack dependency directory (https://snowpack.dev/)
45-
web_modules/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env.test
73-
.env.local
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
.parcel-cache
78-
79-
# Next.js build output
80-
.next
81-
out
82-
83-
# Nuxt.js build / generate output
84-
.nuxt
85-
dist
86-
87-
# Gatsby files
88-
.cache/
89-
# Comment in the public line in if your project uses Gatsby and not Next.js
90-
# https://nextjs.org/blog/next-9-1#public-directory-support
91-
# public
92-
93-
# vuepress build output
94-
.vuepress/dist
95-
96-
# Serverless directories
97-
.serverless/
98-
99-
# FuseBox cache
100-
.fusebox/
101-
102-
# DynamoDB Local files
103-
.dynamodb/
104-
105-
# TernJS port file
106-
.tern-port
107-
108-
# Stores VSCode versions used for testing VSCode extensions
109-
.vscode-test
110-
111-
# yarn v2
112-
.yarn/cache
113-
.yarn/unplugged
114-
.yarn/build-state.yml
115-
.yarn/install-state.gz
116-
.pnp.*
117-
118-
# Compiled code
1191
lib/
2+
temp/
3+
node_modules/
4+
temp_img/

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

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

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"singleQuote": true,
32
"trailingComma": "es5",
43
"arrowParens": "avoid",
54
"printWidth": 80

package.json

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
"scripts": {
1010
"build": "tsc",
1111
"clean": "rm -rf ./lib/",
12-
"lint": "eslint ./src/ --fix",
13-
"prepare": "husky install",
1412
"semantic-release": "semantic-release",
15-
"test:watch": "jest --watch",
16-
"test": "jest --coverage",
17-
"typecheck": "tsc --noEmit"
13+
"typecheck": "tsc --noEmit",
14+
"notion-download": "node lib/index.js",
15+
"// quick run without running a build": "",
16+
"try": "ts-node --compiler-options \"{\\\"module\\\": \\\"commonjs\\\"}\" src/index.ts %SIL_BLOOM_DOCS_NOTION% ./temp ./temp_img"
1817
},
1918
"repository": {
2019
"type": "git",
@@ -30,13 +29,27 @@
3029
"node": ">=12.0"
3130
},
3231
"keywords": [
33-
"docusaurus", "notion", "markdown"
32+
"docusaurus",
33+
"notion",
34+
"markdown"
3435
],
3536
"bugs": {
3637
"url": "https://github.com/sillsdev/notion-pull/issues"
3738
},
3839
"homepage": "https://github.com/sillsdev/notion-pull#readme",
40+
"//file-type": "have to use this version before they switched to ESM, which gives a compile error related to require()",
41+
"//[email protected]": "have to use this version before they switched to ESM, which gives a compile error related to require()",
42+
"dependencies": {
43+
"sanitize-filename": "^1.6.3",
44+
"notion-to-md": "^2.3.3",
45+
"file-type": "16.5.1",
46+
"fs-extra": "^10.1.0",
47+
"limiter": "^2.1.0",
48+
"node-fetch": "2.6.6",
49+
"@notionhq/client": "^1.0.4"
50+
},
3951
"devDependencies": {
52+
"@types/fs-extra": "^9.0.13",
4053
"@types/jest": "^26.0.24",
4154
"@types/node": "^12.20.11",
4255
"@typescript-eslint/eslint-plugin": "^4.22.0",
@@ -46,16 +59,12 @@
4659
"eslint-config-prettier": "^8.3.0",
4760
"eslint-plugin-node": "^11.1.0",
4861
"eslint-plugin-prettier": "^3.4.0",
49-
"husky": "^6.0.0",
5062
"jest": "^27.2.0",
5163
"lint-staged": "^10.5.4",
5264
"prettier": "^2.2.1",
5365
"semantic-release": "^19.0.2",
5466
"ts-jest": "^27.0.5",
5567
"ts-node": "^10.2.1",
5668
"typescript": "^4.2.4"
57-
},
58-
"lint-staged": {
59-
"*.ts": "eslint --cache --cache-location .eslintcache --fix"
6069
}
6170
}

0 commit comments

Comments
 (0)