@orkestrel/scaffold 0.0.86 → 0.0.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,7 @@ import policyPlugin, {
36
36
  MOCKING_RULE,
37
37
  NESTED_RULE,
38
38
  PARSER_RULE,
39
+ PLUGIN_RULE,
39
40
  POLICY_BANNED_TERMS,
40
41
  POLICY_ENDING_GLOBS,
41
42
  POLICY_JUDGED_TERMS,
@@ -1614,6 +1615,12 @@ createSomething({
1614
1615
  code: 'const COUNT = 1',
1615
1616
  errors: [{ messageId: 'hidden' }],
1616
1617
  },
1618
+ {
1619
+ name: 'rejects a hidden plugin factory [membership: declarations in a centralized file without an export]',
1620
+ filename: 'src/worker/plugins.ts',
1621
+ code: 'function createModalPlugin(): void {}',
1622
+ errors: [{ messageId: 'hidden' }],
1623
+ },
1617
1624
  ],
1618
1625
  })
1619
1626
 
@@ -1721,6 +1728,11 @@ createSomething({
1721
1728
  filename: 'src/worker/helpers.ts',
1722
1729
  code: 'export function buildValue(): void {}',
1723
1730
  },
1731
+ {
1732
+ name: 'accepts a plugin factory in plugins.ts',
1733
+ filename: 'src/worker/plugins.ts',
1734
+ code: 'export function createModalPlugin(): void {}',
1735
+ },
1724
1736
  {
1725
1737
  name: 'accepts a module in a registered function domain',
1726
1738
  filename: 'app/browser/composables/useTheme.ts',
@@ -1871,6 +1883,12 @@ createSomething({
1871
1883
  code: 'export const coerceValue = () => undefined',
1872
1884
  errors: [{ messageId: 'parser' }],
1873
1885
  },
1886
+ {
1887
+ name: 'rejects an unprefixed export alias [membership: parsers.ts functions whose name does not start with parse]',
1888
+ filename: 'app/edge/parsers.ts',
1889
+ code: 'function parseValue(): void {}\nexport { parseValue as coerceValue }',
1890
+ errors: [{ messageId: 'parser' }],
1891
+ },
1874
1892
  ],
1875
1893
  })
1876
1894
 
@@ -1900,6 +1918,122 @@ createSomething({
1900
1918
  code: 'export const buildValue = () => undefined',
1901
1919
  errors: [{ messageId: 'factory' }],
1902
1920
  },
1921
+ {
1922
+ name: 'rejects an unprefixed export alias [membership: factories.ts functions whose name does not start with create]',
1923
+ filename: 'app/edge/factories.ts',
1924
+ code: 'function createValue(): void {}\nexport { createValue as buildValue }',
1925
+ errors: [{ messageId: 'factory' }],
1926
+ },
1927
+ ],
1928
+ })
1929
+
1930
+ tester.run('no-misnamed-plugin', PLUGIN_RULE, {
1931
+ valid: [
1932
+ {
1933
+ name: 'accepts a create-prefixed plugin factory',
1934
+ filename: 'src/edge/plugins.ts',
1935
+ code: 'export function createModalPlugin(): void {}',
1936
+ },
1937
+ {
1938
+ name: 'accepts a create-prefixed plugin collection factory',
1939
+ filename: 'src/edge/plugins.ts',
1940
+ code: 'export const createBootstrapPlugins = () => undefined',
1941
+ },
1942
+ {
1943
+ name: 'accepts a plugin-suffixed name outside plugins.ts',
1944
+ filename: 'src/edge/helpers.ts',
1945
+ code: 'export function registerPlugin(): void {}',
1946
+ },
1947
+ {
1948
+ name: 'reads no binding nested inside a plugin factory',
1949
+ filename: 'src/edge/plugins.ts',
1950
+ code: 'export function createModalPlugin(): void {\n\tfunction build(): void {}\n\tbuild()\n}',
1951
+ },
1952
+ {
1953
+ name: 'accepts an export specifier in the plugin form',
1954
+ filename: 'src/edge/plugins.ts',
1955
+ code: 'function createModalPlugin(): void {}\nexport { createModalPlugin as createDialogPlugin }',
1956
+ },
1957
+ ],
1958
+ invalid: [
1959
+ {
1960
+ name: 'rejects a plugin-suffixed name without the create prefix [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1961
+ filename: 'src/edge/plugins.ts',
1962
+ code: 'export function registerModalPlugin(): void {}',
1963
+ errors: [{ messageId: 'plugin' }],
1964
+ },
1965
+ {
1966
+ name: 'rejects a lowercase segment before the plugin suffix [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1967
+ filename: 'src/edge/plugins.ts',
1968
+ code: 'export function createmodalPlugin(): void {}',
1969
+ errors: [{ messageId: 'plugin' }],
1970
+ },
1971
+ {
1972
+ name: 'rejects a name that runs past the plugin suffix [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1973
+ filename: 'src/edge/plugins.ts',
1974
+ code: 'export function createModalPluginHost(): void {}',
1975
+ errors: [{ messageId: 'plugin' }],
1976
+ },
1977
+ {
1978
+ name: 'rejects a plugin factory with no entity segment [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1979
+ filename: 'src/edge/plugins.ts',
1980
+ code: 'export function createPlugin(): void {}',
1981
+ errors: [{ messageId: 'plugin' }],
1982
+ },
1983
+ {
1984
+ name: 'rejects a misnamed declared signature [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1985
+ filename: 'src/edge/plugins.ts',
1986
+ code: 'export declare function registerModal(): void',
1987
+ errors: [{ messageId: 'plugin' }],
1988
+ },
1989
+ {
1990
+ name: 'rejects an anonymous default function [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1991
+ filename: 'src/edge/plugins.ts',
1992
+ code: 'export default function (): void {}',
1993
+ errors: [{ messageId: 'plugin' }],
1994
+ },
1995
+ {
1996
+ name: 'rejects an export alias outside the plugin form [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
1997
+ filename: 'src/edge/plugins.ts',
1998
+ code: 'function createModalPlugin(): void {}\nexport { createModalPlugin as registerModal }',
1999
+ errors: [{ messageId: 'plugin' }],
2000
+ },
2001
+ {
2002
+ name: 'rejects a re-export outside the plugin form [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
2003
+ filename: 'src/edge/plugins.ts',
2004
+ code: "export { registerModal } from './modal.js'",
2005
+ errors: [{ messageId: 'plugin' }],
2006
+ },
2007
+ {
2008
+ name: 'rejects a star re-export whose names the form cannot read [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
2009
+ filename: 'src/edge/plugins.ts',
2010
+ code: "export * from './modal.js'",
2011
+ errors: [{ messageId: 'plugin' }],
2012
+ },
2013
+ {
2014
+ name: 'rejects a register-prefixed plugin factory [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
2015
+ filename: 'src/edge/plugins.ts',
2016
+ code: 'export function registerModal(): void {}',
2017
+ errors: [{ messageId: 'plugin' }],
2018
+ },
2019
+ {
2020
+ name: 'rejects a create-prefixed name without the plugin suffix [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
2021
+ filename: 'src/edge/plugins.ts',
2022
+ code: 'export const createModal = () => undefined',
2023
+ errors: [{ messageId: 'plugin' }],
2024
+ },
2025
+ {
2026
+ name: 'rejects a bare plugin-suffixed name [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
2027
+ filename: 'src/edge/plugins.ts',
2028
+ code: 'export function modalPlugin(): void {}',
2029
+ errors: [{ messageId: 'plugin' }],
2030
+ },
2031
+ {
2032
+ name: 'rejects a lowercase entity after create [membership: plugins.ts functions whose name is not create…Plugin or create…Plugins]',
2033
+ filename: 'src/edge/plugins.ts',
2034
+ code: 'export function createplugin(): void {}',
2035
+ errors: [{ messageId: 'plugin' }],
2036
+ },
1903
2037
  ],
1904
2038
  })
1905
2039
 
@@ -2385,6 +2519,12 @@ createSomething({
2385
2519
  expect(CENTRAL_SOURCE_FILES).toContain('handlers.ts')
2386
2520
  })
2387
2521
 
2522
+ it('registers plugins as a central function kind', () => {
2523
+ expect(FUNCTION_SOURCE_FILES).toContain('plugins.ts')
2524
+ expect(CENTRAL_SOURCE_FILES).toContain('plugins.ts')
2525
+ expect(DATA_SOURCE_FILES).not.toContain('plugins.ts')
2526
+ })
2527
+
2388
2528
  it('matches every isolated import pattern with refused and admitted fixtures', () => {
2389
2529
  const fixture = createPolicyScratch({ prefix: 'propagation-patterns-' })
2390
2530
  const scratch = fixture.path
@@ -2734,6 +2874,7 @@ createSomething({
2734
2874
  )
2735
2875
  scratch.write('src/violations/parsers.ts', 'export function coerceValue(): void {}\n')
2736
2876
  scratch.write('src/violations/factories.ts', 'export function buildValue(): void {}\n')
2877
+ scratch.write('src/violations/plugins.ts', 'export function registerModal(): void {}\n')
2737
2878
  scratch.write('src/violations/constants.ts', 'export const values = []\n')
2738
2879
  scratch.write('src/violations/composables.ts', "export const READY = 'yes'\n")
2739
2880
  scratch.write('app/browser/composables/useTheme.ts', 'export function useMode(): void {}\n')
@@ -2837,6 +2978,7 @@ createSomething({
2837
2978
  { code: 'policy(no-hidden-declaration)', filename: 'src/violations/helpers.ts' },
2838
2979
  { code: 'policy(no-misnamed-parser)', filename: 'src/violations/parsers.ts' },
2839
2980
  { code: 'policy(no-misnamed-factory)', filename: 'src/violations/factories.ts' },
2981
+ { code: 'policy(no-misnamed-plugin)', filename: 'src/violations/plugins.ts' },
2840
2982
  { code: 'policy(no-malformed-constant)', filename: 'src/violations/constants.ts' },
2841
2983
  { code: 'policy(no-malformed-domain)', filename: 'src/violations/composables.ts' },
2842
2984
  {
@@ -4,7 +4,7 @@ let _orkestrel_template = require("@orkestrel/template");
4
4
  let _orkestrel_emitter = require("@orkestrel/emitter");
5
5
  var package_default = {
6
6
  name: "@orkestrel/scaffold",
7
- version: "0.0.86",
7
+ version: "0.0.87",
8
8
  description: "Scaffold workspaces with commands: new, audit, repair, catalog, and overwrite.",
9
9
  keywords: [
10
10
  "audit",
@@ -104,7 +104,7 @@ var package_default = {
104
104
  devDependencies: {
105
105
  "@microsoft/api-extractor": "^7.59.3",
106
106
  "@orkestrel/browser": "^0.0.20",
107
- "@orkestrel/guide": "^0.0.22",
107
+ "@orkestrel/guide": "^0.0.24",
108
108
  "@orkestrel/html": "^0.0.12",
109
109
  "@orkestrel/probe": "^0.0.19",
110
110
  "@orkestrel/test": "^0.0.24",