Skip to content

Commit

Permalink
Reverted some of the files that came in with the merge of master
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderYW committed Oct 16, 2021
1 parent cbb83f5 commit fb48fa9
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 61 deletions.
17 changes: 13 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# editorconfig.org
root = true
# http://editorconfig.org

[*]
indent_size = 2
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
insert_final_newline = ignore

[**.min.js]
indent_style = ignore
insert_final_newline = ignore

[MakeFile]
indent_style = space

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
16 changes: 14 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"extends": [
"plugin:adonis/typescriptPackage"
]
"plugin:adonis/typescriptPackage",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
}
20 changes: 13 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
coverage
node_modules
.DS_Store
npm-debug.log
.idea
out
coverage
test/__app
.DS_STORE
.nyc_output
dist
.idea
.vscode/
*.sublime-project
*.sublime-workspace
*.log
build
__azurite_db*
dist
shrinkwrap.yaml
gkey.json
.env
__azurite_*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message="chore(release): %s"
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build
docs
*.md
config.json
.eslintrc.json
package.json
*.html
*.txt
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"useTabs": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
}
13 changes: 13 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"core": true,
"license": "MIT",
"services": [
"github-actions"
],
"minNodeVersion": "14.17.0",
"probotApps": [
"stale",
"lock"
],
"runGhActionsOnWindows": true
}
6 changes: 3 additions & 3 deletions japaFile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
process.env.TS_NODE_FILES = true
require('ts-node/register')
require('@adonisjs/require-ts/build/register')

const { configure } = require('japa')

configure({
files: ['test/*.spec.(ts|js)'],
files: ['test/**/*.spec.ts'],
})
69 changes: 54 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@
"description": "Azure storage driver for AdonisJS drive",
"main": "./build/providers/DriveProvider.js",
"scripts": {
"lint": "eslint . --ext=.ts",
"pretest": "npm run lint",
"test": "node japaFile.js",
"clean": "rimraf -rf build",
"compile": "npm run lint && npm run clean && tsc && npm run copy:files",
"copy:files": "copyfiles \"templates/*.txt\" build",
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"clean": "del-cli build",
"compile": "npm run lint && npm run clean && tsc && copyfiles instructions.md build",
"build": "npm run compile",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"lint": "eslint . --ext=.ts",
"format": "prettier --write .",
"commit": "git-cz",
"release": "np",
"version": "npm run build",
"sync-labels": "github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json adonisjs/drive-gcs"
},
"files": [
"build/instructions.md",
"build/adonis-typings",
"build/providers",
"build/src"
],
"keywords": [
"adonisjs",
"adonis-drive",
"adonisjs-drive",
"adonis-framework",
"azure",
"azure-storage",
"blob",
"storage",
"driver",
"drive"
],
"author": "Alexander Wennerstrøm",
Expand All @@ -38,30 +47,60 @@
"url": "https://github.com/AlexanderYW/Adonis-Drive-Azure-Storage/issues"
},
"devDependencies": {
"@adonisjs/mrm-preset": "^3.0.0",
"@adonisjs/sink": "^2.0.1",
"@adonisjs/core": "^5.3.1",
"@adonisjs/mrm-preset": "^4.1.2",
"@adonisjs/require-ts": "^2.0.7",
"@poppinss/dev-utils": "^1.1.5",
"@types/node": "^16.7.5",
"commitizen": "^4.2.4",
"copyfiles": "^2.4.1",
"cz-conventional-changelog": "^3.3.0",
"del-cli": "^4.0.1",
"dotenv": "^10.0.0",
"eslint": "^7.32.0",
"eslint-plugin-adonis": "^1.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-adonis": "^1.3.3",
"eslint-plugin-prettier": "^3.4.1",
"github-label-sync": "^2.0.2",
"got": "^11.8.2",
"husky": "^7.0.2",
"japa": "^3.1.1",
"rimraf": "^3.0.2",
"standard": "^16.0.3",
"ts-node": "^10.2.1",
"typescript": "^4.2.4"
"mrm": "^3.0.8",
"np": "^7.5.0",
"prettier": "^2.3.2",
"typescript": "^4.4.2"
},
"peerDependencies": {
"@adonisjs/fold": "^4.0.9"
"@adonisjs/core": "^5.0.0"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"np": {
"contents": ".",
"anyBranch": false
},
"dependencies": {
"@azure/identity": "^1.3.0",
"@azure/storage-blob": "^12.5.0",
"resetable": "^1.0.3"
"@poppinss/utils": "^3.2.0"
},
"typings": "./build/adonis-typings/index.d.ts",
"adonisjs": {
"instructionsMd": "./build/instructions.md",
"env": {
"GCS_KEY_FILENAME": "./google-cloud-key.json",
"GCS_BUCKET": "bucketName"
},
"types": "adonis-drive-azure-storage",
"providers": [
"adonis-drive-azure-storage"
]
},
"publishConfig": {
"access": "public",
"tag": "latest"
}
}
}
42 changes: 18 additions & 24 deletions providers/DriveProvider.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
'use strict'

// const { ServiceProvider } = require('@adonisjs/fold')
// const AzureStorage = require('../src/Drivers')
// import { ApplicationContract } from '@ioc:Adonis/Core/Application'
import { ServiceProvider } from '@adonisjs/fold'
import AzureStorage from '../src/Drivers'
/*
* adonis-drive-azure-storage
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/* class DriverProvider extends ServiceProvider {
register () {
this.app.extend('Adonis/Addons/Drive', 'azure', () => {
return AzureStorage
})
}
} */
import { ApplicationContract } from '@ioc:Adonis/Core/Application'

// export default class DriverProvider extends ServiceProvider {
export default class DriverProvider {
public static needsApplication = true
constructor (protected app: ServiceProvider) {}
export default class AzureStorageProvider {
constructor(protected app: ApplicationContract) {}

public register (): void {
/* this.app.container.singleton('Adonis/Addons/LucidFilter', () => ({
filterable,
BaseModelFilter,
})) */
this.app.extend('Adonis/Addons/Drive', 'azure', () => {
return AzureStorage
public boot() {
this.app.container.withBindings(['Adonis/Core/Drive'], (Drive) => {
Drive.extend('AzureStorage', (_, __, config) => {
const { AzureStorageDriver } = require('../src/Drivers')
return new AzureStorageDriver(config)
})
})
}
}
}
8 changes: 2 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "./node_modules/@adonisjs/mrm-preset/_tsconfig",
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipLibCheck": true,
"types": [
// "@adonisjs/core"
]
"types": ["@types/node", "@adonisjs/core"],
"skipLibCheck": true
},
"exclude": [
"node_modules",
Expand Down

0 comments on commit fb48fa9

Please sign in to comment.