Skip to content

Commit

Permalink
feat: update plugin to sf (#350)
Browse files Browse the repository at this point in the history
* Update all the versions

* Fixing code for new oclif and sf versions

* Update tests to the new style

* Handle new way to get api version from args

* More test updates

* Adding back the 'No results found' message sfdx used to do for us

* Even more tests fixes

* Update links in readme

* Update command snapshot

* chore: more correctly mock ux.log()

* chore: fix test to check for error correctly

* chore: enable numbers for wait times for timeout tests

and this is what was supported before.

* fix: switch to utility method for Ux for these commands

* chore: remove eslint disable for apiversion on getConnection()

We do want that rule now that everything's getting the api version correctly.

* fix: make column headers match previous labels

* chore: update issues url

* fix: app create without template id fails in server

It shouldn't add the templateOptions in that case.

* fix: app create/update event output

* fix: saql query data output
  • Loading branch information
smithgp authored Jan 29, 2024
1 parent eee0184 commit 488cf55
Show file tree
Hide file tree
Showing 151 changed files with 13,255 additions and 9,884 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cjs/
11 changes: 8 additions & 3 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/recommended'],
root: true,
rules: {
// this allows you to indent the 2nd line of an @param, which I think helps readability
'jsdoc/check-indentation': ['error' | 'warn', { excludeTags: ['example', 'param'] }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/restrict-template-expressions': 'off'
}
'@typescript-eslint/restrict-template-expressions': 'off',
// we had our messages done before this eslint rule existed, so turn if off for now
'sf-plugin/no-hardcoded-messages-flags': 'off',
// eslint doesn't like that we have a source folder called 'lib'
'no-restricted-imports': 'off',
},
};
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ npm-error.log
yarn-error.log
lerna-debug.log

# compiled source
oclif.manifest.json

# test artifacts
*xunit.xml
*checkstyle.xml
Expand All @@ -35,6 +32,9 @@ docs
package.json.bak.

# -- CLEAN ALL
*.tsbuildinfo
.eslintcache
.wireit
node_modules

# --
Expand All @@ -44,12 +44,11 @@ node_modules
# src/lib, so clean this manually
/lib

# sf-install will always create this file, which always takes precendent over .prettierrc.js, which
# is the only way to extend/override a prettier configuration, so make sure it doesn't get checked in
/.prettierrc.json

# os specific files
.DS_Store
.idea
*.swp
.sfdx

oclif.manifest.json
oclif.lock
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build && yarn test --forbid-only
yarn build && yarn test
File renamed without changes.
11 changes: 8 additions & 3 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"require": "ts-node/register,source-map-support/register",
"require": [
"ts-node/register"
],
"watch-extensions": "ts",
"recursive": true,
"reporter": "spec",
"timeout": 30000
}
"timeout": 600000,
"node-option": [
"loader=ts-node/esm"
]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/fermium
lts/hydrogen
4 changes: 1 addition & 3 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"nyc": {
"extends": "@salesforce/dev-config/nyc"
}
"extends": "@salesforce/dev-config/nyc"
}
12 changes: 0 additions & 12 deletions .prettierrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@salesforce/prettier-config"
5 changes: 5 additions & 0 deletions .sfdevrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"testsPath": "test/**/*.test.ts"
}
}
20 changes: 17 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"name": "Run All Tests",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "test/**/*.test.ts"],
"env": {
"NODE_ENV": "development",
Expand All @@ -31,13 +30,28 @@
"type": "node",
"request": "launch",
"name": "Run Current Test",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"sourceMaps": true,
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "${file}"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile"
},
{
"type": "node",
"request": "launch",
"name": "Run Tests in Current Test's Folder",
"sourceMaps": true,
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "--recursive", "${fileDirname}/**/*.test.ts"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, Salesforce.com, Inc.
Copyright (c) 2024, Salesforce.com, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# plugin-analytics

[![NPM](https://img.shields.io/npm/v/@salesforce/analytics.svg?label=@salesforce/analytics)](https://www.npmjs.com/package/@salesforce/analytics) [![CircleCI](https://circleci.com/gh/salesforcecli/plugin-analytics/tree/main.svg?style=shield)](https://circleci.com/gh/salesforcecli/plugin-analytics/tree/main) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/analytics.svg)](https://npmjs.org/package/@salesforce/analytics) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-analytics/main/LICENSE.txt)
[![NPM](https://img.shields.io/npm/v/@salesforce/analytics.svg?label=@salesforce/analytics)](https://www.npmjs.com/package/@salesforce/analytics) [![Build Status](https://github.com/salesforcecli/plugin-analytics/workflows/version,%20tag%20and%20github%20release/badge.svg)](https://github.com/salesforcecli/plugin-analytics/actions?query=version,%20tag%20and%20github%20release%22+branch%3Amain) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/analytics.svg)](https://npmjs.org/package/@salesforce/analytics) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-analytics/main/LICENSE.txt)

A plugin for working with Tableau CRM analytics applications, assets, and services.

Expand All @@ -27,7 +27,7 @@ sfdx plugins:install @salesforce/[email protected]

## Issues

Please report any issues at https://github.com/forcedotcom/analyticsdx-vscode/issues
Please report any issues at https://github.com/salesforcecli/plugin-analytics/issues

## Contributing

Expand Down
3 changes: 3 additions & 0 deletions bin/dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
8 changes: 8 additions & 0 deletions bin/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
// eslint-disable-next-line node/shebang
async function main() {
const { execute } = await import('@oclif/core');
await execute({ development: true, dir: import.meta.url });
}

await main();
4 changes: 0 additions & 4 deletions bin/run

This file was deleted.

9 changes: 9 additions & 0 deletions bin/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env node

// eslint-disable-next-line node/shebang
async function main() {
const { execute } = await import('@oclif/core');
await execute({ dir: import.meta.url });
}

await main();
Loading

0 comments on commit 488cf55

Please sign in to comment.