Skip to content

Commit 1019c71

Browse files
committed
fix: adopt template - add build scripts
1 parent 5127157 commit 1019c71

14 files changed

+5857
-8
lines changed

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "eslint-config-atomic",
3+
"ignorePatterns": ["dist/", "node_modules/"]
4+
}

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
3+
# don't diff machine generated files
4+
dist/ -diff
5+
package-lock.json -diff

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# OS metadata
2+
.DS_Store
3+
Thumbs.db
4+
5+
# Node
6+
node_modules
7+
package-lock.json
8+
9+
# TypeScript
10+
*.tsbuildinfo
11+
12+
# Build directories
13+
dist

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public-hoist-pattern[]=*
2+
package-lock=false
3+
lockfile=true
4+
prefer-frozen-lockfile=false

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
pnpm-lock.yaml
3+
package-lock.json
4+
CHANGELOG.md
5+
dist

__atom_tests__/CodeFormatManager-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {Range} from 'atom';
22
import {observeTextEditors} from 'nuclide-commons-atom/FileEventHandlers';
3-
import {SAVE_TIMEOUT} from '../lib/CodeFormatManager';
3+
import {SAVE_TIMEOUT} from '../dist/CodeFormatManager';
44
import UniversalDisposable from 'nuclide-commons/UniversalDisposable';
55
import temp from 'temp';
6-
import * as config from '../lib/config';
7-
import CodeFormatManager from '../lib/CodeFormatManager';
6+
import * as config from '../dist/config';
7+
import CodeFormatManager from '../dist/CodeFormatManager';
88
import waitsFor from '../../../../../jest/waits_for';
99

1010
const sleep = n => new Promise(r => setTimeout(r, n));

babel.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const presets = ["babel-preset-atomic"]
2+
3+
const plugins = []
4+
5+
module.exports = {
6+
presets,
7+
plugins,
8+
exclude: "node_modules/**",
9+
sourceMap: "inline",
10+
}

package.json

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
{
22
"name": "atom-ide-code-format",
33
"displayName": "Code Formatting",
4-
"repository": "https://github.com/facebook/nuclide",
5-
"main": "./lib/main.js",
4+
"repository": "https://github.com/atom-community/atom-ide-code-format",
5+
"main": "./dist/main.js",
66
"version": "0.0.0",
77
"description": "Provides a code-formatting provider API",
8-
"author": "NEEDS OWNER",
9-
"atomTestRunner": "../../../scripts/atom-test-runner.js",
8+
"scripts": {
9+
"format": "prettier --write .",
10+
"test.format": "prettier . --check",
11+
"lint": "eslint . --fix",
12+
"test.lint": "eslint .",
13+
"test": "atom --test spec",
14+
"clean": "shx rm -rf dist",
15+
"babel": "npm run clean && shx cp -r src dist && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=false babel dist --out-dir dist",
16+
"dev": "npm run clean && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=true rollup -c -w",
17+
"build": "npm run clean && cross-env NODE_ENV=production cross-env BABEL_KEEP_MODULES=true rollup -c ",
18+
"build-commit": "build-commit -o dist",
19+
"bump": "ncu -u -x coffeescript",
20+
"prepare": "npm run build"
21+
},
22+
"atomTestRunner": "./spec/runner",
23+
"activationHooks": [
24+
"core:loaded-shell-environment"
25+
],
26+
"engines": {
27+
"atom": ">=1.52.0 <2.0.0"
28+
},
1029
"nuclide": {
1130
"configMetadata": {
1231
"pathComponents": [
@@ -60,5 +79,24 @@
6079
"0.1.0": "consumeOnSaveProvider"
6180
}
6281
}
63-
}
82+
},
83+
"devDependencies": {
84+
"@babel/cli": "7.13.16",
85+
"@babel/core": "7.14.0",
86+
"@types/atom": "1.40.10",
87+
"@types/jasmine": "^3.6.10",
88+
"@types/node": "^15.0.1",
89+
"atom-jasmine3-test-runner": "^5.2.3",
90+
"babel-preset-atomic": "^4.1.0",
91+
"build-commit": "0.1.4",
92+
"cross-env": "^7.0.3",
93+
"eslint": "7.25.0",
94+
"eslint-config-atomic": "^1.14.3",
95+
"prettier-config-atomic": "^2.0.3",
96+
"rollup": "^2.46.0",
97+
"rollup-plugin-atomic": "^2.3.1",
98+
"shx": "^0.3.3",
99+
"typescript": "^4.2.4"
100+
},
101+
"prettier": "prettier-config-atomic"
64102
}

0 commit comments

Comments
 (0)