Skip to content

Commit

Permalink
feat: move to esm and restructure program to @tomer/generator-js
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach committed Jun 2, 2021
1 parent 10873ba commit 6c21010
Show file tree
Hide file tree
Showing 30 changed files with 2,665 additions and 5,325 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.eslintcache
coverage
/test/fixtures
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on: [push, pull_request]

jobs:
test:
name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
nodejs: [12, 14]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.nodejs }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm test
51 changes: 2 additions & 49 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
# Logs
logs/
*.log
npm-debug.log*
pnpm-debug.log*
lerna-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Dependency directories
node_modules/

# Optional npm cache directory
.npm/

# Coverage
.nyc_output
coverage/

# Optional eslint cache
node_modules
.eslintcache

# Optional REPL history
.node_repl_history

# Output of `npm pack`
*.tgz

# dotenv environment variable files
.env*

# Mac files
.DS_Store

# Yarn
.pnp/
.pnp.js
.yarn-integrity

# IntelliJ
.idea/

# Output
dist/
coverage
56 changes: 0 additions & 56 deletions .prettierignore

This file was deleted.

30 changes: 0 additions & 30 deletions babel.config.js

This file was deleted.

8 changes: 4 additions & 4 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ just a few small guidelines you need to follow.
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to https://cla.developers.google.com to see
your current agreements on file or to sign a new one.
part of the project. Head over to https://cla.developers.google.com to see your
current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
Expand All @@ -24,5 +24,5 @@ information on using pull requests.

## Community Guidelines

This project follows [Google's Open Source Community
Guidelines](https://opensource.google/conduct).
This project follows
[Google's Open Source Community Guidelines](https://opensource.google/conduct).
30 changes: 0 additions & 30 deletions lint-staged.config.js

This file was deleted.

114 changes: 53 additions & 61 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,86 +20,78 @@
"url": "https://github.com/TomerAberbach/parse-imports/issues"
},
"license": "Apache 2.0",
"main": "dist/main/index.js",
"module": "dist/module/index.js",
"files": [
"dist"
"src"
],
"type": "module",
"engines": {
"node": ">= 12.17"
},
"browserslist": [
"defaults",
"not IE 11",
"not op_mini all"
],
"exports": "./src/index.js",
"module": "./src/index.js",
"types": "./src/index.d.ts",
"scripts": {
"license": "addlicense $(git diff --name-only HEAD)",
"lint:eslint:base": "eslint --cache --ext mjs,cjs,js --ignore-path .gitignore --ignore-pattern \"**/fixtures/**/*\"",
"lint:eslint": "pnpm run lint:eslint:base -- --fix .",
"lint:prettier:base": "prettier --loglevel silent",
"lint:prettier": "pnpm run lint:prettier:base -- --write .",
"prepare": "pnpx --no-install simple-git-hooks",
"lint:prettier:base": "prettier --loglevel silent --ignore-path .eslintignore",
"lint:prettier": "run-s \"lint:prettier:base -- --write .\"",
"lint:eslint:base": "eslint --cache --ext js --ignore-path .eslintignore",
"lint:eslint": "run-s \"lint:eslint:base -- --fix .\"",
"lint": "run-s lint:*",
"test": "ava",
"build:base": "babel --delete-dir-on-start -D --no-copy-ignored --keep-file-extension --ignore \"src/**/*.test.js,src/**/fixtures/**/*\"",
"build:dev": "pnpm run build:base -- -d dist src",
"build:main": "cross-env NODE_ENV=main pnpm run build:base -- -d dist/main src",
"build:module": "cross-env NODE_ENV=module pnpm run build:base -- -d dist/module src",
"build:prod": "run-p build:main build:module",
"clean": "rimraf dist"
"test:js": "ava",
"test:ts": "tsd",
"test": "run-s test:*",
"coverage": "c8 run-s test:js"
},
"prettier": "@tomer/prettier-config",
"eslintConfig": {
"extends": "@tomer"
},
"prettier": "@tomer/prettier-config",
"browserslist": [
"node >= 10"
],
"lint-staged": {
"*.js": [
"addlicense",
"run-s \"lint:prettier:base -- --write {@}\" --",
"run-s \"lint:eslint:base -- --fix {@}\" --"
],
"*.ts": "run-s \"lint:prettier:base -- --write {@}\" --",
"*.{json,yml,md}": "run-s \"lint:prettier:base -- --write {@}\" --"
},
"tsd": {
"directory": "./test"
},
"commitlint": {
"extends": "@commitlint/config-conventional"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-push": "pnpm run test"
}
},
"ava": {
"babel": true,
"require": [
"@babel/register"
],
"files": [
"**/{*.,}test.js"
]
"simple-git-hooks": {
"pre-commit": "pnpx --no-install lint-staged",
"commit-msg": "pnpx --no-install commitlint -e"
},
"dependencies": {
"es-module-lexer": "0.3.26",
"es-module-lexer": "0.4.1",
"slashes": "2.0.2"
},
"devDependencies": {
"@ava/babel": "1.0.1",
"@babel/cli": "7.12.10",
"@babel/core": "7.12.10",
"@babel/preset-env": "7.12.11",
"@babel/register": "7.12.10",
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@tomer/eslint-config": "0.0.14",
"@tomer/prettier-config": "0.0.2",
"@types/node": "14.14.19",
"@commitlint/cli": "12.1.4",
"@commitlint/config-conventional": "12.1.4",
"@tomer/eslint-config": "0.1.1",
"@tomer/prettier-config": "0.1.0",
"ava": "3.15.0",
"ava-fast-check": "4.0.0",
"babel-eslint": "10.1.0",
"babel-plugin-unassert": "3.0.1",
"babel-preset-power-assert": "3.0.0",
"command-exists": "1.2.9",
"cross-env": "7.0.3",
"eslint": "7.16.0",
"fast-check": "2.10.0",
"husky": "4.3.6",
"lint-staged": "10.5.3",
"ava-fast-check": "4.0.2",
"c8": "7.7.2",
"eslint": "7.27.0",
"fast-check": "2.14.0",
"lint-staged": "11.0.0",
"npm-run-all": "4.1.5",
"power-assert": "1.6.1",
"prettier": "2.2.1",
"rimraf": "3.0.2",
"prettier": "2.3.0",
"shift-codegen": "7.0.3",
"shift-fuzzer": "1.0.2"
},
"engines": {
"node": ">= 10"
"shift-fuzzer": "1.0.2",
"simple-git-hooks": "2.4.1",
"tsd": "0.15.1",
"typescript": "4.3.2"
}
}
Loading

0 comments on commit 6c21010

Please sign in to comment.