Skip to content

Commit

Permalink
Merge pull request forcedotcom#83 from forcedotcom/upgrade
Browse files Browse the repository at this point in the history
upgrade dependencies and project structure
  • Loading branch information
maliroteh-sf authored May 22, 2024
2 parents dc71d4b + 95fde10 commit 7b03c7f
Show file tree
Hide file tree
Showing 93 changed files with 8,733 additions and 10,435 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cjs/
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'plugin:sf-plugin/recommended'],
ignorePatterns: ['*.cjs'],
root: true,
rules: {
header: 'off'
}
};
45 changes: 0 additions & 45 deletions .eslintrc.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: yarn install
- run: yarn prettier:verify
- run: yarn format:check
64 changes: 39 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
junit.xml
# -- CLEAN
tmp/
# use yarn by default, so ignore npm
package-lock.json

# Dependency directories
node_modules/
# debug logs
npm-error.log
yarn-error.log

# Build directories
lib/
dist/
virtual-modules/
.localdevserver
junit.xml
npm-shrinkwrap.json
oclif.manifest.json
oclif.lock

# config
.env*
# compile source
dist

# tests
reports
errorShots
# test artifacts
*xunit.xml
*checkstyle.xml
*unitcoverage
.nyc_output
coverage
autoreloadtestingcopy
test_session*

# generated docs
docs

# Stores custom attributes of its containing folder, such as the position of icons or the choice of a background image
# ignore sfdx-trust files
*.tgz
*.sig
package.json.bak.

# os specific files
.DS_Store
.idea

# Don't watch git for publishing to npm
.git
# -- CLEAN ALL
*.tsbuildinfo
.eslintcache
.wireit

# oclif
tmp/
oclif.manifest.json
# --
# *********************************************************
# NOTE: put files here you don't want cleaned with sf-clean
# *********************************************************

node_modules
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
yarn lint && yarn pretty-quick --staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build && yarn test
3 changes: 3 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'**/*.{js,json,md}?(x)': () => 'npm run reformat',
};
8 changes: 8 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": ["ts-node/register"],
"watch-extensions": "ts",
"recursive": true,
"reporter": "spec",
"timeout": 600000,
"node-option": ["loader=ts-node/esm"]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
7 changes: 7 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"check-coverage": true,
"lines": 75,
"statements": 75,
"functions": 75,
"branches": 75
}
30 changes: 16 additions & 14 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"endOfLine":"auto",
"useTabs": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 80,
"htmlWhitespaceSensitivity": "ignore",
"overrides": [
{
"files": "*.html",
"options": { "parser": "lwc" }
}
]
}
"endOfLine": "auto",
"useTabs": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 120,
"htmlWhitespaceSensitivity": "ignore",
"overrides": [
{
"files": "*.html",
"options": {
"parser": "lwc"
}
}
]
}
10 changes: 10 additions & 0 deletions .sfdevrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"test": {
"testsPath": "test/unit/**/*.test.ts"
},
"wireit": {
"test": {
"dependencies": ["test:compile", "test:only", "lint"]
}
}
}
67 changes: 39 additions & 28 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"skipFiles": ["<node_internals>/**"]
},
{
"name": "Run All Unit Tests",
"type": "node",
"request": "launch",
"name": "Setup - iOS",
"program": "${workspaceFolder}/bin/run",
"args": [
"force:lightning:local:setup",
"-p",
"iOS"
],
"console": "integratedTerminal"
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": ["--inspect", "--colors", "test/unit/**/*.test.ts"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile tests"
},
{
"type": "node",
"request": "launch",
"name": "Setup - Android",
"program": "${workspaceFolder}/bin/run",
"args": [
"force:lightning:local:setup",
"-p",
"android"
],
"console": "integratedTerminal"
"name": "Run Current Test",
"program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
"args": ["--inspect", "--colors", "${file}"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile tests"
},
{
"name": "ts-node",
"type": "node",
"request": "launch",
"args": ["${relativeFile}"],
"runtimeArgs": ["-r", "ts-node/register"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"name": "Setup - iOS",
"console": "integratedTerminal",
"program": "${workspaceFolder}/bin/run",
"args": ["force:lightning:local:setup", "-p", "ios"]
},
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": ["--runInBand"],
"cwd": "${workspaceFolder}",
"name": "Setup - Android",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
"program": "${workspaceFolder}/bin/run",
"args": ["force:lightning:local:setup", "-p", "android"]
}
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"search.exclude": {
"**/dist": true,
"**/bin": true
},
"editor.tabSize": 4,
"editor.formatOnSave": true,
"rewrap.wrappingColumn": 120
}
35 changes: 19 additions & 16 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": {
"kind": "build",
"isDefault": true
},
"label": "tsc: build - tsconfig.json"
}
]
}
"version": "2.0.0",
"problemMatcher": "$tsc",
"tasks": [
{
"label": "Compile tests",
"group": {
"kind": "build",
"isDefault": true
},
"command": "yarn",
"type": "shell",
"presentation": {
"focus": false,
"panel": "dedicated"
},
"isBackground": false
}
]
}
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
network-timeout 600000
registry=https://registry.yarnpkg.com
Loading

0 comments on commit 7b03c7f

Please sign in to comment.