Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Titanium CLI v7 Beta 1 #618

Merged
merged 117 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
c1d4ff8
Initiate major refactor
cb1kenobi Aug 24, 2023
bbcbda2
Finished refactor module command
cb1kenobi Aug 24, 2023
29368f4
Removed debug
cb1kenobi Aug 24, 2023
c901a51
Rename init to go
cb1kenobi Aug 24, 2023
4e0bbd9
Fixed sdks, install path, logger instead of console, sdk list command
cb1kenobi Aug 25, 2023
a380266
Implemented sdk install command
cb1kenobi Aug 30, 2023
8ecdf6a
Fixed sdk install, added sdk subcommand aliases
cb1kenobi Sep 1, 2023
4726973
Lots of fixes and tweaks
cb1kenobi Sep 4, 2023
a53bc6f
Updated deps
cb1kenobi Sep 4, 2023
ee91fd1
Init log level, render trace/debug to stderr, colorize help, add cmd …
cb1kenobi Sep 4, 2023
28b962f
Added help class, wired up setup screens
cb1kenobi Sep 5, 2023
601b4dc
Wired up setup quick and most of check
cb1kenobi Sep 6, 2023
a61cb3f
Added setup android, cleanup
cb1kenobi Sep 6, 2023
78132f8
Fixed create help, fixed cli.emit()
cb1kenobi Sep 6, 2023
d95c9a3
Fixed latest sdk selector, finished setup check and ios, fixed other …
cb1kenobi Sep 7, 2023
e7d0850
Added more prompting support, bug fixes
cb1kenobi Sep 10, 2023
14b02e4
Fixed colors, fixed sdk name bug, fixed validate bug
cb1kenobi Sep 10, 2023
c20f792
Bug fixes
cb1kenobi Sep 10, 2023
b6b8fb4
Fixed validate bug
cb1kenobi Sep 11, 2023
d242bea
Added sdk select for create, fixed sdk sorting
cb1kenobi Sep 11, 2023
ab63db5
Bug fix, disable sdk prompting if help flag set
cb1kenobi Sep 11, 2023
b9b4ede
Rename tests directory
cb1kenobi Sep 11, 2023
45532df
Remove old tests and lint config
cb1kenobi Sep 11, 2023
8c0bb30
Updated GH workflows
cb1kenobi Sep 11, 2023
87fa2ae
Removed appc refs
cb1kenobi Sep 11, 2023
37a6ad2
Removed unused about info
cb1kenobi Sep 11, 2023
60b97c3
Updated changelog
cb1kenobi Sep 11, 2023
b757f44
Updated changelog
cb1kenobi Sep 11, 2023
3a7f052
Adding back eslint
cb1kenobi Sep 12, 2023
089ae24
Fix lint issues
cb1kenobi Sep 12, 2023
09adea8
Install pnpm in workflow
cb1kenobi Sep 12, 2023
3cd0045
Adding vitest config and a test
cb1kenobi Sep 12, 2023
401a8de
Added some more test
cb1kenobi Sep 12, 2023
7894ffb
Removed husky and commitlint stuff, cleaned up package.json
cb1kenobi Sep 12, 2023
a85e8dc
Add lint to CI workflows
cb1kenobi Sep 12, 2023
cd3504e
Added more tests
cb1kenobi Sep 13, 2023
30957cc
Moved about into cli
cb1kenobi Sep 13, 2023
f450c33
Ignore tarballs
cb1kenobi Sep 13, 2023
aca7b1b
Update npmignore
cb1kenobi Sep 13, 2023
6377bf4
Minify with esbuild, remove unused deps, lazy load prompts
cb1kenobi Sep 13, 2023
cbf0157
Updated changelog
cb1kenobi Sep 13, 2023
af30041
Switch from prepare to prepack
cb1kenobi Sep 13, 2023
72bf0ab
More lazy loading, bug fixes
cb1kenobi Sep 14, 2023
41cd60d
Move tests around
cb1kenobi Sep 14, 2023
e5e3938
Added more tests
cb1kenobi Sep 14, 2023
f4bb811
Skip Windows only test
cb1kenobi Sep 14, 2023
ce5003e
Disable fail fast, fix test perm
cb1kenobi Sep 14, 2023
ee2f19d
Fix ticonfig test
cb1kenobi Sep 14, 2023
45d18dc
Fixed expand test
cb1kenobi Sep 14, 2023
617f829
More expand test fixes
cb1kenobi Sep 14, 2023
a556754
Add more tests
cb1kenobi Sep 15, 2023
cb40e37
Add back sdk select and hide sdk install -d flag
cb1kenobi Sep 15, 2023
0b2745f
Updated changelog
cb1kenobi Sep 15, 2023
7f8bfbc
Migrated from vitest to node:test.
cb1kenobi Sep 18, 2023
19834b0
Added 'ti info' test, fixed bug when no SDKs installed, fixed proxy t…
cb1kenobi Sep 19, 2023
ba78fc2
Actually add the ti info test
cb1kenobi Sep 19, 2023
5943fa6
Improved tests, started on ti sdk tests
cb1kenobi Sep 19, 2023
07568cf
Lots of bug fixes with args, fixed sdk tests
cb1kenobi Sep 20, 2023
7309003
More test fixes
cb1kenobi Sep 20, 2023
2bbc535
Fix sdk test
cb1kenobi Sep 20, 2023
dc6b65e
Add iphone for sdk test
cb1kenobi Sep 20, 2023
b75c11f
Fix sdk test again
cb1kenobi Sep 20, 2023
bf793f6
Disable proxy test for Windows
cb1kenobi Sep 20, 2023
5d9cdf2
Re-enable request proxy test for windows
cb1kenobi Sep 20, 2023
f3daeeb
Fixed request test, added concurrency to all tests
cb1kenobi Sep 20, 2023
4678a57
Add a few more tests
cb1kenobi Sep 21, 2023
4a306bc
Remove process.exit from sdk command
cb1kenobi Sep 22, 2023
757432e
Add source maps
cb1kenobi Sep 22, 2023
4c220b3
Update deps
cb1kenobi Sep 22, 2023
342674f
Remove esbuild :(
cb1kenobi Sep 23, 2023
fd213c7
Fixed some bugs
cb1kenobi Sep 23, 2023
4a9afc1
Updated changelog
cb1kenobi Sep 23, 2023
595fb1e
Updated deps and lockfile
cb1kenobi Sep 23, 2023
3513a60
Updated deps, set default app.workspace, started fixing option branches
cb1kenobi Oct 4, 2023
23dc557
Return instead of exit. Update changelog
cb1kenobi Oct 4, 2023
5995656
Add hook tests
cb1kenobi Oct 5, 2023
d0c6c9d
Updated deps
cb1kenobi Oct 19, 2023
844e54b
Added --debug, introduced re-parsing
cb1kenobi Oct 30, 2023
ed84523
More parsing bug fixes, load build platform hooks
cb1kenobi Oct 31, 2023
e1af770
Bug fixes
cb1kenobi Nov 1, 2023
368f983
Finished fixing option branches, major cleanup, jsdoc
cb1kenobi Nov 2, 2023
e1d319c
Remove concurrency setting from request test
cb1kenobi Nov 2, 2023
9d8df6e
Update changelog
cb1kenobi Nov 2, 2023
4bdd0a7
Tests and bug fixes
cb1kenobi Nov 4, 2023
490208f
Fixed lint issue
cb1kenobi Nov 4, 2023
d3c8245
Removed unnecessary logger arg
cb1kenobi Nov 4, 2023
cb25aac
Move MockStream to separate file, remove test concurrency
cb1kenobi Nov 4, 2023
631b78a
Fix tests
cb1kenobi Nov 4, 2023
3a62178
Pass tmpHome into CLI tests, save sdk zip file, fix sdk install keep …
cb1kenobi Nov 5, 2023
07c0482
More ti sdk tests
cb1kenobi Nov 9, 2023
90477fe
Fix test on macos
cb1kenobi Nov 9, 2023
b61e685
Move init SDK to separate file, add Jan's snazzy publish workflow cha…
cb1kenobi Nov 10, 2023
be00b99
Added start of mock sdk
cb1kenobi Nov 10, 2023
23791ba
More mock sdk cleanup
cb1kenobi Nov 15, 2023
9ad0214
Updated deps
cb1kenobi Dec 7, 2023
377bfa6
Updated deps
cb1kenobi Jan 4, 2024
8471a34
Add build and create tests
cb1kenobi Jan 6, 2024
a1b6ca4
Bit of refactor, cleanup
cb1kenobi Jan 6, 2024
a81e34e
Remove unnecessary files
cb1kenobi Jan 6, 2024
95c604e
Remove test debug
cb1kenobi Jan 6, 2024
4ee6c8e
Fix create, remove debug
cb1kenobi Jan 6, 2024
4082e0e
Fix --platform
cb1kenobi Jan 6, 2024
b770a4c
Fix -d conflict
cb1kenobi Jan 6, 2024
fd473bb
Updated deps and changelog
cb1kenobi Jan 8, 2024
e2f0a11
Update sdk prompt hint
cb1kenobi Jan 8, 2024
114ee0d
Fix --alloy support
cb1kenobi Jan 8, 2024
45704a1
Transform project dir
cb1kenobi Jan 9, 2024
a54f332
Bug fixes
cb1kenobi Jan 10, 2024
8a139ba
Update deps
cb1kenobi Jan 10, 2024
6b34759
Use proxy to intercept option changes
cb1kenobi Jan 10, 2024
f2e153d
Only proxy required prop
cb1kenobi Jan 10, 2024
c9835bf
Add debug when hook is fired
cb1kenobi Jan 10, 2024
325f930
Improve init() check
cb1kenobi Jan 10, 2024
459381f
Set default for flags
cb1kenobi Jan 10, 2024
4da671b
Use normal logger for hooks
cb1kenobi Jan 10, 2024
1679630
Fixed branch option double prompting, cleaned up sdk select text
cb1kenobi Jan 10, 2024
4153220
Fix test, version bump
cb1kenobi Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

61 changes: 61 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module.exports = {
env: {
es2021: true,
node: true
},
extends: [
'eslint:recommended'
],
parserOptions: {
"ecmaVersion": "latest",
"sourceType": "module"
},
plugins: [
'promise',
'security'
],
root: true,
rules: {
'array-bracket-spacing': ['warn', 'never'],
'brace-style': [2, '1tbs', { 'allowSingleLine': true }],
'camelcase': 'off',
'curly': ['error', 'all'],
'eol-last': 'error',
'indent': ['error', 'tab', { 'SwitchCase': 1 }],
'keyword-spacing': ['error'],
'linebreak-style': ['error', 'unix'],
'max-len': ['error', 200],
'no-case-declarations': 'off',
'no-cond-assign': 'off',
'no-console': 'off',
'no-control-regex': 'off',
'no-empty': 'off',
'no-inner-declarations': 'off',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-str': 'error',
'no-multiple-empty-lines': 'error',
'no-regex-spaces': 'off',
'no-trailing-spaces': 'error',
'no-unused-vars': 'off',
'no-useless-escape': 'warn',
'promise/always-return': 'off',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/catch-or-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'off',
'promise/avoid-new': 'off',
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'warn',
'promise/valid-params': 'warn',
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'ignore', 'asyncArrow': 'always' }],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', { 'nonwords': false, 'overrides': {} }]
}
};
10 changes: 2 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# .gitattributes snippet to force users to use same line endings for project.
#
#
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

#
# The above will handle all files NOT found below
# https://help.github.com/articles/dealing-with-line-endings/
# https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes



# These files are text and should be normalized (Convert crlf => lf)
*.php text
Expand Down Expand Up @@ -47,4 +41,4 @@
*.zip binary
*.7z binary
*.ttf binary
*.pyc binary
*.pyc binary
15 changes: 9 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish
on:
release:
types: [ created ]
types: [published]

jobs:
publish:
Expand All @@ -15,17 +15,20 @@ jobs:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
node-version: 20

- name: Install dependencies
run: npm ci
run: pnpm install
if: steps.node-cache.outputs.cache-hit != 'true'

- name: Lint
run: pnpm lint

- name: Publish to npm
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
RELEASE_TAG: ${{ github.event.release.prerelease && 'next' || 'latest' }}
run: npm publish --tag $RELEASE_TAG
31 changes: 23 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,35 @@ on: [push, pull_request]

jobs:
test:
name: Test on node ${{ matrix.node-version }} and ${{ matrix.os }}
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [14.x,16.x]
node: [18, 20]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Checkout repository
uses: actions/checkout@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
fetch-depth: 0

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm coverage
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
._*
.DS_Store
.eslintcache
.pnpm-debug.log
coverage
dist
/node_modules
npm-debug.log
node_modules
junit_report.xml
retirejs.output.json
coverage/
.nyc_output/
/*.tgz
27 changes: 0 additions & 27 deletions .npmignore

This file was deleted.

71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
7.0.0
-------------------
* Require Node.js 18 or newer
* Refactored entire codebase using ESM
* Removed `login`, `logout`, `plugin`, and `status` commands
* Removed all analytics/telemetry code
* Removed i18n logic; all output rendered in English
* Removed incomplete tab completion code
* `--sdk <ver>` is now a global option
- It assumes the latest installed SDK version...
- If executing the `create` command without any options, it will prompt for
the SDK version to use
* Removed "default" SDK; `<sdk-version>` in tiapp.xml is source of truth,
override with `--sdk <ver>` arg
* Replaced custom CLI arg parser (based on `optimist`) with Commander.js
- Order of arguments matter; command options must come after command
* `--log-level` is now a global option
- Used to be associated to SDK commands, but the logger belongs to the CLI
and thus the log level option belongs to the CLI
* `-d`, `--project-dir` is now a global option
- Used to be `build`, `clean`, and `project` commands only, but needed so
the CLI can read the `tiapp.xml` and determine the `<sdk-version>`;
defaults to the current working directory
- Since this conflicts with the `create` command's `-d`, `--workspace-dir`
option, special handling treats these two options the same
* Added a new `--debug` global flag to output CLI debug logging
* `ti config` changes:
- Added `--json` flag
- Replaced `--output json` with `--output json-object` output
- Removed support for `paths.commands` config setting
* `ti info` changes:
- Added `--json` flag
- Removed `haxm` info
- Removed `genymotion` and VirtualBox info
- Removed macOS info including Xcode CLI Tools
- Removed `jarsigner` from JDK detection; no longer used thanks to Gradle
- Removed `nodeAppcVer` from Titanium CLI and Titanium SDKs in info
* `ti module` changes:
- Removed global `iphone` modules as it was just a copy of `ios` modules
- Modules with `platform` other than `android`, `commonjs`, `ios`, and
`iphone` will be ignored
- Modules with invalid semantic version will be ignored
* `ti sdk` changes:
- Added `--json` flag
- Removed `activeSDK` from JSON result
- `select` subcommand is a no-op
- `install` subommand `--default` flag is a no-op
* `ti setup` changes:
- Removed Windows Store publishing info
- Removed `haxm` info
- Removed `sdk` setup
- Removed user locale setup
- Removed Xcode CLI tools detection
- Removed Titanium CLI Dependencies section from check
- Removed Java-based connection test from check
* Logger changes:
- Replaced "winston" based logger with lighter weight logger
- Trace and debug log messages written to `stderr` instead of `stdout`
- Added total run time trace message at end
- `--timestamp` option enabled only when command has `--log-level` option
* Performance improvements:
- Lazy load modules as much as possible, within reason
- Removed tons of old dead code
- Use smaller alternative dependencies
- Added total run time log message when `--log-level trace`
* Updated dependencies, replaced deprecated dependencies
- Replaced `colors` with `chalk`
- Replaced `fields` with `prompts`
- Replaced `humanize` with `pretty-bytes`
- Replaced `request` with `undici`

6.1.1 (7/13/2022)
-------------------
* Allow SDK directories to contain any version suffix
Expand Down
10 changes: 0 additions & 10 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
======================================
TiDev Titanium CLI
Titanium CLI
Copyright TiDev, Inc. 04/07/2022-Present
======================================

Expand Down
Loading
Loading