Skip to content

Commit

Permalink
chore: fix nodejs sample app (#46)
Browse files Browse the repository at this point in the history
* chore: update readme and node version

* fix: upgrade all the packages to the latest version

* fix: source code build

* fix: build, render and lint issues

* fix: use absolute versions

* fix: tests, lint staged and husky

* chore: remove unnecessary console log

* chore: fix workflows

* Update README.md

Co-authored-by: Akash Gupta <64877812+akashrpo@users.noreply.github.com>

* Update src/cli/commands/init.tsx

Co-authored-by: Akash Gupta <64877812+akashrpo@users.noreply.github.com>

* chore: update lint rules

* refactor: remove unused return statement

* chore: update menu and add rudder-typer scripts to accept arguments

* fix: help and token commands

* fix: handle bar imports

* chore: avoid using next tag

* chore: update readme file

* fix: build, execution and test issues

* chore: clean up dependencies

* chore: clean up workflows and yarn scripts

* fix: nodejs javascript test app

* fix: nodejs javascript sampel app

* chore: add ruddertyper script

* fix: test app and root package.json

* feat: add typescript sample app

* chore: update nodejs sample apps

* chore: replace yarn with npm

* chore: clean up nodejs sample apps

* Update src/cli/commands/init.tsx

Co-authored-by: Akash Gupta <64877812+akashrpo@users.noreply.github.com>

* Update src/cli/commands/init.tsx

Co-authored-by: Akash Gupta <64877812+akashrpo@users.noreply.github.com>

* Update README.md

Co-authored-by: Akash Gupta <64877812+akashrpo@users.noreply.github.com>

* chore: remove example and update readme

---------

Co-authored-by: Akash Gupta <64877812+akashrpo@users.noreply.github.com>
Co-authored-by: Akash Gupta <akashguptarpo@gmail.com>
  • Loading branch information
3 people authored Aug 21, 2024
1 parent b67f2f2 commit d643416
Show file tree
Hide file tree
Showing 92 changed files with 16,757 additions and 18,782 deletions.
18 changes: 7 additions & 11 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,16 @@ Have an idea for improving RudderTyper? [Submit an issue first](https://github.c

```sh
# Install dependencies
$ yarn
npm run setup

# Test your RudderTyper installation by regenerating RudderTyper's ruddertyper client.
$ yarn build && yarn dev build
npm run dev build
```

### Running Tests

```sh
$ yarn test
```

### Deploying

You can deploy a new version to [`npm`](https://www.npmjs.com/package/rudder-typer) by running:

```
$ yarn release
npm run test
```

## Notes on JSON Schema AST
Expand All @@ -50,11 +43,13 @@ JSON Schema is a large spec, but RudderTyper aims to support just the subset of
- Nested objects and arrays

It also aims to handle:

- language-specific name sanitization
- name conflicts from loading `N` schemas
- shared interfaces, when identical

The following JSON Schema constructs cannot be reliably code-gened into compile-time types, so we don't plan to support them:

- combined schemas: `oneOf`, `anyOf`, `allOf`, `not`
- various type-specific vields:
- `string`: `length`, `pattern`, `format`
Expand All @@ -65,6 +60,7 @@ The following JSON Schema constructs cannot be reliably code-gened into compile-
- conditional schemas: `if`/`then`/`else`

We could explore supporting the following JSON Schema constructs in the future:

- annotations: `default` (default values) and `examples` (documentation of example values)
- definitions and references: `definitions`, `$ref`

Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4

- name: Yarn setup
uses: DerYeger/yarn-setup-action@master
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 10
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install Node.js Dependencies
run: yarn install --frozen-lockfile
- name: Install Dependencies
env:
HUSKY: 0
run: npm run setup

- name: Run Tests
run: yarn test
run: npm run test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:
with:
fetch-depth: 0

- name: Yarn setup
uses: DerYeger/yarn-setup-action@master
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 10
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
- name: Install Dependencies
env:
HUSKY: 0
run: |
yarn install --frozen-lockfile
run: npm run setup

- name: Get new version number & date
run: |
Expand All @@ -51,8 +51,8 @@ jobs:
NPM_PACKAGE_NEW_VERSION: ${{ env.CURRENT_VERSION_VALUE }}
run: |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
yarn build
yarn release:ci
npm run build
npm run release:ci
- name: Send message to Slack channel
id: slack
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/hotfix/')
steps:
- name: Checkout source branch
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Yarn setup
uses: DerYeger/yarn-setup-action@master
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 10
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
- name: Install Dependencies
env:
HUSKY: 0
run: |
yarn install --frozen-lockfile
run: npm run setup

# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
Expand All @@ -50,8 +50,7 @@ jobs:
echo "Merging master into $source_branch_name"
current_version=$(jq -r .version package.json)
yarn config set version-git-tag false
yarn version --prerelease
npm version prerelease --no-git-tag-version --no-commit-hooks
new_version=$(jq -r .version package.json)
git reset --hard
Expand Down Expand Up @@ -79,8 +78,7 @@ jobs:
echo "Current version: $CURRENT_VERSION_VALUE"
echo "New version: $NEW_VERSION_VALUE"
git fetch --no-tags --prune --depth=100 origin master
yarn config set version-git-tag true
yarn version --prerelease
npm version prerelease --no-git-tag-version --no-commit-hooks
- name: Push new version in release branch
run: |
Expand All @@ -94,4 +92,3 @@ jobs:
github_token: ${{ secrets.PAT }}
pr_title: 'chore(release): pulling ${{ steps.create-release.outputs.branch_name }} into master'
pr_body: ':crown: *An automated PR*'
pr_reviewer: 'ssbeefeater,akashrpo,MoumitaM,1abhishekpandey,saikumarrs'
13 changes: 6 additions & 7 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:
with:
fetch-depth: 0

- name: Yarn setup
uses: DerYeger/yarn-setup-action@master
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 10
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
- name: Install Dependencies
env:
HUSKY: 0
run: |
yarn install --frozen-lockfile
run: npm run setup

# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
Expand All @@ -65,7 +65,6 @@ jobs:
github_token: ${{ secrets.PAT }}
pr_title: 'chore(release): pulling master into develop post release v${{ steps.extract-version.outputs.release_version }}'
pr_body: ':crown: *An automated PR*'
pr_reviewer: 'bardisg,MoumitaM,saikumarrs'

- name: Delete hotfix release branch
uses: koj-co/delete-merged-action@master
Expand Down
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
Expand Down Expand Up @@ -51,9 +49,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Expand All @@ -65,9 +60,6 @@ dist

.DS_Store

# We use yarn.lock
package-lock.json

# VSCode
.vscode
.idea
Expand All @@ -84,3 +76,4 @@ tests/e2e/**/cypress/plugins/**
tests/e2e/**/cypress/support/**
tests/e2e/**/cypress/videos/**

reports
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run pre-commit
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
20.16.0
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
node_modules
.git
CHANGELOG.md
CHANGELOG.md
tests/e2e/**/analytics
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"printWidth": 100
"printWidth": 100,
"useTabs": false
}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @saikumarrs @akashrpo @ssbeefeater @MoumitaM @1abhishekpandey
Loading

0 comments on commit d643416

Please sign in to comment.