Skip to content

Commit

Permalink
Merge pull request #118 from storyblok/feature/login-cmd
Browse files Browse the repository at this point in the history
feat: login and logout commands
  • Loading branch information
alvarosabu authored Oct 29, 2024
2 parents 5968680 + c8472d0 commit 469d3a8
Show file tree
Hide file tree
Showing 40 changed files with 2,604 additions and 234 deletions.
10 changes: 5 additions & 5 deletions .github/.dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: npm
directory: /
schedule:
interval: "monthly"
interval: monthly
allow:
- dependency-name: "@storyblok/region-helper"
- dependency-name: '@storyblok/region-helper'
reviewers:
- "storyblok/plugins-team"
- storyblok/plugins-team
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ assignees: ''

---


**Current behavior:**
<!-- Describe how the bug manifests. -->

Expand Down
48 changes: 32 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,47 @@
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests",
"runtimeArgs": [
"--experimental-vm-modules"
],
"args": [
"--silent",
"--runInBand"
],
"name": "Debug Vitest Tests",
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run"],
"autoAttachChildProcesses": true,
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"windows": {
"program": "${workspaceFolder}\\node_modules\\jest\\bin\\jest.js"
}
"skipFiles": ["<node_internals>/**"]
},
{
"type": "node",
"request": "launch",
"name": "Debug pull-components",
"program": "${workspaceFolder}/dist/cli.mjs",
"args": ["push-components", "components.295017.json", "--space", "295018"],
"name": "Debug login",
"program": "${workspaceFolder}/dist/index.mjs",
"args": ["login"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Debug logout",
"program": "${workspaceFolder}/dist/index.mjs",
"args": ["logout"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Debug test",
"program": "${workspaceFolder}/dist/index.mjs",
"args": ["test", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
}
]
}
}
45 changes: 41 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
"eslint.format.enable": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"yml"
]
}
6 changes: 6 additions & 0 deletions __mocks__/fs.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// we can also use `import`, but then
// every export should be explicitly defined

const { fs } = require('memfs')

module.exports = fs
6 changes: 6 additions & 0 deletions __mocks__/fs/promises.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// we can also use `import`, but then
// every export should be explicitly defined

const { fs } = require('memfs')

module.exports = fs.promises
4 changes: 4 additions & 0 deletions __mocks__/test.netrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
machine api.storyblok.com
login julio.iglesias@storyblok.com
password my_access_token
region eu
5 changes: 3 additions & 2 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineBuildConfig } from 'unbuild';
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
declaration: true,
entries: ['./src/index'],
externals: ['consola', 'pathe'],
});
failOnWarn: false,
})
8 changes: 3 additions & 5 deletions eslint.config.js → eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { storyblokLintConfig } from '@storyblok/eslint-config'

export default storyblokLintConfig({
rules: [
{
'no-console': 'off'
}
]
rules: {
'no-console': 'off',
},
})
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,29 @@
"scripts": {
"build": "unbuild",
"build:stub": "unbuild --stub",
"dev": "node dist/index.mjs",
"dev": "pnpm run build:stub && STUB=true node dist/index.mjs",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest"

"test": "vitest",
"coverage": "vitest run --coverage"
},
"dependencies": {
"@inquirer/prompts": "^6.0.1",
"chalk": "^5.3.0",
"commander": "^12.1.0",
"consola": "^3.2.3",
"inquirer": "^10.2.2"
"dotenv": "^16.4.5",
"ofetch": "^1.4.0",
"storyblok-js-client": "^6.9.2"
},
"devDependencies": {
"@storyblok/eslint-config": "^0.2.0",
"@types/inquirer": "^9.0.7",
"@types/node": "^22.5.4",
"@vitest/coverage-v8": "^2.1.1",
"eslint": "^9.10.0",
"memfs": "^4.11.2",
"msw": "^2.4.11",
"pathe": "^1.1.2",
"typescript": "^5.6.2",
"unbuild": "^2.0.0",
Expand Down
Loading

0 comments on commit 469d3a8

Please sign in to comment.