Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Tradeshift/tradeshift-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v12.7.1
Choose a base ref
...
head repository: Tradeshift/tradeshift-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 32,963 additions and 13,250 deletions.
  1. +1 −0 .eslintignore
  2. +3 −2 .eslintrc.json
  3. +1 −1 .github/CODEOWNERS
  4. +19 −0 .github/dependabot.yml
  5. +30 −0 .github/workflows/deploy-to-s3.yml
  6. +32 −0 .github/workflows/main.yml
  7. +1 −1 .nvmrc
  8. +0 −23 .travis.yml
  9. +12 −17 Gruntfile.js
  10. +35 −6 README.md
  11. +13 −0 Repofile
  12. +1 −1 catalog-info.yml
  13. +13 −17 docs/Gruntfile.js
  14. +6,074 −2,672 docs/package-lock.json
  15. +17 −17 docs/package.json
  16. +0 −250 docs/src/js/angular-1.3.6.min.js
  17. +348 −0 docs/src/js/angular-1.8.8-xlts.js
  18. +51 −0 docs/src/xhtml/components/asides/index.xhtml
  19. +1 −1 docs/src/xhtml/components/forms/example.xhtml
  20. +1 −1 docs/src/xhtml/components/forms/test-1.xhtml
  21. +1 −1 docs/src/xhtml/components/table/angular.xhtml
  22. +68 −0 docs/src/xhtml/components/table/extras.xhtml
  23. +1 −1 docs/src/xhtml/components/times/langs.xhtml
  24. +7 −2 docs/tasks/processor.js
  25. +1 −0 docs/tasks/shooter.js
  26. +28 −0 edbml/tasks/edbml.js
  27. +260 −0 edbml/tasks/guibundles.js
  28. +330 −0 edbml/tasks/helpers/super.js
  29. +44 −0 edbml/tasks/helpers/syntax.js
  30. +112 −0 edbml/tasks/things/assistant.js
  31. +1,822 −0 edbml/tasks/things/compiler.js
  32. +104 −0 edbml/tasks/things/formatter.js
  33. +158 −0 edbml/tasks/things/inliner.js
  34. +10 −0 edbml/tasks/things/macros/@.sjs
  35. +33 −0 edbml/tasks/things/macrunner.js
  36. +151 −0 edbml/tasks/things/outliner.js
  37. +65 −0 edbml/tasks/things/shorthash.js
  38. +22,778 −10,101 package-lock.json
  39. +53 −39 package.json
  40. +1 −2 spec/spiritual/spiritual-edb/arrays/edb.ArrayPopulator.spec.js
  41. +4 −3 src/runtime/edbml/functions/ts.ui.tag.edbml
  42. +1 −1 src/runtime/edbml/scripts/ts.ui.AutocompleteDropdownSpirit.edbml
  43. +2 −1 src/runtime/edbml/scripts/ts.ui.HeaderBarSpirit.edbml
  44. +10 −5 src/runtime/edbml/scripts/ts.ui.ToolBarSpirit.edbml
  45. +12 −0 src/runtime/js/ts.ui/bars/bars-api@tradeshift.com/api/ts.ui.Header.js
  46. +13 −0 src/runtime/js/ts.ui/bars/bars-api@tradeshift.com/models/global/ts.ui.HeaderBarModel.js
  47. +6 −0 src/runtime/js/ts.ui/bars/bars-api@tradeshift.com/models/local/toolbar/ts.ui.ToolBarModel.js
  48. +14 −0 src/runtime/js/ts.ui/bars/bars-gui@tradeshift.com/spirits/global/ts.ui.HeaderBarSpirit.js
  49. +21 −0 src/runtime/js/ts.ui/bars/bars-gui@tradeshift.com/spirits/local/toolbar/ts.ui.ToolBarSpirit.js
  50. +6 −0 src/runtime/js/ts.ui/core/core-api@tradeshift.com/models/asides/ts.ui.AsideModel.js
  51. +6 −2 src/runtime/js/ts.ui/core/core-gui@tradeshift.com/spirits/dates/ts.ui.TimeSpirit.js
  52. +1 −1 src/runtime/js/ts.ui/core/core-gui@tradeshift.com/spirits/images/ts.ui.ImageSpirit.js
  53. +16 −2 src/runtime/js/ts.ui/core/core-gui@tradeshift.com/spirits/tooltip/ts.ui.TooltipSpirit.js
  54. +3 −1 src/runtime/js/ts.ui/forms/forms-gui@tradeshift.com/spirits/ts.ui.SwitchSpirit.js
  55. +38 −0 src/runtime/js/ts.ui/lang/ts-lang-ko-kr.js
  56. +38 −0 src/runtime/js/ts.ui/lang/ts-lang-ko.js
  57. +14 −0 src/runtime/js/ts.ui/layout/layout-gui@tradeshift.com/spirits/asides/ts.ui.SideShowSpirit.js
  58. +1 −1 src/runtime/less/ts-tables.less
  59. +1 −1 src/spiritual/spiritual-edbml/edbml@wunderbyte.com/module.js
  60. +1 −0 src/spiritual/spiritual-gui/gui-spirits@wunderbyte.com/gui.extensions.js
  61. +2 −3 src/spiritual/spiritual-gui/gui@wunderbyte.com/concepts/gui.Tick.js
  62. +1 −1 src/spiritual/spiritual-gui/gui@wunderbyte.com/lang/gui.Combo.js
  63. +1 −3 src/spiritual/spiritual-gui/gui@wunderbyte.com/lang/gui.Object.js
  64. +2 −2 tasks/browserstack.js
  65. +1 −1 tasks/check_cdn.js
  66. +67 −66 tasks/deploy.js
  67. +1 −1 tasks/touchfriendly.js
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -14,3 +14,4 @@ spec/jasmine
docs/src/js/dox-api@tradeshift.com/search/lunr.js
docs/tasks/prism.js
src/runtime/js/ts.ui/core/core-gui@tradeshift.com/dependencies/fastclick.js
edbml/tasks/things/compiler.js
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 5
"ecmaVersion": 5,
"requireConfigFile": false
},
"extends": "tradeshift",
"root": true,
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @Tradeshift/TradeshiftUI
* @Tradeshift/TradeshiftUI @tradeshift/ci-workers
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: npm
directory: /
rebase-strategy: auto
schedule:
interval: weekly
- package-ecosystem: npm
directory: /docs
schedule:
interval: daily
registries:
- npm-tradeshift
registries:
npm-tradeshift:
type: npm-registry
url: https://npm.pkg.github.com
token: ${{secrets.NPM_READ_TOKEN}}
30 changes: 30 additions & 0 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy to S3

on: workflow_dispatch

jobs:
deploy:
name: Build and deploy to s3
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: 18
cache: 'npm'

- name: 📥 Download deps
run: npm ci

- name: ▶️ Build
run: npm run build

- name: ▶️ Deploy to s3
run: npm run deploy-s3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_CHROME_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_CHROME_SECRET_ACCESS_KEY }}
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test & release

on:
pull_request:
push:
branches:
- master
- v11

jobs:
validate:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ github.ref == 'refs/heads/v11' && 8 || 18 }}
cache: 'npm'

- name: 📥 Download deps
run: npm ci

- name: ▶️ Run tests
run: npm test
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USER }}
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
18.20.3
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

29 changes: 12 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global process */
const path = require('path');
const { Locale } = require('@tradeshift/g11n-langneg');

@@ -11,6 +10,13 @@ module.exports = function(grunt) {
// load grunt tasks
require('load-grunt-tasks')(grunt);

// import edbml tasks
require('load-grunt-config')(grunt, {
jitGrunt: {
customTasksDir: 'edbml/tasks'
}
});

// default file encoding
grunt.file.defaultEncoding = 'utf8';

@@ -452,20 +458,10 @@ module.exports = function(grunt) {
}
},

asciify: {
banner: {
text: 'Tradeshift UI',
options: {
font: 'graffiti',
log: true
}
}
},

// serve, watch, generate concurrently
concurrent: {
docs: ['connect', 'watch', 'exec:docs_grunt'],
nodocs: ['connect', 'watch', 'asciify:banner'],
nodocs: ['connect', 'watch'],
// Build for CDN
cdn_generate_js: {
tasks: generateJsConcurrent('cdn')
@@ -534,7 +530,7 @@ module.exports = function(grunt) {
}

function compileAndMinifyLess(target = 'cdn') {
let out = [
const out = [
'exec:compile_less_to_css' // less -> css
];
if (target === 'cdn') {
@@ -549,7 +545,7 @@ module.exports = function(grunt) {
}

function build(target = 'cdn') {
let out = [
const out = [
`clean:${target}`, // remove files
'browserify', // transpiles commonjs-based dependencies into files readable by browsers
'concat:locales', // bundle locale files (synchronously BEFORE moment.js)
@@ -572,7 +568,7 @@ module.exports = function(grunt) {
}

function sizeReport(target = 'cdn') {
let out = [];
const out = [];
if (target === 'cdn') {
out.push('size_report:cdn_gzip_vs_normal');
out.push(`size_report:cdn_loaded`);
@@ -722,8 +718,7 @@ module.exports = function(grunt) {
function getlocalesprocessor(codes) {
return (src, file) => {
const code = file.match(/ts-lang-(.*)\.js/)[1];
let locale;

let locale = '';
try {
locale = Locale.parseStrict(code);
} catch (e) {
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,9 +15,11 @@ If you'd like to submit a feature request or report a bug, go to our [issues pag
1. Clone this repository
1. Install [NodeJS](https://nodejs.org/), either LTS or current.
1. Install the Grunt Command Line Utility globally.
- `npm install -g grunt-cli`
- `npm install -g grunt-cli`
1. Use the configured version of node
- `nvm use`
1. Install the dependencies of this project.
- `npm install`
- `npm install`

## Usage (Local Development)

@@ -31,6 +33,10 @@ If you'd like to submit a feature request or report a bug, go to our [issues pag
1. Run `grunt dev` (instead of just `grunt`) and the documentantion website will open up on [`http://localhost:10114/`](http://localhost:10114/)
1. Whenever you modify the source files, the script will rebuild the documentation so you're always using the latest version.

### Maintaining the v11 branch

Check out the `v11` branch and create pull requests on that branch. Releasing: see [v11 instructions](/Tradeshift/tradeshift-ui/tree/v11#release--deployment).

## Git Hooks

Watch out, whenever you create a commit, the pre-commit hook will lint all staged files and it might commit all changes in each staged file, not just the staged lines.
@@ -41,15 +47,40 @@ Our docs site is hosted by GitHub Pages at https://ui.tradeshift.com.

## Release & Deployment

Make sure you are logged in to `npm` and you have the following environment variables set:
### Manual Release:

1. **Check out a feature branch**. Name it anything. The `master` branch is protected from being pushed to directly, and your code will get released to S3 but not to git/GitHub/npm.
2. **`npm version ${increment || 'patch'}`**; Bumps the version in `package.json` and `package-lock.json`, and creates a commit and a tag for you. Examples: `npm version 12.8.4`, `npm version patch`, [see docs](https://docs.npmjs.com/cli/v8/commands/npm-version).
3. **`nvm use`** (use the specified node and npm version)
4. **`npm i`**
5. **`npm run build`**
6. **`npm run package-dist`**. That creates a `package.json` for the npm dist package.
7. **`git push origin {branch}`**; pushes the newly created commit. Don't use a fork.
8. **`git push origin {the new tag just created}`**. Example: `git push origin v12.8.4`. Run `git tag` to list tags and find the one just created.
9. **Merge** the branch into the main branch, wait for the build to succeed. Then navigate to the tag on Github and create a release from it _(could be pre-release)_
10. **Deploy** the files to S3 (no overwrites) running the Github action workflow "Deploy to S3". By default it will use the main branch. If you are releasing a `v11` release, you need to select that.
11. Make sure you are logged in to npm (run **`npm login`**).
12. **Use the right package registry**: You may have configured `@tradeshift:registry https://npm.pkg.github.com/` (run `npm config list` to check, `npm config delete @tradeshift:registry` to reset registry to default (registry.npmjs.org), `npm config set @tradeshift:registry https://npm.pkg.github.com/` to add it back). The package must be released to https://npm.pkg.github.com/, but if you want it to show up at https://www.npmjs.com/package/@tradeshift/tradeshift-ui, you must also publish using default/no config entry for `@tradeshift:registry`.
13. Go to the dist dir: **`cd dist/npm`**. In there, run **`npm publish --tag {tag_name}`**. The tag name must be `next` for `v11` releases, `latest` or not specified for latest release. This pushes the package to registry. **Note the following**:
If the tagging goes wrong and a v11 release is marked as `latest` in npm (`npm show @tradeshift/tradeshift-ui` to check), run `npm dist-tag add @tradeshift/tradeshift-ui@{LATEST_TS-UI_RELEASE} latest` (again, be aware of `@tradeshift:registry` config).

### Automatic Release

**- Currently not working -**

Alternatively, releasing can be started using one of the following commands (but release-it needs to be fixed):

1. Create a new branch. It will not work on the main branch.

2. Make sure you have the following environment variables set:

```sh
export AWS_ACCESS_KEY_ID=[Your AWS access key id]
export AWS_SECRET_ACCESS_KEY=[Your AWS secret access key]
export GH_ACCESS_TOK=[Your GitHub personal access token]
```

Releasing can be started using one of the following commands:
3. Run one of the following commands:

```sh
# Let's say the current version is v10.0.0
@@ -106,8 +137,6 @@ Any of these commands will essentially do the following steps:
- Release to GitHub _(could be pre-release)_ # Mark the tag as a GitHub Release
- `npm publish` _(tag is latest or next)_ # Push the package to registry.npmjs.org

Make sure to not do this on the `master` branch because it is protected from being pushed to directly and your code will get released to S3 but not to git/GitHub/npm.

## Updating the docs

We serve the docs site from the `gh-pages` branch and all generated files are present in the `.gitignore` of the `master`-style branches. The `gh-pages` branch only contains these generated files, one folder for each major version since we introduced versioning to the docs (`v10`).
13 changes: 13 additions & 0 deletions Repofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"description": "The Tradeshift UI Library & Framework",
"topics": [
"JavaScript",
"UI"
],
"extraProtectedBranches": [
"v11"
],
"maintainers": [
"partner-enablement-and-apps"
]
}
2 changes: 1 addition & 1 deletion catalog-info.yml
Original file line number Diff line number Diff line change
@@ -19,5 +19,5 @@ metadata:
- npm
spec:
type: library
owner: tradeshiftui
owner: partner-enablement-and-apps
lifecycle: production
30 changes: 13 additions & 17 deletions docs/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ const bsshooter = require('./tasks/shooter.js');
const cheerio = require('cheerio');
const path = require('path');
const fs = require('fs');
const S = require('string');

var stackconf = {
username: process.env.BROWSERSTACK_USERNAME,
@@ -32,6 +31,13 @@ module.exports = function(grunt) {
// autoload everything that looks like Grunt tasks
require('load-grunt-tasks')(grunt);

// import edbml tasks
require('load-grunt-config')(grunt, {
jitGrunt: {
customTasksDir: '../edbml/tasks'
}
});

// read config and apply local overrides (gitignored!)
var config = require('./tasks/config')
.init(grunt)
@@ -131,7 +137,7 @@ module.exports = function(grunt) {
cwd: 'src/js/',
dest: 'dist/assets/',
src: [
'angular-1.3.6.min.js',
'angular-1.8.8-xlts.min.js',
'jquery-2.2.4.min.js',
'template.js',
'lunr.min.js',
@@ -265,7 +271,7 @@ module.exports = function(grunt) {

concurrent: {
localdev: {
tasks: ['connect', 'watch', 'asciify:banner'],
tasks: ['connect', 'watch'],
options: {
logConcurrentOutput: true
}
@@ -313,16 +319,6 @@ module.exports = function(grunt) {
differs: 'screenshots/diffs/'
}
}
},

asciify: {
banner: {
text: 'Tradeshift UI',
options: {
font: 'graffiti',
log: true
}
}
}
});

@@ -468,10 +464,13 @@ module.exports = function(grunt) {
});
return pagesIndex;
}
function isHTMLFile(filename) {
return filename.substring(filename.length - 5, filename.length) === '.html';
}
function processFile(abspath, filename) {
var pageIndex;

if (S(filename).endsWith('.html')) {
if (isHTMLFile(filename)) {
pageIndex = processHTMLFile(abspath, filename);
}
return pageIndex;
@@ -488,7 +487,6 @@ module.exports = function(grunt) {
if (!(raw.includes('robots') && raw.includes('noindex'))) {
var content = ignoreHTML(raw);

// var title = require('string')(raw).between('<title>', '</title>').s;
var title;
var left = '<title>';
var right = '</title>';
@@ -502,13 +500,11 @@ module.exports = function(grunt) {
title = raw.slice(startPos + left.length, endPos);
}

// var href = require('string')(abspath).chompLeft(prefix).s;
var href = abspath;
if (abspath.indexOf(prefix) === 0) {
href = abspath.slice(prefix.length);
}

// content = require('string')(content).trim().stripTags().stripPunctuation().s;
content = content
.trim()
.replace(RegExp('</?[^<>]*>', 'gi'), '')
Loading