Skip to content

Commit db34d8f

Browse files
Use standard esm instead of webpack/babel
Also introduce prettier removes the need for transpilation
1 parent 10b42b9 commit db34d8f

20 files changed

+451
-3256
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
node_modules
33
build
44
drivers-output
5-
dist
5+
dist

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"semi": false
4+
}

index.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require = require("esm")(module);
2+
const program = require("commander");
3+
4+
const { version, description } = require("./package.json");
5+
const { run: runGuides } = require("./src/guides");
6+
const { run: runApi } = require("./src/api");
7+
8+
program
9+
.version(version, "-v, --version")
10+
.description(description)
11+
.option("-p, --project <project>", 'Project name. Accepts "api" or "guides"');
12+
13+
program.on("--help", function() {
14+
console.log(`
15+
Examples:
16+
$ yarn start -p api
17+
$ yarn start -p guides
18+
`);
19+
});
20+
21+
program.parse(process.argv);
22+
23+
switch (program.project) {
24+
case "guides":
25+
runGuides();
26+
break;
27+
case "api":
28+
runApi();
29+
break;
30+
default:
31+
throw new Error("Invalid --project property");
32+
}

package.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,25 @@
44
"description": "This project reindexes algolia with the latest API & Guides documentation.",
55
"main": "index.js",
66
"scripts": {
7-
"build": "webpack",
8-
"cli": "node ./build/index.js",
9-
"start": "yarn run build && yarn run cli",
10-
"test": ""
7+
"start": "node index.js",
8+
"test": "echo '🦄'"
119
},
12-
"repository": {
13-
"type": "git",
14-
"url": "git+https://github.com/ember-learn/algolia-index-update-scripts.git"
15-
},
16-
"author": "",
17-
"license": "ISC",
10+
"repository": "git+https://github.com/ember-learn/algolia-index-update-scripts.git",
11+
"author": "Ember Learning team & Contributors",
12+
"license": "MIT",
1813
"bugs": {
1914
"url": "https://github.com/ember-learn/algolia-index-update-scripts/issues"
2015
},
2116
"homepage": "https://github.com/ember-learn/algolia-index-update-scripts#readme",
2217
"dependencies": {
2318
"algoliasearch": "^3.24.5",
24-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
2519
"bluebird": "^3.5.1",
2620
"chalk": "^2.2.0",
2721
"commander": "^2.17.1",
2822
"dotenv": "^4.0.0",
23+
"esm": "^3.0.84",
2924
"file-system": "^2.2.2",
30-
"json-loader": "^0.5.7",
3125
"request": "^2.83.0",
3226
"request-promise": "^4.2.2"
33-
},
34-
"devDependencies": {
35-
"babel-core": "^6.26.0",
36-
"babel-loader": "^7.1.2",
37-
"babel-preset-env": "^1.6.1",
38-
"webpack": "^3.8.1"
3927
}
4028
}

0 commit comments

Comments
 (0)