Skip to content

Commit

Permalink
Merge pull request #101 from brentlintner/js-next
Browse files Browse the repository at this point in the history
Support latest JavaScript and TypeScript, overhaul cli opts, etc.
  • Loading branch information
brentlintner committed Dec 25, 2023
2 parents b576021 + 8c052e9 commit 73213b7
Show file tree
Hide file tree
Showing 52 changed files with 10,391 additions and 20,328 deletions.
13 changes: 8 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
version: 2
version: '2.1'

orbs:
node: circleci/node@5.1.1

jobs:
build:
docker:
- image: circleci/node:8-jessie-browsers
- image: cimg/base:stable
steps:
- checkout
- node/install:
node-version: '20.10'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"
- run: git fetch origin $CIRCLE_BRANCH
- run:
name: Versions
command: sh bin/list-env-versions
Expand All @@ -18,7 +21,7 @@ jobs:
command: npm i
- run:
name: Test
command: npm run -s test-ci-build
command: npm run test-ci-build
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
Expand Down
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"plugins": [
"eslint-plugin-jsdoc",
"eslint-plugin-prefer-arrow",
"@typescript-eslint",
"@stylistic/ts"
],
"env": {
"browser": true,
"es6": true,
"node": true
},
"ignorePatterns": [
"bin",
"lib",
"test/fixtures"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"root": true,
"rules": {
"@stylistic/ts/semi": ["error", "never"],
"@stylistic/ts/comma-dangle": ["error", "never"],
"@stylistic/ts/type-annotation-spacing": ["error", { "before": true, "after": true }],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
lib/* linguist-vendored
test/* linguist-vendored
bin/* linguist-vendored
lib/** linguist-generated
test/fixtures/** linguist-generated
bin/** linguist-vendored
package-lock.json linguist-generated

* text eol=lf
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ node_modules
.nyc_output
coverage
npm-debug.log
tmp
tags
.ignore
38 changes: 38 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

{
"git": {
"changelog": "",
"requireCleanWorkingDir": true,
"requireBranch": false,
"requireUpstream": false,
"requireCommits": false,
"requireCommitsFail": true,
"commitsPath": "",
"addUntrackedFiles": false,
"commit": true,
"commitMessage": "v${version}",
"commitArgs": [],
"tag": true,
"tagExclude": null,
"tagName": null,
"tagMatch": null,
"getLatestTagFromAllRefs": false,
"tagAnnotation": "v${version}",
"tagArgs": [],
"push": true,
"pushArgs": ["--follow-tags"],
"pushRepo": ""
},
"npm": {
"publish": true,
"publishPath": ".",
"publishArgs": [],
"tag": null,
"otp": null,
"ignoreVersion": false,
"allowSameVersion": false,
"versionArgs": [],
"skipChecks": false,
"timeout": 10
}
}
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .vile.yml

This file was deleted.

23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# synt [![Circle CI](https://circleci.com/gh/brentlintner/synt.svg?style=shield)](https://circleci.com/gh/brentlintner/synt) [![Windows Build status](https://ci.appveyor.com/api/projects/status/t2hy3nxlqc685n1m/branch/master?svg=true)](https://ci.appveyor.com/project/brentlintner/synt/branch/master) [![travis build](https://travis-ci.org/brentlintner/synt.svg?branch=master)](https://travis-ci.org/brentlintner/synt) [![npm version](https://badge.fury.io/js/synt.svg)](https://badge.fury.io/js/synt)
# synt [![Circle CI](https://circleci.com/gh/brentlintner/synt.svg?style=shield)](https://circleci.com/gh/brentlintner/synt) [![Windows Build status](https://ci.appveyor.com/api/projects/status/t2hy3nxlqc685n1m/branch/master?svg=true)](https://ci.appveyor.com/project/brentlintner/synt/branch/master) [![npm version](https://badge.fury.io/js/synt.svg)](https://badge.fury.io/js/synt)

Find similar functions and classes in your JavaScript/TypeScript code.

![demo image](https://user-images.githubusercontent.com/93340/26853130-c50f2724-4ade-11e7-905e-6923af2a759d.png)
![demo image](https://github.com/brentlintner/synt/assets/93340/1f4f73c2-ca4c-4d55-84a9-9fe5af3489ca)

## Supported Languages

* JavaScript ([ES3-ES8](https://github.com/jquery/esprima#features))
* TypeScript

### Non-Standard JavaScript Support

For more info on support for ECMAScript Stage-3 and below proposals, see issue [#94](https://github.com/brentlintner/synt/issues/94).
* JavaScript ([ES3-ES15](https://github.com/eslint/espree?tab=readme-ov-file#options))
* TypeScript ([5.x](https://github.com/microsoft/TypeScript/tree/v5.3.3))

## System Requirements

Expand Down Expand Up @@ -55,10 +51,11 @@ const synt = require("synt")
const files = [ "a.js", "b.ts" ]

const { js, ts } = synt.compare(files, {
similarity: 70,
similarity: 80,
ngram: 1,
minlength: 10,
estype: "module"
minLength: 20,
sourceType: "module",
ecmaVersion: 6
})

synt.print(js)
Expand Down Expand Up @@ -86,7 +83,3 @@ This project ascribes to [semantic versioning](http://semver.org).

`synt` is short for [synteny](http://en.wikipedia.org/wiki/Synteny), and is
an (attempted) play on comparing code evolution to genetic (evolution).

## External Plugins

* [vile-synt](https://github.com/forthright/vile-synt)
17 changes: 4 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
version: "#{build}"

os: Visual Studio 2017
version: "1.0.{build}"

cache:
- node_modules -> package.json

environment:
matrix:
- nodejs_version: 6
- nodejs_version: 7
- nodejs_version: 8
nodejs_version: 20

matrix:
fast_finish: true
Expand All @@ -20,10 +15,6 @@ platform:
init:
- git config --global core.autocrlf input

branches:
only:
- master

skip_tags: true

clone_depth: 10
Expand All @@ -36,5 +27,5 @@ install:
- npm install

test_script:
- npm run -s compile
- npm run -s test
- npm run compile
- npm run test
11 changes: 0 additions & 11 deletions bin/lint-cov

This file was deleted.

1 change: 0 additions & 1 deletion bin/list-env-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env sh
set -x
uname -a
node --version
npm --version
2 changes: 1 addition & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ npm t

git add -f lib

npm run -s -- release-it -n -p -m 'v%s' -i $level
npm run -s release -- "$level"
7 changes: 0 additions & 7 deletions bin/test-ci-build

This file was deleted.

2 changes: 1 addition & 1 deletion coffeelint.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"value": "unix"
},
"max_line_length": {
"value": 80,
"value": 100,
"level": "error",
"limitComments": true
},
Expand Down

0 comments on commit 73213b7

Please sign in to comment.