origamic 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +4 -0
- package/eslint.config.mjs +37 -0
- package/package.json +34 -0
- package/pre_commit.sh +10 -0
- package/pre_commit_setup.sh +32 -0
- package/src/TODO +1 -0
- package/src/index.ts +1 -0
- package/src/parser.test.ts +1567 -0
- package/src/parser.ts +1359 -0
- package/src/types.ts +142 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.eslint.json +4 -0
- package/tsconfig.json +24 -0
package/.prettierrc
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
eslint.configs.recommended,
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: './tsconfig.eslint.json',
|
|
11
|
+
ecmaVersion: 2022,
|
|
12
|
+
sourceType: 'module',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'no-unused-vars': 'off',
|
|
17
|
+
'@typescript-eslint/no-unused-vars': [
|
|
18
|
+
'warn',
|
|
19
|
+
{
|
|
20
|
+
argsIgnorePattern: '^_',
|
|
21
|
+
varsIgnorePattern: '^_',
|
|
22
|
+
caughtErrorsIgnorePattern: '^_',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
26
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
27
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
28
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
29
|
+
'prefer-const': 'error',
|
|
30
|
+
'no-constant-condition': 'off',
|
|
31
|
+
'no-var': 'error',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
ignores: ['dist/', 'node_modules/', '*.js'],
|
|
36
|
+
},
|
|
37
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "origamic",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.build.json",
|
|
8
|
+
"start": "node dist/index.js",
|
|
9
|
+
"dev": "tsx src/index.ts",
|
|
10
|
+
"test": "node --import tsx ./node_modules/mocha/bin/mocha.js \"src/**/*.test.ts\"",
|
|
11
|
+
"lint": "eslint src/**/*.ts",
|
|
12
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
13
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
14
|
+
"format:check": "prettier --check \"src/**/*.ts\""
|
|
15
|
+
},
|
|
16
|
+
"overrides": {
|
|
17
|
+
"serialize-javascript": "^7.0.5"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@eslint/js": "^10.0.1",
|
|
21
|
+
"@types/mocha": "^10.0.10",
|
|
22
|
+
"@types/node": "^20.19.39",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
24
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
25
|
+
"buckwheat": "^1.1.2",
|
|
26
|
+
"eslint": "^10.0.1",
|
|
27
|
+
"mocha": "^11.3.0",
|
|
28
|
+
"prettier": "^3.8.1",
|
|
29
|
+
"prettier-plugin-organize-imports": "^4.2.0",
|
|
30
|
+
"tsx": "^4.21.0",
|
|
31
|
+
"typescript": "^5.2.2",
|
|
32
|
+
"typescript-eslint": "^8.56.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/pre_commit.sh
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Setup script to create Git pre-commit hook.
|
|
4
|
+
# This script creates a pre-commit hook that runs pre_commit.sh before each commit.
|
|
5
|
+
|
|
6
|
+
echo "Setting up Git pre-commit hook..."
|
|
7
|
+
|
|
8
|
+
# Create the .git/hooks directory if it does not exist.
|
|
9
|
+
mkdir -p .git/hooks
|
|
10
|
+
|
|
11
|
+
# Create the pre-commit hook.
|
|
12
|
+
cat > .git/hooks/pre-commit << 'EOF'
|
|
13
|
+
#!/bin/bash
|
|
14
|
+
|
|
15
|
+
# Run the pre-commit script.
|
|
16
|
+
./pre_commit.sh
|
|
17
|
+
|
|
18
|
+
# If the script fails, prevent the commit.
|
|
19
|
+
if [ $? -ne 0 ]; then
|
|
20
|
+
echo "Pre-commit checks failed. Commit aborted."
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
echo "Pre-commit checks passed. Proceeding with commit."
|
|
25
|
+
EOF
|
|
26
|
+
|
|
27
|
+
# Make the pre-commit hook executable.
|
|
28
|
+
chmod +x .git/hooks/pre-commit
|
|
29
|
+
|
|
30
|
+
echo "✅ Pre-commit hook has been set up successfully!"
|
|
31
|
+
echo "The hook will now run ./pre_commit.sh before each commit."
|
|
32
|
+
echo "If the script fails, the commit will be aborted."
|
package/src/TODO
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- support $<example type=""> which specifies a type name...
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("Hello, world!");
|