Skip to content

Commit 51dda6c

Browse files
committed
feat: initial commit
0 parents  commit 51dda6c

File tree

209 files changed

+8070
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+8070
-0
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# We don't lint the generated files
2+
src/php-parser/types/node
3+
src/php-parser/types/types.ts

.eslintrc.cjs

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
// usually `true` for project root config
4+
// see https://eslint.org/docs/latest/use/configure/configuration-files#cascading-and-hierarchy
5+
root: true,
6+
7+
// use overrides to group different types of files
8+
// see https://eslint.org/docs/latest/use/configure/configuration-files#configuration-based-on-glob-patterns
9+
overrides: [
10+
{
11+
files: ['src/**/*.ts'],
12+
extends: ['@rightcapital/eslint-config-typescript'],
13+
env: { node: true },
14+
},
15+
{
16+
// test files
17+
files: ['tests/**/*.test.{ts,tsx}'],
18+
extends: ['@rightcapital/eslint-config-typescript'],
19+
env: { jest: true, node: true },
20+
},
21+
{
22+
// JavaScript config and scripts
23+
files: ['./**/*.{js,cjs,mjs,jsx}'],
24+
excludedFiles: ['src/**'],
25+
extends: ['@rightcapital/eslint-config-javascript'],
26+
env: { node: true },
27+
rules: {
28+
'import/no-extraneous-dependencies': 'off',
29+
},
30+
},
31+
{
32+
// TypeScript config and scripts
33+
files: ['./**/*.{ts,cts,mts,tsx}'],
34+
excludedFiles: ['src/**'],
35+
extends: ['@rightcapital/eslint-config-typescript'],
36+
rules: {
37+
'import/no-extraneous-dependencies': 'off',
38+
},
39+
},
40+
],
41+
};

.github/workflows/ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Prepare pnpm
15+
uses: pnpm/action-setup@v2
16+
17+
- name: Prepare Node.js
18+
uses: actions/[email protected]
19+
with:
20+
node-version-file: .node-version
21+
cache: pnpm
22+
23+
- name: Install deps
24+
run: pnpm install
25+
26+
- name: ESLint
27+
run: pnpm run eslint
28+
29+
- name: Prettier code style check
30+
run: pnpm prettier . --check

.gitignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PHP Composer vendor file
2+
vendor
3+
4+
# Node.JS node modules
5+
node_modules
6+
7+
# TSC generated files
8+
dist
9+
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
lerna-debug.log*

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm commitlint --edit --config=commitlint.config.js

.node-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.17.1

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# We don't lint the generated files
2+
src/php-parser/types/node
3+
src/php-parser/types/types.ts
4+
pnpm-lock.yaml

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

composer.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"nikic/php-parser": "^4.17"
4+
}
5+
}

composer.lock

+68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "php-parser",
3+
"version": "0.1.0",
4+
"description": "PHP Parser TypeScript representation",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"commit": "cz",
8+
"eslint": "eslint --report-unused-disable-directives 'src/**/*.ts*'",
9+
"eslint:fix": "eslint --report-unused-disable-directives --fix 'src/**/*.ts*'",
10+
"generate:types": "ts-node src/php-parser/generate-types.ts",
11+
"preinstall": "npx only-allow pnpm",
12+
"prepare": "husky install"
13+
},
14+
"repository": "https://github.com/RightCapitalHQ/php-parser",
15+
"packageManager": "[email protected]",
16+
"publishConfig": {
17+
"registry": "https://registry.npmjs.org"
18+
},
19+
"engines": {
20+
"node": ">=16.x",
21+
"pnpm": ">=8.x"
22+
},
23+
"keywords": [
24+
"PHP",
25+
"PHP Parser",
26+
"AST",
27+
"TypeScript",
28+
"Lexer"
29+
],
30+
"author": "RightCapital Ecosystem team <[email protected]>",
31+
"license": "MIT",
32+
"dependencies": {
33+
"@rightcapital/phpdoc-parser": "^0.3.5",
34+
"lodash": "^4.17.21",
35+
"mustache": "^4.2.0",
36+
"prettier": "^3.0.3",
37+
"typescript": "^5.2.2"
38+
},
39+
"devDependencies": {
40+
"@commitlint/cli": "^17.7.1",
41+
"@commitlint/config-conventional": "^17.7.0",
42+
"@commitlint/cz-commitlint": "^17.7.1",
43+
"@rightcapital/eslint-config-javascript": "^7.0.0",
44+
"@rightcapital/eslint-config-typescript": "^7.0.0",
45+
"@rightcapital/prettier-config": "^6.0.0",
46+
"@types/lodash": "^4.14.198",
47+
"@types/mustache": "^4.2.2",
48+
"@types/node": "^20.6.0",
49+
"husky": "^8.0.3"
50+
},
51+
"config": {
52+
"commitizen": {
53+
"path": "@commitlint/cz-commitlint"
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)