text: module.exports = (autogeneratedSchema) => {
    // eslint-disable-next-line no-param-reassign
    delete autogeneratedSchema.$schema;
  
    return {
      type: 'object',
      title: 'platform.json schema',
      $schema: 'http://json-schema.org/draft-07/schema#',
      required: ['projects'],
      additionalProperties: false,
      properties: {
        $schema: {
          type: 'string',
        },
        projects: {
          type: 'object',
          title: 'Project configs',
          minProperties: 1,
          patternProperties: {
            '^[$a-zA-Z_-][0-9a-zA-Z_$-]*$': {
              if: {
                properties: {
                  type: { const: 'application' },
                },
              },
              then: autogeneratedSchema.properties.application,
              else: {
                if: {
                  properties: {
                    type: { const: 'module' },
                  },
                },
                then: autogeneratedSchema.properties.module,
                else: {
                  if: {
                    properties: {
                      type: { const: 'child-app' },
                    },
                  },
                  then: autogeneratedSchema.properties['child-app'],
                  else: autogeneratedSchema.properties.package,
                },
              },
            },
          },
          default: {},
        },
        migrations: {
          type: 'object',
          additionalProperties: false,
          properties: {
            sourcePattern: {
              title: 'do migrations only for files that match a glob pattern',
              type: 'array',
              items: {
                type: 'string',
              },
            },
            ignorePattern: {
              title: 'skip migrations for files that match a glob pattern',
              type: 'array',
              items: {
                type: 'string',
              },
            },
          },
        },
      },
    };
  };
  