forked from martinandert/inflected
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6baac55
Showing
119 changed files
with
7,133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
if [[ ! -d "/Users/airhorns/Code/superflected" ]]; then | ||
echo "Cannot find source directory; Did you move it?" | ||
echo "(Looking for "/Users/airhorns/Code/superflected")" | ||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' | ||
exit 1 | ||
fi | ||
|
||
# rebuild the cache forcefully | ||
_nix_direnv_force_reload=1 direnv exec "/Users/airhorns/Code/superflected" true | ||
|
||
# Update the mtime for .envrc. | ||
# This will cause direnv to reload again - but without re-building. | ||
touch "/Users/airhorns/Code/superflected/.envrc" | ||
|
||
# Also update the timestamp of whatever profile_rc we have. | ||
# This makes sure that we know we are up to date. | ||
touch -r "/Users/airhorns/Code/superflected/.envrc" "/Users/airhorns/Code/superflected/.direnv"/*.rc |
2,027 changes: 2,027 additions & 0 deletions
2,027
.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w=" | ||
fi | ||
|
||
use flake | ||
|
||
source_env_if_exists .envrc.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
module.exports = { | ||
extends: "@gadgetinc/eslint-config", | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: ["tsconfig.json"], | ||
}, | ||
rules: { | ||
"lodash/import-scope": "off", | ||
"lodash/callback-binding": "off", | ||
"lodash/chain-style": "off", | ||
"lodash/collection-method-value": "off", | ||
"lodash/collection-ordering": "off", | ||
"lodash/collection-return": "off", | ||
"lodash/consistent-compose": "off", | ||
"lodash/identity-shorthand": "off", | ||
"lodash/matches-prop-shorthand": "off", | ||
"lodash/matches-shorthand": "off", | ||
"lodash/no-commit": "off", | ||
"lodash/no-double-unwrap": "off", | ||
"lodash/no-extra-args": "off", | ||
"lodash/no-unbound-this": "off", | ||
"lodash/path-style": "off", | ||
"lodash/prefer-compact": "off", | ||
"lodash/prefer-constant": "off", | ||
"lodash/prefer-filter": "off", | ||
"lodash/prefer-find": "off", | ||
"lodash/prefer-flat-map": "off", | ||
"lodash/prefer-get": "off", | ||
"lodash/prefer-includes": "off", | ||
"lodash/prefer-is-nil": "off", | ||
"lodash/prefer-lodash-chain": "off", | ||
"lodash/prefer-lodash-method": "off", | ||
"lodash/prefer-lodash-typecheck": "off", | ||
"lodash/prefer-map": "off", | ||
"lodash/prefer-matches": "off", | ||
"lodash/prefer-noop": "off", | ||
"lodash/prefer-over-quantifier": "off", | ||
"lodash/prefer-reject": "off", | ||
"lodash/prefer-startswith": "off", | ||
"lodash/prefer-thru": "off", | ||
"lodash/prefer-times": "off", | ||
"lodash/prefer-wrapper-method": "off", | ||
"lodash/prop-shorthand": "off", | ||
"lodash/unwrap": "off", | ||
"@typescript-eslint/no-unsafe-argument": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
extendDefaults: true, | ||
types: { | ||
Function: false, | ||
"{}": false, | ||
}, | ||
}, | ||
], | ||
"jest/no-disabled-tests": "off", | ||
"jest/no-focused-tests": "off", | ||
"jest/no-identical-title": "off", | ||
"jest/prefer-to-have-length": "off", | ||
"jest/valid-expect": "off", | ||
"jest/expect-expect": "off", | ||
"jest/no-alias-methods": "off", | ||
"jest/no-commented-out-tests": "off", | ||
"jest/no-conditional-expect": "off", | ||
"jest/no-deprecated-functions": "off", | ||
"jest/no-done-callback": "off", | ||
"jest/no-duplicate-hooks": "off", | ||
"jest/no-export": "off", | ||
"jest/no-hooks": "off", | ||
"jest/no-if": "off", | ||
"jest/no-interpolation-in-snapshots": "off", | ||
"jest/no-jasmine-globals": "off", | ||
"jest/no-jest-import": "off", | ||
"jest/no-large-snapshots": "off", | ||
"jest/no-mocks-import": "off", | ||
"jest/no-restricted-matchers": "off", | ||
"jest/no-standalone-expect": "off", | ||
"jest/no-test-prefixes": "off", | ||
"jest/no-test-return-statement": "off", | ||
"jest/prefer-called-with": "off", | ||
"jest/prefer-expect-assertions": "off", | ||
"jest/prefer-hooks-on-top": "off", | ||
"jest/prefer-spy-on": "off", | ||
"jest/prefer-strict-equal": "off", | ||
"jest/prefer-to-be": "off", | ||
"jest/prefer-to-contain": "off", | ||
"jest/prefer-todo": "off", | ||
"jest/require-hook": "off", | ||
"jest/require-to-throw-message": "off", | ||
"jest/require-top-level-describe": "off", | ||
"jest/valid-describe-callback": "off", | ||
"jest/valid-title": "off", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: "Setup test environment" | ||
description: "" | ||
inputs: {} | ||
outputs: {} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: cachix/install-nix-action@v18 | ||
with: | ||
install_url: https://releases.nixos.org/nix/nix-2.11.1/install | ||
- run: | | ||
source <(nix print-dev-env --show-trace) | ||
output_file="nix-env.txt" | ||
# Clear the output file | ||
> $output_file | ||
# Loop over each variable in the environment | ||
while IFS='=' read -r -d '' name value; do | ||
# Skip if the variable is a function or read-only or non-alphanumeric | ||
[[ "$(declare -p $name)" =~ "declare -[a-z]*r[a-z]* " ]] && continue | ||
[[ ! $name =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] && continue | ||
# Check if the variable value contains a newline | ||
if [[ "$value" != *$'\n'* ]]; then | ||
# It doesn't, so write the variable and its value (stripping quotes) to the file | ||
echo "${name}=${value//\"/}" >> $output_file | ||
fi | ||
done < <(env -0) | ||
# useful for debugging what env is exported | ||
# cat nix-env.txt | ||
shell: bash | ||
- run: cat nix-env.txt >> "$GITHUB_ENV" | ||
shell: bash | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: "Benchmark" | ||
on: | ||
push: | ||
workflow_call: | ||
workflow_dispatch: | ||
jobs: | ||
bench: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/setup-test-env | ||
- name: Run benchmarks | ||
shell: bash | ||
run: pnpm x spec/bench/superflected.bench.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "package.json" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yml | ||
release: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/setup-test-env | ||
- id: npm-publish | ||
name: Publish to npm | ||
uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
access: public | ||
- name: Publish release to github | ||
uses: softprops/action-gh-release@v1 | ||
if: ${{ steps.npm-publish.outputs.type != 'none' }} | ||
with: | ||
tag_name: ${{ steps.npm-publish.outputs.version }} | ||
generate_release_notes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: "Test" | ||
on: | ||
push: | ||
workflow_call: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/setup-test-env | ||
- name: Test | ||
shell: bash | ||
run: pnpm test | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/setup-test-env | ||
- name: Lint | ||
shell: bash | ||
run: pnpm lint | ||
|
||
build-js: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/setup-test-env | ||
- name: Build | ||
shell: bash | ||
run: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"@gadgetinc/prettier-config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "node" | ||
- "12" | ||
- "10" | ||
cache: yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2017 Martin Andert | ||
Copyright (c) 2005-2017 David Heinemeier Hansson | ||
Copyright (c) 2008 The Ruby I18n team | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.