Skip to content

Commit

Permalink
Merge pull request #1 from aragon/f/OS-600_setup-osx-commons-with-sub…
Browse files Browse the repository at this point in the history
…graph-package

OS-600 : setup osx commons with subgraph package
  • Loading branch information
Rekard0 authored Jul 21, 2023
2 parents 7776266 + 7cc77fa commit f5e7479
Show file tree
Hide file tree
Showing 14 changed files with 896 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a bug report to help us
title: 'Bug: <add-text-here>'
labels: bug
assignees: ''

---

**Describe the bug**
A short summary of what the bug is. Please be clear and concise.

**To Reproduce (please complete the following information)**
- Config and flags: [e.g. variable="xyz"]
- Steps to reproduce the behavior:
1. node '...'
2. make request with '....'
3. '...'
4. See error

**Current behavior**
In depth explanation, if required, or a clear and concise description of what actually happens.

**Expected behavior**
A clear and concise description of what you expected to happen.

**System (please complete the following information):**
- OS: [e.g. Fedora 35]
- Software version [e.g. Docker 8, Node 14.19.1]
- Commit hash [e.g. e84617d]

**Additional context**
Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Description

Please include a summary of the change and be sure you follow the contributions rules we do provide [here](./CONTRIBUTIONS.md)

Task: [ID]()

## Type of change

<!--- Please delete options that are not relevant. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist:

- [ ] I have selected the correct base branch.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have made corresponding changes to the documentation.
- [ ] My changes generate no new warnings.
- [ ] Any dependent changes have been merged and published in downstream modules.
- [ ] I ran all tests with success and extended them if necessary.
- [ ] I have updated the `CHANGELOG.md` file in the root folder.
28 changes: 28 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"bracketSpacing": false,
"singleQuote": true,
"arrowParens": "avoid",

"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.md",
"options": {
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false
}
}
]
}
650 changes: 650 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# osx-commons

OSX-Commons: A collection of shared resources and utilities for the Aragon OSX DAO Framework, including subgraph, contract, and SDK functionalities.
28 changes: 28 additions & 0 deletions subgraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# dependencies
node_modules

# testing
coverage

# production
build
dist
dist-ssr
*.local
.cache
typechain

# misc
.DS_Store
*.pem
*.tgz

# debug
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# generated
generated
.bin
14 changes: 14 additions & 0 deletions subgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Aragon OSx Subgraph

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [UPCOMING]

### Changed

### Added

### Removed
42 changes: 42 additions & 0 deletions subgraph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Aragon OSx Subgraph Commons

The `@aragon/osx-commons-subgraph` package provides a collection of utilities for the creation and management of subgraphs for the Aragon DAO Framework.

## Installation

To add this package to your project, navigate to your project's root directory and run:

```bash
yarn add @aragon/osx-commons-subgraph
```

## Nohoist Configuration

If this package is intended to be used with Matchstick in a mono repo, you might need to configure it to not hoist its dependencies.

This can be done by adding the following configuration to your project's root package.json file:

```json
{
"workspaces": {
"nohoist": ["**/@aragon/osx-commons-subgraph", "**/@aragon/osx-commons-subgraph/**"]
}
}
```

This configuration ensures that all dependencies for the @aragon/osx-commons-subgraph package will be installed inside its own node_modules directory, which is required by Matchstick for proper functioning.

## Usage

After installing @aragon/osx-subgraph-commons, you can import and use its functions in your Subgraph project.

Example:

```ts
import {getDaoId} from '@aragon/osx-commons-subgraph';

const daoId = getDaoId(<some-dao-address>);
console.log(`The DAO ID is: ${daoId}`);
```

In this example, the getDaoId function is used to generate a DAO ID from a given Ethereum address.
1 change: 1 addition & 0 deletions subgraph/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src';
26 changes: 26 additions & 0 deletions subgraph/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@aragon/osx-commons-subgraph",
"version": "1.0.0",
"description": "The Aragon subgraph-commons package for ID generation and other common utilities for subgraph",
"module": "index.ts",
"types": "index.ts",
"private": false,
"repository": {
"type": "git",
"url": "git+https://github.com/aragon/osx.git"
},
"author": "",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/aragon/osx/issues"
},
"homepage": "https://github.com/aragon/osx#readme",
"scripts": {
"test": ""
},
"devDependencies": {
"@graphprotocol/graph-ts": "^0.27.0",
"@types/node": "^18.7.15",
"typescript": "^4.9.5"
}
}
5 changes: 5 additions & 0 deletions subgraph/src/ids.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {Address} from '@graphprotocol/graph-ts';

export function getDaoId(dao: Address): string {
return dao.toHexString();
}
1 change: 1 addition & 0 deletions subgraph/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ids';
5 changes: 5 additions & 0 deletions subgraph/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "./node_modules/assemblyscript/std/assembly.json",
"include": ["index.ts"],
"exclude": ["node_modules"]
}
38 changes: 38 additions & 0 deletions subgraph/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@graphprotocol/graph-ts@^0.27.0":
version "0.27.0"
resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.27.0.tgz#948fe1716f6082964a01a63a19bcbf9ac44e06ff"
integrity sha512-r1SPDIZVQiGMxcY8rhFSM0y7d/xAbQf5vHMWUf59js1KgoyWpM6P3tczZqmQd7JTmeyNsDGIPzd9FeaxllsU4w==
dependencies:
assemblyscript "0.19.10"

"@types/node@^18.7.15":
version "18.16.19"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.19.tgz#cb03fca8910fdeb7595b755126a8a78144714eea"
integrity sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==

[email protected]:
version "0.19.10"
resolved "https://registry.yarnpkg.com/assemblyscript/-/assemblyscript-0.19.10.tgz#7ede6d99c797a219beb4fa4614c3eab9e6343c8e"
integrity sha512-HavcUBXB3mBTRGJcpvaQjmnmaqKHBGREjSPNsIvnAk2f9dj78y4BkMaSSdvBQYWcDDzsHQjyUC8stICFkD1Odg==
dependencies:
binaryen "101.0.0-nightly.20210723"
long "^4.0.0"

[email protected]:
version "101.0.0-nightly.20210723"
resolved "https://registry.yarnpkg.com/binaryen/-/binaryen-101.0.0-nightly.20210723.tgz#b6bb7f3501341727681a03866c0856500eec3740"
integrity sha512-eioJNqhHlkguVSbblHOtLqlhtC882SOEPKmNFZaDuz1hzQjolxZ+eu3/kaS10n3sGPONsIZsO7R9fR00UyhEUA==

long@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==

typescript@^4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

0 comments on commit f5e7479

Please sign in to comment.