Skip to content

Commit

Permalink
Merge branch 'master' into mhuchet/chore/remove-allyjs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuchet authored Apr 15, 2024
2 parents 9957716 + 779fc8c commit 76f9b35
Show file tree
Hide file tree
Showing 317 changed files with 6,212 additions and 11,607 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-seas-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@talend/scripts-config-react-webpack": minor
---

feat: add jsx file extension support
7 changes: 7 additions & 0 deletions .changeset/real-toes-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@talend/react-bootstrap": patch
"@talend/react-forms": patch
"@talend/react-cmf": patch
---

Fix imports and typing
8 changes: 8 additions & 0 deletions .changeset/seven-bananas-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@talend/json-schema-form-core": patch
---

- JSFC is a fork of https://github.com/json-schema-form/json-schema-form-core : its place is in the Fork folder
- Remove local copy of json-refs and use package instead
- add missing type to fix ts compilation error
- add a polyfill for json-refs: path-browserify
2 changes: 1 addition & 1 deletion .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 #v1.4.5
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 #v1.4.7
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: yarn test --coverage --coverageReporters json-summary

- name: Jest Coverage Comment
uses: MishaKav/jest-coverage-comment@f2e8b560403c4fd8234a2b268af3c28ca91e5cc7 #1.0.24
uses: MishaKav/jest-coverage-comment@c2d5cfd6c32e8799c6deb0fd76a8e2d9ad8b35c2 #1.0.25
with:
multiple-files: |
assets-api, ./packages/assets-api/coverage/coverage-summary.json
Expand Down
6 changes: 6 additions & 0 deletions fork/dynamic-cdn-webpack-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 13.1.2

### Patch Changes

- af0ac2d: Upgrade rimraf to version 5.0.5

## 13.1.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions fork/dynamic-cdn-webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/dynamic-cdn-webpack-plugin",
"version": "13.1.1",
"version": "13.1.2",
"description": "Dynamically get your dependencies from a cdn rather than bundling them in your app",
"license": "MIT",
"repository": "Talend/dynamic-cdn-webpack-plugin",
Expand Down Expand Up @@ -52,7 +52,7 @@
"html-webpack-plugin": "^5.6.0",
"jest": "^29.7.0",
"mz": "^2.7.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.5",
"webpack": "^5.90.3",
"webpack-cli": "^4.10.0",
"webpack-manifest-plugin": "^5.0.0"
Expand Down
12 changes: 2 additions & 10 deletions fork/dynamic-cdn-webpack-plugin/test/helpers/clean-dir.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const rimraf = require('rimraf');
const { rimraf } = require('rimraf');

module.exports = function cleanDir(dir) {
return new Promise((resolve, reject) => {
rimraf(dir, err => {
if (err) {
return reject(err);
}

return resolve();
});
});
return rimraf(dir);
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @talend/json-schema-form-core

## 1.2.4

### Patch Changes

- af0ac2d: Upgrade rimraf to version 5.0.5

## 1.2.3

### Patch Changes
Expand Down
File renamed without changes.
21 changes: 14 additions & 7 deletions packages/jsfc/README.md → fork/json-schema-form-core/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# JSON Schema Form Core

[![Gitter](https://img.shields.io/badge/GITTER-JOIN%20CHAT%20%E2%86%92-ff69b4.svg?style=flat-square)](https://gitter.im/json-schema-form/angular-schema-form?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/json-schema-form/json-schema-form-core.svg?branch=development)](https://travis-ci.org/json-schema-form/json-schema-form-core)

Expand All @@ -11,11 +12,13 @@ You **DO NOT** use this file in addition to Angular Schema Form, it is embedded
build into any frameworks using it.

## Work-In-Progress!

There is [test output](docs/test.md) that forms some super basic documentation
and I intend to expand them much further to the point of almost being
useful before I create a proper API and document that.

## Keeping Track

After changing to Webpack 2, this library now includes a detailed version
header which is passed through into `Angular Schema Form` and also the `Bootstrap` decorator bundle

Expand All @@ -31,6 +34,7 @@ header which is passed through into `Angular Schema Form` and also the `Bootstra
```

## Contributing / Plans

The main contributions we need to the core at the moment are related to both the migration
of `Angular Schema Form` features to the core (like templates/builders) and the addition
of an API for use by ASF (Angular) and RSF (React) libraries.
Expand All @@ -40,21 +44,24 @@ Please contact @Anthropic via our [Gitter](https://gitter.im/json-schema-form/an
## Testing it

### With Angular Schema Form

There is a branch in angular-schema-form called `feature/webpack-babel` that integrates the core.
To use it roughly follow these steps:

* Clone angular-schema-form to a **sibling** directory and switch to branch `feature/webpack-babel`
* `npm install` to install dependencies
* `npm run build` to build with the core.
* Use dist/angular-schema-form.js, now with the core from this folder. *No need to also load ObjectPath since it is already included*
- Clone angular-schema-form to a **sibling** directory and switch to branch `feature/webpack-babel`
- `npm install` to install dependencies
- `npm run build` to build with the core.
- Use dist/angular-schema-form.js, now with the core from this folder. _No need to also load ObjectPath since it is already included_

### With Mocha tests

Tests are written in mocha + chai and run trough `npm test`.

When the command `npm run testdoc` is run instead, the tests will also generate a readable
`markdown` file [test.md](docs/test.md) to document elements of the library.

## Notes
* ObjectPath is bundled with json-schema-form-core
* angular-schema-form bundles json-schema-form-core so the user doesn't have to include it as an dependency.
* The code for not using ObjectPath on Angular 1.2 is removed. Could maybe be fixed but I (davidlgj) strongly believe its time to drop Angular 1.2 support since it complicates validation code as well.

- ObjectPath is bundled with json-schema-form-core
- angular-schema-form bundles json-schema-form-core so the user doesn't have to include it as a dependency.
- The code for not using ObjectPath on Angular 1.2 is removed. Could maybe be fixed but I (davidlgj) strongly believe its time to drop Angular 1.2 support since it complicates validation code as well.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@talend/json-schema-form-core",
"version": "1.2.3",
"version": "1.2.4",
"description": "JSON-Schema and JSON-UI-Schema utilities for form generation.",
"main": "dist/index.js",
"mainSrc": "src/index.js",
Expand Down Expand Up @@ -39,21 +39,22 @@
"json-schema"
],
"devDependencies": {
"@talend/babel-plugin-assets-api": "^1.3.1",
"@talend/babel-plugin-import-from-index": "^1.7.1",
"@talend/eslint-config": "^13.0.3",
"@talend/eslint-plugin": "^1.1.1",
"@talend/scripts-core": "^16.3.5",
"@talend/scripts-config-react-webpack": "^16.5.1",
"@talend/scripts-config-typescript": "^11.2.1",
"@talend/babel-plugin-import-from-index": "^1.7.1",
"@talend/babel-plugin-assets-api": "^1.3.1",
"@talend/scripts-core": "^16.3.6",
"@types/chai": "^3.5.2",
"@types/node": "^6.14.13",
"json-refs": "^3.0.15",
"rimraf": "^3.0.2",
"rimraf": "^5.0.5",
"webpack": "^5.90.3"
},
"dependencies": {
"json-refs": "3.0.15",
"objectpath": "^1.2.2",
"path-browserify": "^1.0.1",
"tv4": "^1.3.0"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// in the list format.
export default function (titleMap: Array<any>, originalEnum?: any) {
if (!Array.isArray(titleMap)) {
const canonical = [];
const canonical: any = [];
if (originalEnum) {
originalEnum.forEach(value => {
canonical.push({ name: titleMap[value], value });
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import chai from 'chai';
import { describe, it } from 'mocha';

import {
canonicalTitleMap,
jsonref,
merge,
schemaDefaults,
select,
traverseSchema,
sfPath,
traverseForm,
traverseSchema,
validate,
sfPath,
schemaDefaults,
canonicalTitleMap,
jsonref,
} from '.';

chai.should();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as JsonRefs from './../lib/json-refs-standalone';
import * as JsonRefs from 'json-refs';

export function jsonref(schema, callBack) {
let promise = new Promise(function (resolve, reject) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const stripNullType = type => {

// Creates an default titleMap list from an enum, i.e. a list of strings.
const enumToTitleMap = enm => {
const titleMap = []; // canonical titleMap format is a list.
const titleMap: any = []; // canonical titleMap format is a list.
enm.forEach(name => {
titleMap.push({ name, value: name });
});
Expand Down Expand Up @@ -94,7 +94,7 @@ export function stdFormObj(name, schema, options) {
f.validationMessage = schema.validationMessage;
}
if (schema.enumNames) {
f.titleMap = canonicalTitleMap(schema.enumNames, schema['enum']);
f.titleMap = canonicalTitleMap(schema.enumNames, schema.enum);
}
f.schema = schema;

Expand All @@ -107,7 +107,7 @@ export function stdFormObj(name, schema, options) {

/*** Schema types to form type mappings, with defaults ***/
export function text(name, schema, options) {
if (stripNullType(schema.type) === 'string' && !schema['enum']) {
if (stripNullType(schema.type) === 'string' && !schema.enum) {
const f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'text';
Expand Down Expand Up @@ -149,25 +149,25 @@ export function checkbox(name, schema, options) {
}

export function select(name, schema, options) {
if (stripNullType(schema.type) === 'string' && schema['enum']) {
if (stripNullType(schema.type) === 'string' && schema.enum) {
const f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'select';
if (!f.titleMap) {
f.titleMap = enumToTitleMap(schema['enum']);
f.titleMap = enumToTitleMap(schema.enum);
}
options.lookup[stringify(options.path)] = f;
return f;
}
}

export function checkboxes(name, schema, options) {
if (stripNullType(schema.type) === 'array' && schema.items && schema.items['enum']) {
if (stripNullType(schema.type) === 'array' && schema.items && schema.items.enum) {
const f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'checkboxes';
if (!f.titleMap) {
f.titleMap = enumToTitleMap(schema.items['enum']);
f.titleMap = enumToTitleMap(schema.items.enum);
}
options.lookup[stringify(options.path)] = f;
return f;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 76f9b35

Please sign in to comment.